Ask Your Question
0

using oni files in openni_camera node

asked 2011-02-21 02:16:41 -0600

Wilco gravatar image

updated 2011-02-25 10:06:22 -0600

tfoote gravatar image

Hallo,

I've tried to get the .oni files as input instead of the camera by changing the initialization to the way the NiViewer example works with the xml file (status = context_.InitFromXmlFile(SAMPLE_XML_PATH, &errors);) . It works when selecting input sources from the camera that way, but when giving an .oni file with rgb and depth streams in I get this error:

[ERROR] [1298297598.491463836]: [OpenNIDriver::spin] Error in switching on depth stream registration: This operation is invalid!
[ERROR] [1298297599.031286629]: [OpenNIDriver::spin] Error in switching on depth stream registration: This operation is invalid!
[ERROR] [1298297599.031449831]: [OpenNIDriver::spin] Error in switching on depth stream registration: This operation is invalid!

Same settings work fine with NiViewer but I seem to be missing something to get it to work in the openni_camera node but I don't see it. Any idea's what I'm missing?

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
1

answered 2011-03-03 04:53:04 -0600

tfoote gravatar image

updated 2011-03-05 04:49:22 -0600

The openni_cameara node is designed to read from the device and output ROS messages. As far as I know it doesn't have support for ONI recording or playback. If you want, you can make a feature request of it at https://kforge.ros.org/openni/Trac/newticket?component=openni_kinect&keywords=openni_camera&type=enhancement

edit flag offensive delete link more
0

answered 2013-02-01 08:17:47 -0600

Here's the solution: http://answers.ros.org/question/36487/using-rgbdslam-with-oni-files/

edit flag offensive delete link more
0

answered 2012-04-25 05:07:17 -0600

tayyab gravatar image

updated 2012-04-25 05:07:59 -0600

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

edit flag offensive delete link more
0

answered 2011-03-03 21:44:41 -0600

Wilco gravatar image

I had hoped it was designed to preserve the input flexibility as present in openni.

My personal solution has been to make the code I wanted to use ROS independent. But it might save people time in the future to allow oni files.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-02-21 02:16:41 -0600

Seen: 2,306 times

Last updated: Feb 01 '13