slam_karto icon indicating copy to clipboard operation
slam_karto copied to clipboard

Robustness with respect to unclear meaning of angle_max in LaserScan message

Open moooeeeep opened this issue 6 years ago • 3 comments

This post might be relevant to you:

  • https://answers.ros.org/question/286695

In order to address this, you could change this line:

laser->SetMaximumAngle(scan->angle_max);

to this:

laser->SetMaximumAngle(scan->angle_min + (scan->ranges.size()-1)*scan->angle_increment);

moooeeeep avatar Mar 28 '18 13:03 moooeeeep

I don't understand why this is relevant? Please provide some more context? The two lines are equivalent but scan->angle_max is more straightforward to read.

lucbettaieb avatar Mar 29 '18 21:03 lucbettaieb

In practice it's not equivalent. Currently the relation is more like this:

scan->angle_max >= scan->angle_min + (scan->ranges.size()-1)*scan->angle_increment

Therefore open_karto currently produces errors like this when it's used with laser scans published by nodes like pointcloud_to_laserscan that set scan->angle_max larger than the last available angle actually is.

moooeeeep avatar Mar 30 '18 13:03 moooeeeep

Gotcha. Sorry for the late response.

You are welcome to open up a pull request with a test included that addresses this problem.

lucbettaieb avatar Jun 14 '18 20:06 lucbettaieb