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

Obtaining depth data from kinect

asked 2015-07-27 15:01:44 -0500

pnambiar gravatar image

I am able to publish data from kinect using freenect_launch. How do I view extract the depth data using a python script. I am interested in obtaining the depth value corresponding to each of the pixel in the RGB image.

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-07-27 17:34:23 -0500

luc gravatar image

Have you tried rostopic echo-ing the topic? In the sensor_msgs/PointCloud message, there is a points object of geometry_msgs/Point32's which have an X, Y, and Z for each point found by the camera. I'd recommend looking there.

After that, look in the ROS subscriber python tutorials to get an idea of how to subscribe to that topic, and use the correct part of the message in the callback function that you define to populate the list of depths you need.

You will probably need to transform the points into whatever reference frame you need.

edit flag offensive delete link more

Question Tools



Asked: 2015-07-27 15:01:44 -0500

Seen: 625 times

Last updated: Jul 27 '15