How to get a depth image from Velodyne Lidar?

asked Apr 20 '18

fpicetti gravatar image

updated Apr 20 '18

Hello all, I would like to get a depth image from my Velodyne VLP-16 Lidar.

I expect to have an image, or a matrix, with size Nx16, where 16 is the number of lasers in vertical and N is the number of measurements that span a complete 360 degrees scan. The pixel should contain the measured distance.

I see 3 different way to do that, but none of them is perfect. Which you would recommend?

  1. Assembly 16 different LaserScan. Unfortunately, the Velodyne driver provides only one of them at a time. Should I modify the driver?
  2. Assembly many different /velodyne_packets. Unfortunately, a packet span a small angle, so I should load many packets and take care of the angles.
  3. Use Pointcloud_to_laserscan. I don't like this solution because it means that the driver has to generate the pointcloud (transforming angle and distances into XYZ) and then do the reverse. It is the chosen solution here.

Do you see any other solution? Maybe exist some piece of software that can do that for me? Any suggestion?

Thank you!

EDIT: The Velodyne ROS driver, when publishing the LaserScan is actually performing the same as Pointcloud_to_laserscan. It gets the PointCloud2 message, select only the point belonging to a specified ring and perform arc tangent (to get the angle back) and Euclidean distance, as you can see from this code.

This doesn't look smart to me. For prototyping I could go for solution 1, but solution 2 is the lightest.

Preview: (hide)

Comments

Hey there! how did you managed it in the end? i am looking for a similar approach. regards

fwarmuth gravatar image fwarmuth  ( Jun 5 '20 )edit