0
$\begingroup$

Rosanswers logo

Recently, I'm using VLP-16 to get point cloud data. But I am really confused about the structure of sensor_msgs/PointCloud2. I used the commend $ rostopic echo /velodyne_points to check the data. I have known that 32 numbers are used to describe a point. But how to transform these numbers to x, y, z coordinate of the points ? Thanks.

For example: 164, 129, 148, 191, 79, 29, 4, 191, 114, 146, 181, 188, 1, 0, 0, 0, 0, 0, 128, 63, 7, 0, 0, 0, 70, 88, 8, 112, 61, 127, 0, 0, 163, 248, 106, 191, 20, 9, 209, 190, 228, 208, 137, 62, 1, 0, 0, 0, 0, 0, 0, 64, 15, 0, 0, 0, 70, 88, 8, 112, 61, 127, 0, 0, 226, 211, 151, 191, 178, 208, 6, 191, 65, 147, 185, 60, 1, 0, 0, 0, 0, 0, 176, 66, 8, 0, 0, 0, 70, 88, 8, 112, 61, 127, 0, 0,


Originally posted by iROS on ROS Answers with karma: 3 on 2016-08-04

Post score: 0


Original comments

Comment by z1huo on 2018-08-18:
I am facing the same problem, could you tell me how that structure works? Thanks!

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The PointCloud2 message is defined here: http://docs.ros.org/api/sensor_msgs/html/msg/PointCloud2.html

For interacting with PointClouds it's common to use the PCL datatype: http://wiki.ros.org/pcl_ros You can subscribe and publish directly as a PCL datatype using pcl_ros/point_cloud.h

There are also a couple of iterators defined in sensor_msgs to allow access to the PointCloud2 message without the added dependency on pcl: http://docs.ros.org/api/sensor_msgs/html/annotated.html


Originally posted by tfoote with karma: 58457 on 2016-08-08

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by iROS on 2016-08-10:
Thanks a lot. And I have solved this problem now.

Comment by tfoote on 2016-08-11:
Please click the checkmark buttom at left to indicate your question is solved.

Comment by MohamedEhab on 2019-04-16:
Can you please tell me what solution did you use??

$\endgroup$

Your Answer

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