0
$\begingroup$

Rosanswers logo

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


Originally posted by pnambiar on ROS Answers with karma: 120 on 2015-07-27

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by luc with karma: 350 on 2015-07-27

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.