SteveMacenski / slam_toolbox

Slam Toolbox for lifelong mapping and localization in potentially massive maps with ROS
GNU Lesser General Public License v2.1
1.67k stars 525 forks source link

Slam toolbox send empty map after being exposed to symetrical LaserScan #566

Closed arslogavitabrevis closed 1 year ago

arslogavitabrevis commented 1 year ago

Required Info:

Steps to reproduce issue

Send some LaserScan message to SlamToolbox with ranges values all to the same value (like if the laser scaner was in a perfect circle). The data field from the /map topic is empty. (At this point this is not really an issue because there is few chance that the scanner is place in the center of a perfect circular space.) Then send some normal LaserScan messages. The /map message stay empty untill you restart slamtoolbox.

Expected behavior

Slamtoolbox should be able to output map even if it has been exposed to invalid data previously.

Actual behavior

Slamtoolbox doesn't restart sending map when clean data is received after some invalid data were received.

SteveMacenski commented 1 year ago

Did you move around to collect data to generate probablistic values, see errors in the terminal? There's no reason why laser scans containing any arbitrary thing would have any different outcome. There's no analysis of the content of the scans other than 0s, Infs or NaNs. Are you sure the scans are actually even getting to the package?

arslogavitabrevis commented 1 year ago

Hi,

I just tried it with turtlebot3 and it seem to be there also. Here is how I tested it: Modified slam_toolbox default parameter file to use scan from the topic /scan_out: scan_topic: /scan_out modified_mapper_params_online_sync.yaml.txt

Use a python script to modify the data from the scan topic and publish them in /scan_out test_lidar_all_same_range.py.txt

Run turtlebot from nav2_bringup: ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False slam:=True x_pose:=-1.75 slam_params_file:=./modified_mapper_params_online_sync.yaml

I checked the /scan_out topic to see when the data become valid. ros2 topic echo /scan_out

I checked to be sure it is connected to /scan_out ros2 node info /slam_toolbox

When the data become valid, the data in the /map topic is still empty. ros2 topic echo /map

Be sure to restart the python script before restarting turtlebot.

Thanks you for following up with me on this.

SteveMacenski commented 1 year ago

Please ask on or search ROS Answers. I don’t have the cycles to debug custom scripts

arslogavitabrevis commented 1 year ago

Hi Steeve,

Sorry for being unclear, the python script is only there to replicate easily the condition where I encontered the issue. It's purpose is only to send some LaserScan msg with all range to range_max +1 for 10 second then pass the LaserScan message as they are produced by the Gazebo plugin after that.

If you prefer you can use another way to produce the reproduction conditions.

I did not encountered the issue on turtlebot at first. I just replicated it on turtlebot to make it easier for debuging.

SteveMacenski commented 1 year ago

If you make the laser scan messages contain things that are larger than max range away, of course no map would be generated, because all of the scan beams are invalid as being too far away to be considered in the occupancy grid.

arslogavitabrevis commented 1 year ago

I agree that if the laser scan message contain large range values there won't be a published map.

But, if some scan message containing larger than max range values have been received before, when the scan message goes back to containing valid data, there is still no map generated.