Ask Your Question

Revision history [back]

The points in the LaserScan message are stores in polar coordinates in a fairly compressed way to save space.

You'll need to loop through the ranges array calculating the angle for that specific point using the equation:

angle = angle_min + (i * angle_increment)

where i is the index within the ranges array.

This will give you the polar coordinate of the point which you can convert to a 2D Cartesian point using the usual method here. The Z coordinates of laser scan points are always zero because this message type stores 2D horizontal laser scan data.

Hope this helps.