ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Lidar - What is the difference between the /scan and PointCloud?

asked 2022-05-18 17:26:58 -0600

kiru gravatar image

updated 2022-05-20 14:50:42 -0600

I watched a tutorial for converting laser scan data to point cloud.

But I could not understand how this conversion works.

What is the difference between the scan and point-cloud data and what are these codes doing? The tutorials were not in detail for theoretical parts and everything I could read was just focused on the results.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-05-19 07:49:37 -0600

Joe28965 gravatar image

I hope I'll be able to explain it enough.

First, I think it's important to look at the LaserScan message. The first part after the header gives you the min and max angle + the distance between each measurement.

So imagine a circle with a midpoint. The midpoint is your lidar_link so it has a 'front' (the direction of the x axis). The front is your 0 rad.

If you have a min_angle of pi (-90 degrees, I'm going to stick with degrees from here on, but it's actually rads) you know where to start. Your float32[] ranges is a list of ranges. The first range is at -90 degrees. If your angle_increment is 1 degree, then the second range is at -89 the third at -88 etc.

That's kinda like one of those hand fans where each of the blades is 1 range.

In a way, that means the LaserScan message is not really 2D. It's a list of 1D lengths that you make 2D by plotting them out on a circle.

Now for pointclouds. If somebody has more experience with them, please correct me. However, I have always understood it as being an actual 2(or3)D pointcloud.

Looking back at the lidar_link (or pointcloud_link if you will), it doesn't just have a 'front'. It has an x, y and z axis. It is a 3D origin. If you have a point (2, 0, 1) that's a point 2 meter in front of the link and 1 meter up. A pointcloud uses a grid to express each point.

Now for the final part of your question, how the conversion works. If you've got a lidar message, basically have vectors with a magnitude and length (hopefully khanacademy helps explaining what I mean). In the link I posted, they went from a point (a,b) to a magnitude and direction. However, for a lidar to pointcloud conversion you would of course do the opposite. You go from a magnitude and direction to a coordinate.

I hope this helped you a bit with understanding the difference.

edit flag offensive delete link more

Comments

4

A good summary I've always found is that a laser scan is essentially a set of points in a polar coordinate system (length and direction), while a point cloud stores points in a Cartesian coordinate system.

Conceptually, there is also the difference that a laser scan is the result of a radial measurement (ie: single sensor in the middle), while a point cloud is typically the result of many sensors in parallel (ie: line or square of sensors).

This implies a laser scan also typically is not composed of measurements measured at the same time, but the first point will be captured at an earlier time than the last (and this can be a significant amount of time).

The points in a point cloud are typically considered to be captured all at the same time (there is often a non-zero delta-t between the first and last points, but it ...(more)

gvdhoorn gravatar image gvdhoorn  ( 2022-05-19 07:59:09 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2022-05-18 17:26:58 -0600

Seen: 899 times

Last updated: May 20 '22