How to get a depth image from Velodyne Lidar?

asked 2018-04-20 06:38:06 -0500

fpicetti gravatar image

updated 2018-04-20 07:50:10 -0500

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.

edit retag flag offensive close merge delete

Comments

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

fwarmuth gravatar image fwarmuth  ( 2020-06-05 04:32:50 -0500 )edit