Discussion - SLAM on our robot with slam_toolbox (Making a Mobile Robot Pt 15)

Welcome! Did you follow the steps from this video? It pretty much covers exactly that.
Do you have prior odometry (e.g. from wheel encoders) or not?

Yes I have encoder motors the same like you the odom move sometimes around so it don’t stay fixed where I started I also tried to set the fixed frame to map to see if it gonna be better but the same after some time the map becomes a mess?

To my environment:
I have carpets and couches where the feet’s are polished steel and also furniture that is light reflecting like a mirror. I think maybe that it goes up and down a little bit and also the reflectioing furniture it’s causing the problem

Hey @JoshNewans, thank you for your response earlier. We seem to have encountered another issue when trying to launch the slam_toolbox. We launched the following files: Launch Robot, Launch Lidar Node, Launch Rviz2, and Launch Slam Toolbox. The following command was used to launch slam toolbox:

ros2 launch slam_toolbox online_async_launch.py params_file:=./src/tankbot_one/config/mapper_params_online_async.yaml use_sim_time:=false

However, the following error message continuously prints and we are unable to make the map on the real robot.

[async_slam_toolbox_node-1] Warning: Invalid frame ID "base_footprint" passed to canTransform argument source_frame - frame does not exist
[async_slam_toolbox_node-1]      	at line 133 in /tmp/binarydeb/ros-foxy-tf2-0.13.14/src/buffer_core.cpp
[async_slam_toolbox_node-1] [WARN] [1686240559.207980460] [slam_toolbox]: Failed to compute odom pose

Please let us know if there is any troubleshooting tips or solution to fix this issue.

I think I mentioned this very briefly in one of the videos (possibly this one?). Some nodes expect a base_footprint frame which should be the same as base_link except sitting on the floor.

If you take a look at my xacro though, I just made it equal to base_link which is fine for this kind of application.

Thank you for your quick response, we had already added this section on the dev machine but not on the robot_ws’s robot_core.xacro file. The issue was resolved after adding it in the robot_ws.


Did you solve it I have exactly the same issue now?

hi i have problem with lauch the simulation like this, and i have try how fix it from John_Nam but still error

