slam_toolbox incomplete mapping
Installed slam_toolbox on Foxy, Ubuntu 20.04:
sudo apt install ros-foxy-slam-toolbox
Set up the yaml like:
odom_frame: odom
map_frame: map
base_frame: base_link
scan_topic: /scan
Run
ros2 launch slam_toolbox online_sync_launch.py
Provided transforms:
odom -> base_link - dynamic from odom node (or static for testing - the same result)
base_link -> laser - static
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 base_link laser
I see the /map topic in Rviz.
Rviz has an error but still show the map:
[INFO] [1648148542.387284934] [rviz2]: Trying to create a map of size 299 x 171 using 1 swatches
[ERROR] [1648148542.393145177] [rviz2]: Vertex Program:rviz/glsl120/indexed_8bit_image.vert Fragment Program:rviz/glsl120/indexed_8bit_image.frag GLSL link result :
active samplers with a different type refer to the same texture image unit
The messages from slam_toolbox node:
INFO] [launch]: All log files can be found below /home/ys/.ros/log/2022-03-24-15-01-57-027859-ys-ubuntu-39307
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [sync_slam_toolbox_node-1]: process started with pid [39309]
[sync_slam_toolbox_node-1] [INFO] [1648148517.251239498] [slam_toolbox]: Node using stack size 40000000
[sync_slam_toolbox_node-1] [INFO] [1648148517.343822743] [slam_toolbox]: Using solver plugin solver_plugins::CeresSolver
[sync_slam_toolbox_node-1] [INFO] [1648148517.345019501] [slam_toolbox]: CeresSolver: Using SCHUR_JACOBI preconditioner.
[sync_slam_toolbox_node-1] Registering sensor: [Custom Described Lidar]
Why do I have this weird looking map? With the same input I'm getting a perfect map with gmapping slam.
It's not only Rviz issue BTW. I'm really getting occupancy grid 2D array with this layout.
It appears like the mapping looks good in the area close to the scanner. Could it be that it's the maximum distance issue? My scanner is long range laser and the grid on the pic is 1m.
Have you tried running slam toolbox in async mode? When I run mine in sync mode, I only get one scan result (similar to what you posted) and with async I get better results.