Isn't angle_max in sensor_msgs/LaserScan redundant?

asked 2016-04-04 13:33:53 -0600

Sebastian gravatar image

If you look at a LaserScan message it has the fields:

  • angle_min
  • angle_max
  • angle_increment etc...

Am I wrong, or isn't the angle_max field completely useless and redundant? The max angle can be calculated by:

angle_max = angle_min + angle_increment * ranges.size()

I have never come across a case where angle_max disagreed with that equation. In fact, if there was such a disagreement it would imply a very strange error. Most code I see or write doesn't even use the angle_max reading and chooses to ignore it.

So, is there some use for this that I am missing?

edit retag flag offensive close merge delete

Comments

hmm maybe against floating point errors? (Just a wild guess)

Humpelstilzchen gravatar image Humpelstilzchen  ( 2016-04-05 02:31:58 -0600 )edit

This would make the most sense to me. Especially since laser scans can have thousands of points in them. The slight float point precision error will add up.

ChuiV gravatar image ChuiV  ( 2019-06-18 11:30:45 -0600 )edit