[INFO] [launch]: All log files can be found below /home/slamlaptop/.ros/log/2023-06-19-08-20-17-931191-slamlaptop-13333
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [13336]
[INFO] [gzserver-2]: process started with pid [13338]
[INFO] [gazebo_params.yaml-3]: process started with pid [13340]
[INFO] [spawn_entity.py-4]: process started with pid [13343]
[INFO] [spawner.py-5]: process started with pid [13346]
[INFO] [spawner.py-6]: process started with pid [13348]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link base_footprint had 0 children
[robot_state_publisher-1] Link chassis had 2 children
[robot_state_publisher-1] Link caster_wheel had 0 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link left_wheel had 0 children
[robot_state_publisher-1] Link right_wheel had 0 children
[robot_state_publisher-1] [INFO] [1687137618.362613197] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1687137618.362707835] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1687137618.362719560] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1687137618.362725692] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1687137618.362731652] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1687137618.362737300] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1687137618.362742537] [robot_state_publisher]: got segment right_wheel
[spawner.py-5] [INFO] [1687137618.496696023] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1687137618.563077383] [spawner_joint_broad]: Waiting for /controller_manager services
[spawn_entity.py-4] [INFO] [1687137618.644645973] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1687137618.644888215] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-4] [INFO] [1687137618.645893468] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-4] [INFO] [1687137618.760661862] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-4] [INFO] [1687137618.760914195] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-4] [INFO] [1687137619.264630772] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-4] [INFO] [1687137619.545166550] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [my_bot]
[gzserver-2] [WARN] [1687137619.549533517] [rcl]: Found remap rule ‘~/out:=scan’. This syntax is deprecated. Use ‘–ros-args --remap ~/out:=scan’ instead.
[gzserver-2] [WARN] [1687137619.551999532] [rcl]: Found remap rule ‘~/out:=scan’. This syntax is deprecated. Use ‘–ros-args --remap ~/out:=scan’ instead.
[INFO] [spawn_entity.py-4]: process has finished cleanly [pid 13343]
[gzserver-2] [INFO] [1687137619.659442697] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin
[gzserver-2] [INFO] [1687137619.661760302] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: /
[gzserver-2] [INFO] [1687137619.662014198] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control
[gzserver-2] [INFO] [1687137619.662072363] [gazebo_ros2_control]: Loading parameter files /home/slamlaptop/dev_ws/install/articubot_one/share/articubot_one/config/my_controllers.yaml
[gzserver-2] [INFO] [1687137619.662090467] [gazebo_ros2_control]: Loading parameter files /home/slamlaptop/dev_ws/install/articubot_one/share/articubot_one/config/gaz_ros2_ctl_sim.yaml
[gzserver-2] [INFO] [1687137619.663979352] [gazebo_ros2_control]: connected to service!! robot_state_publisher
[gzserver-2] [INFO] [1687137619.664435773] [gazebo_ros2_control]: Recieved urdf from param server, parsing…
[spawner.py-5] [INFO] [1687137620.507560997] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1687137620.575398741] [spawner_joint_broad]: Waiting for /controller_manager services
[gzserver-2] Segmentation fault (core dumped)
[ERROR] [gzserver-2]: process has died [pid 13338, exit code 139, cmd ‘gzserver ./src/articubot_one/worlds/obstacles4.world -s libgazebo_ros_init.so -s libgazebo_ros_factory.so -s libgazebo_ros_force_system.so --ros-args --params-file /home/slamlaptop/dev_ws/install/articubot_one/share/articubot_one/config/gazebo_params.yaml’].
[spawner.py-5] [INFO] [1687137622.524887419] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1687137622.591533340] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1687137624.541711711] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1687137624.608370062] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1687137626.558688032] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1687137626.626904026] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [ERROR] [1687137628.577136829] [spawner_diff_cont]: Controller manager not available
[ERROR] [spawner.py-5]: process has died [pid 13346, exit code 1, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py diff_cont --ros-args’].
[spawner.py-6] [ERROR] [1687137628.644295897] [spawner_joint_broad]: Controller manager not available
[ERROR] [spawner.py-6]: process has died [pid 13348, exit code 1, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py joint_broad --ros-args’].
[gazebo_params.yaml-3] Terminated
[ERROR] [gazebo_params.yaml-3]: process has died [pid 13340, exit code 143, cmd ‘gzclient --ros-args --params-file /home/slamlaptop/dev_ws/install/articubot_one/share/articubot_one/config/gazebo_params.yaml’].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-1] [INFO] [1687137730.227483736] [rclcpp]: signal_handler(signal_value=2)
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 13336]

i has solved this issues but i have another problem again can you help me with this?

[async_slam_toolbox_node-1] Registering sensor: [Custom Described Lidar]
[ERROR] [async_slam_toolbox_node-1]: process has died [pid 5999, exit code -11, cmd ‘/opt/ros/foxy/lib/slam_toolbox/async_slam_toolbox_node --ros-args -r __node:=slam_toolbox --params-file src/articubot_one/config/mapper_params_online_async.yaml --params-file /tmp/launch_params_szf1pr3x’].

Helo, i’m having this problem when i tried launching the slam_toolbox for real robot mapping. Any idea?

ros2 launch slam_toolbox online_async_launch.py params_file:=./src/articubot_two/config/mapper_params_online_async.yaml use_sim_time:=false
[INFO] [launch]: All log files can be found below /home/alpaca/.ros/log/2023-06-30-18-48-46-523200-Alpaca-6178
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [async_slam_toolbox_node-1]: process started with pid [6180]
[async_slam_toolbox_node-1] [INFO] [1688122126.748939860] [slam_toolbox]: Node using stack size 40000000
[ERROR] [async_slam_toolbox_node-1]: process has died [pid 6180, exit code -11, cmd '/opt/ros/foxy/lib/slam_toolbox/async_slam_toolbox_node --ros-args -r __node:=slam_toolbox --params-file src/articubot_two/config/mapper_params_online_async.yaml --params-file /tmp/launch_params_gn24hbi4'].

have you solve this issue?

no still have an issues

Hi Josh, i have a question. Is there any way that i can use slam toolbox just with a Lidar, cause i haven’t built a robot yet.

Hi Josh,

