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


asked 2014-07-16 04:04:00 -0600

ROSkinect gravatar image

How can I get depth_registered from the Kinect and what topic should I use ?

and It is the same imageCallback as depth (/camera/depth/image)?

void imageCallback(const sensor_msgs::ImageConstPtr& msg)

    cv_bridge::CvImagePtr cv_ptr;

        cv_ptr = cv_bridge::toCvCopy(msg1, sensor_msgs::image_encodings::TYPE_32FC1);

    catch (cv_bridge::Exception& e)
        ROS_ERROR("cv_bridge exception: %s", e.what());

    cv::imshow("OpenCV viewer Kinect ", cv_ptr->image);



I tried this ones:



but I didn't get any resulat. so what should I do ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-16 06:59:34 -0600

McMurdo gravatar image

updated 2014-07-16 07:05:51 -0600

/camera/depth_registered/points publishes point clouds and not Image.

You can convert it from a sensor_msgs::PointCloud2 to a pcl::PointCloud <pcl::PointXYZRGB> data type.

Are you using openni.launch from openni_launch pkg?

If yes, the topic /camera/depth_registered/image_raw should work for you.

You can learn the type of the topic by using -

rostopic type <topic name>

If I remember correctly there is an 'arg' called depth_registration that should be set to true if you want depth registration to be available. I am not exactly sure. Please check openni.launch file and try setting it to true if it is false.

Though this seems off-topic, this provides some useful info on the different topics

edit flag offensive delete link more


very usefull answer, I can subscribe to the topic but I get something like that: What does it mean this ? I'm converting the data that I get from the kinect from float to 8UC.

ROSkinect gravatar image ROSkinect  ( 2014-07-16 07:28:52 -0600 )edit

What do you intend to do with your data? Why do you need point cloud data? Please update your question and tell how exactly you solved it. It will be useful for others to see how you solved it. Please point out the exact mistake and the remedy.

McMurdo gravatar image McMurdo  ( 2014-07-16 08:23:52 -0600 )edit

And accept an answer that solves the issue, because that way others can rely on the answer if they have the same problem.

McMurdo gravatar image McMurdo  ( 2014-07-16 08:24:41 -0600 )edit

So the main solution is to launch the kinect command with a parameter like that: roslaunch openni_launch openni.launch depth_registration:=true and then you can subscribe to the topic normally. That's it.

ROSkinect gravatar image ROSkinect  ( 2014-07-16 08:35:11 -0600 )edit

Question Tools



Asked: 2014-07-16 04:04:00 -0600

Seen: 3,527 times

Last updated: Jul 16 '14