Search code examples
c#intelrealsense

Difference in creating PXCMSenseManager with Intel RealSense


I found that i can create PXCMSenseManager in 2 different ways (as i think now)

First one :

  • Create session and then from it get senseManager

    var session = PXCMSession.CreateInstance(); var sm = session.CreateSenseManager();

  • Second way - just create instance from PXCMSenseManager class

    var pp = PXCMSenseManager.CreateInstance();

I haven't found any documentation that can explain what way is correct. Hope there smbd can help me.


Solution

  • The documentation of the PXCMSenseManager.CreateInstance(); method states:

    This is a convenience function that skips session creation.

    Too me, that says that either way is fine. If you need the Session before the SenseManager (for example to create some of the other modules), then create the session first.

    Otherwise just go straight to the SenseManager. The SenseManager then creates a session for you and if you need the session later on, just use SenseManager::QuerySession()