0
$\begingroup$

Rosanswers logo

Hello,

I am trying to translate the TurtleBot "follower" program (written in C++) to Python but I'm not sure how to read the (x, y, z) values from the PointCloud2 message returned by the Kinect without using PCL. I know I can use the depth image from the Kinect on /camera/depth/image but I'd rather use the PointCloud2 message type if possible.

I can subscribe to the /camera/depth/points or /camera/rgb/points topic and print back things like the message header and field names, but I'm not sure how to get the actual x, y and z data values so that I can iterate through them and compute average values. Does anyone know the magic incantation?

Thanks!
patrick


Originally posted by Pi Robot on ROS Answers with karma: 4046 on 2012-06-04

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Apparently this functionality is a part of sensor_msgs package, here's a link to relevant file.


Originally posted by arebgun with karma: 2121 on 2012-06-04

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Pi Robot on 2012-06-04:
Thanks @arebgun. I'm wondering if this has made it into the Electric debs yet? I grabbed the source for sensor_msgs from trunk and although it compiled fine, I can't seem to use it in my follower package. When doing a rosmake I get "Package sensor_msgs was not found in the pkg-config search path"

Comment by arebgun on 2012-06-04:
It doesn't look like this file is in the electric tree. The file is 4 months old, so I doubt that electric will have that functionality at all. 1.7.x and later series of the stack have this python file, so Fuerte should have this, but not Electric (1.6.x. series).

$\endgroup$

Your Answer

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