Rosanswers logo

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


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.

image description

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.

Originally posted by nigeno on ROS Answers with karma: 76 on 2022-03-24

Post score: 0

Original comments

Comment by iangillespie on 2022-03-24:
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.


1 Answer 1


Rosanswers logo

Thank you. Actually when I moved the scanner, the mapping filled itself, so it appears like the behavior is normal, though was not as expected compared to how gmapping built the same map.

Originally posted by nigeno with karma: 76 on 2022-03-25

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.