ros-drivers / velodyne

ROS support for Velodyne 3D LIDARs
http://ros.org/wiki/velodyne
Other
646 stars 643 forks source link

Is it possible to access a point's ring number from PointCloud2 topics? #468

Closed JeffR1992 closed 2 years ago

JeffR1992 commented 2 years ago

Since the Velodyne driver publishes point clouds using the sensor_msgs/PointCloud2 topic, I wanted to ask if it's possible to access the ring number that a particular point belongs to.

Better yet, is there a way to convert the PointCloud2 topic into an MxNx3 "structured/organized" point cloud array, where M is the number of rows/rings and N is the number of columns (number of points in each ring) (e.g. something similar to what Ouster does)?

Any help would be appreciated, thanks.

JWhitleyWork commented 2 years ago

To organize the cloud by ring, simply set the parameter organize_cloud to True. For accessing the ring, it is included in the PointCloud2 object as a field. Each point includes X, Y, Z, I (intensity), R (ring), and T (time).