Would BNO055 improve odom information (Kalman Filter etc.) and SLAM ?
Do you intend to make some video about it some day?

Thank you very much!

P.S: I find you videos very very helpfull!

Hey Josh,

First off, thanks a billion for the whole series.

I followed your tutorial with different hardware. I am using ld19 lidar instead of RPlidar.

Using the ros2 package provided by the manufacturer, I was able to see the lidar in rviz. But, when I run the SLAM toolbox, it generates the map for a very short amount of time( like one iteration) and then doesn’t update the map anymore. Is there any hint of how can I fix this issue? By the way, I keep receiving the following note in the SLAM running window:
“LaserRangeScan contains 501 range readings, expected 500”


I tried amcl, when i launch this

ros2 run nav2_map_server map_server --ros-args -p yaml_filename:=my_map_save.yaml -p use_sim_time:=true

i met this errors

[INFO] [1703349227.336844850] [map_server]: 
	map_server lifecycle node launched. 
	Waiting on external lifecycle transitions to activate
	See https://design.ros2.org/articles/node_lifecycle.html for more information.
[INFO] [1703349227.337761287] [map_server]: Creating
[INFO] [1703349280.555652805] [map_server]: Configuring
[INFO] [map_io]: Loading yaml file: my_map_save.yaml
[DEBUG] [map_io]: resolution: 0.05
[DEBUG] [map_io]: origin[0]: -5.55
[DEBUG] [map_io]: origin[1]: -5.59
[DEBUG] [map_io]: origin[2]: 0
[DEBUG] [map_io]: free_thresh: 0.25
[DEBUG] [map_io]: occupied_thresh: 0.65
[DEBUG] [map_io]: mode: trinary
[DEBUG] [map_io]: negate: 0
[INFO] [map_io]: Loading image_file: ./my_map_save.pgm
[DEBUG] [map_io]: Read map ./my_map_save.pgm: 177 X 161 map @ 0.05 m/cell
[INFO] [1703349280.727523176] [map_server]: Activating
[INFO] [1703349280.729431632] [map_server]: Creating bond (map_server) to lifecycle manager.
[WARN] [1703349374.430281199] [rcl_lifecycle]: No transition matching 1 found for current state active

>>> [rcutils|error_handling.c:108] rcutils_set_error_state()
This error state is being overwritten:

  'timer is canceled, at ./src/rcl/timer.c:249'

with this new error message:

  'Transition is not registered., at ./src/rcl_lifecycle.c:355'

rcutils_reset_error() should be called after error handling to avoid this.
[ERROR] [1703349374.430412437] [map_server]: Unable to start transition 1 from current state active: Transition is not registered., at ./src/rcl_lifecycle.c:355
[WARN] [1703349374.502518775] [rcl_lifecycle]: No transition matching 3 found for current state active
[ERROR] [1703349374.503043275] [map_server]: Unable to start transition 3 from current state active: Transition is not registered., at ./src/rcl_lifecycle.c:355

How to solve this problems?

Hi Josh,

I wish you Merry Christmas and Happy New Year! Your tutorials are “top of the top”. I am fighting now with SLAM Tutorial. I use your Model from github. I am using Simulation Mode. When I leave it for 1 hour I see a significant drift between the already done map and the current laser scan. If I continue with movement I receive a new map on the old one. I would attach a screen shot but I do not know how.

thank you very much in advance!


Hey @JoshNewans,
firstly, thank you so much for the amazing tutorials! Secondly, my laser_frame is moving with the bot. As a result, the generated map turns out to be a mess. Any clues as to why that must be happening?

I’m using micro-ROS with ESP32 on a 4WD robot with encoded motors and no IMU. And the LiDar is RPlidar A1.
(Since I am using micro-ROS, I had to manually write the Odometry publisher along with many static and dynamic transforms. But I’m not sure what’s causing the issue)

Thank you

Did you solve this problem? As i move the robot the map frma starts to drift too much from odom, and the map becomes a mess

i have same problem , did you solve this isure or not ?

Hello Josh. Please I get the error

could not transform from [] to [map] on rviz. it changes with the global fixe frame. For instance if I change the global fixed frame to base_link the error in the map topic changes to

could not transform from [] to [base_link]

even though my tf tree is correct BASE → base_footprint → base_link → odom → map