OpenNI 1.5.4: Configuring OpenNI using an XML file


Configuring OpenNI using an XML file

The following code configures OpenNI using an XML file, and then makes sure the nodes it needs exist:

// Initialize OpenNI context using an XML file
xn::Context context;
nRetVal = context.InitFromXmlFile(".\\Config.xml", NULL);
// TODO: check error code

// Look for the depth node
xn::DepthGenerator depth;
nRetVal = context.FindExistingNode(XN_NODE_TYPE_DEPTH, depth);
if (nRetVal != XN_STATUS_OK)
    printf("Can't run - no depth generator is present!\n");

// TODO: mainloop - process data
Generated on Wed May 16 2012 10:16:06 for OpenNI 1.5.4 by   doxygen