ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I have been successful in running the OpenNI ROS tracker on recorded .ONI files. This is what you need to do You need to make the following changes in your openni_tracker.cpp

Note: I had created a ros package mimicking the openni_tracker {i.e with same dependencies}. Then i created an Eclipse project for it. It makes debugging and changing the code easier.

// Declare .oni player

xn::Player g_Player;

Instead of

/* string configFilename = ros::package::getPath("openni_tracker") + "/openni_tracker.xml"; XnStatus nRetVal = g_Context.InitFromXmlFile(configFilename.c_str()); CHECK_RC(nRetVal, "InitFromXml");

*/

// added for Reading '.oni' file

XnStatus nRetVal = g_Context.Init();
CHECK_RC(nRetVal, "Init");
nRetVal = g_Context.OpenFileRecording("your .oni file", g_Player);
if (nRetVal != XN_STATUS_OK)
{
printf("Can't open recording %s\n", xnGetStatusString(nRetVal));
return 1;
}

make run openni_tracker

rosrun rviz rviz

Hopefully you will see the skeleton.

For further details you could check my blog link text

I have been successful in running the OpenNI ROS tracker on recorded .ONI files. This is what you need to do You need to make the following changes in your openni_tracker.cpp

Note: I had created a ros package mimicking the openni_tracker {i.e with same dependencies}. Then i created an Eclipse project for it. It makes debugging and changing the code easier.

// Declare .oni player

xn::Player g_Player;

Instead of

/* string configFilename = ros::package::getPath("openni_tracker") + "/openni_tracker.xml"; XnStatus nRetVal = g_Context.InitFromXmlFile(configFilename.c_str()); CHECK_RC(nRetVal, "InitFromXml");

*/

// added for Reading '.oni' file

XnStatus nRetVal = g_Context.Init();
CHECK_RC(nRetVal, "Init");
nRetVal = g_Context.OpenFileRecording("your .oni file", g_Player);
if (nRetVal != XN_STATUS_OK)
{
printf("Can't open recording %s\n", xnGetStatusString(nRetVal));
return 1;
}

make make

run openni_tracker

rosrun rviz rviz

Hopefully you will see the skeleton.

For further details you could check my blog link text