ROS2 | LaserScan faulty data

Hi,

Currently, when there is nothing in front of the lidar, it will publish ranges with the max_range param as its value. Existing ROS2 algorithms are expecting inf in such a case. This specifically breaks slam_toolbox.

For example, our max_range is 2 meters. This is the message from Issac Sim:

...
ranges:
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
...

This is the same message from Gazebo:

...
ranges:
- .inf
- .inf
- .inf
- .inf
- .inf
- .inf
- .inf
- .inf
- .inf
- .inf
- .inf
- .inf
...

Gazebo’s message works perfectly fine, while the one from Isaac Sim is causing bad TF transformations.