From sensor_msgs::PointCloud2 to OpenNI

asked 2014-09-02 09:56:28 -0500

altella gravatar image

Hello all;

I have a gazebo simulated environment that provides topics for kinect sensors, among them "/kinect/depth/points" of type sensor_msgs::PointCLoud2. I want to use this topic for skeleton tracking, and I have found the package openni_tracker. This package, needs a real kinect up and running and uses the first source of 3D information available. Having a look at the file openni_tracker.cpp, in the main function, the sources of information are registered in the following way:

 xn::Context        g_Context;
 xn::DepthGenerator g_DepthGenerator;
 xn::UserGenerator  g_UserGenerator;
nRetVal = g_Context.FindExistingNode(XN_NODE_TYPE_DEPTH, g_DepthGenerator);
CHECK_RC(nRetVal, "Find depth generator");

nRetVal = g_Context.FindExistingNode(XN_NODE_TYPE_USER, g_UserGenerator);
if (nRetVal != XN_STATUS_OK) 
    nRetVal = g_UserGenerator.Create(g_Context);
    CHECK_RC(nRetVal, "Find user generator");

Is there a clear way to subscribe to the gazebo kinect topic, and pass it to the OpenNi context as a "Depth generator"???

Thank you very much in advance.

edit retag flag offensive close merge delete