Error running SLAM tutorial

I have a ROSBOT 2R. I am trying to run the ROS2 tutorial 8: SLAM.

My compose.yaml file

'"

Launching:

docker compose up

services:

rosbot:
image: husarion/rosbot:humble
command: ros2 launch rosbot_bringup bringup.launch.py mecanum:=${MECANUM:-False}

micro-ros:
image: husarion/micro-ros-agent:humble
devices:
- ${SERIAL_PORT:?err}
command: ros2 run micro_ros_agent micro_ros_agent serial -D $SERIAL_PORT serial -b 576000

astra:
image: husarion/astra:humble
devices:
- /dev/bus/usb/
command: ros2 launch astra_camera astra_mini.launch.py

rplidar:
image: husarion/rplidar:humble
devices:
- /dev/ttyUSB0
command: >
ros2 launch sllidar_ros2 sllidar_launch.py
serial_baudrate:=${RPLIDAR_BAUDRATE:-256000}

ā€œā€"

When I run

ros2 launch tutorial_pkg slam.launch.py

I get error:
[INFO] [launch]: All log files can be found below /home/husarion/.ros/log/2024-03-20-12-31-55-764317-husarion-429056
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [async_slam_toolbox_node-1]: process started with pid [429131]
[INFO] [rviz2-2]: process started with pid [429133]
[async_slam_toolbox_node-1] [INFO] [1710937917.035309853] [slam]: Node using stack size 40000000
[async_slam_toolbox_node-1] [INFO] [1710937917.524651537] [slam]: Using solver plugin solver_plugins::CeresSolver
[async_slam_toolbox_node-1] [INFO] [1710937917.530064441] [slam]: CeresSolver: Using SCHUR_JACOBI preconditioner.
[rviz2-2] [INFO] [1710937924.216669715] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-2] [INFO] [1710937924.221268294] [rviz2]: OpenGl version: 4.5 (GLSL 4.5)
[rviz2-2] [INFO] [1710937928.827694522] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-2] [ERROR] [1710937929.580821664] [rviz2]: Error retrieving file [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/body.stl]: Couldnā€™t open file /ros2_ws/install/rosbot_description/share/rosbot_description/meshes/body.stl
[rviz2-2] [ERROR] [1710937929.582086354] [rviz2]: Error retrieving file [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/body.stl]: Couldnā€™t open file /ros2_ws/install/rosbot_description/share/rosbot_description/meshes/body.stl
[rviz2-2] [ERROR] [1710937929.586653674] [rviz2]: Could not load resource [file:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/orbbec_astra.dae]: Unable to open file ā€œfile:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/orbbec_astra.daeā€.
[rviz2-2] [ERROR] [1710937929.587926272] [rviz2]: Could not load resource [file:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/orbbec_astra.dae]: Unable to open file ā€œfile:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/orbbec_astra.daeā€.
[rviz2-2] [ERROR] [1710937929.590669575] [rviz2]: Error retrieving file [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/cover.stl]: Couldnā€™t open file /ros2_ws/install/rosbot_description/share/rosbot_description/meshes/cover.stl
[rviz2-2] [ERROR] [1710937929.591444289] [rviz2]: Error retrieving file [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/cover.stl]: Couldnā€™t open file /ros2_ws/install/rosbot_description/share/rosbot_description/meshes/cover.stl
[rviz2-2] [ERROR] [1710937929.593892892] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.daeā€.
[rviz2-2] [ERROR] [1710937929.595137063] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.daeā€.
[rviz2-2] [ERROR] [1710937929.597419520] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.daeā€.
[rviz2-2] [ERROR] [1710937929.598439564] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.daeā€.
[rviz2-2] [ERROR] [1710937929.601868712] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.daeā€.
[rviz2-2] [ERROR] [1710937929.603141235] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.daeā€.
[rviz2-2] [ERROR] [1710937929.606117462] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.daeā€.
[rviz2-2] [ERROR] [1710937929.608250217] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.daeā€.
[rviz2-2] [ERROR] [1710937929.609496351] [rviz2]: Could not load resource [file:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/slamtec_rplidar_ax.dae]: Unable to open file ā€œfile:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/slamtec_rplidar_ax.daeā€.
[rviz2-2] [ERROR] [1710937929.610974317] [rviz2]: Could not load resource [file:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/slamtec_rplidar_ax.dae]: Unable to open file ā€œfile:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/slamtec_rplidar_ax.daeā€.

Please let me know if you need any other info.

Thanks

Hello @Yadun_Murali,

The problem is caused by the lack of rosbot_description package installed locally. Due to this, rviz is unable to read files from the rosbot_description package. You can build and source rosbot_ros repository.

This should not affect the quality of slam performance. The map should still be created and only the robot model should not load. If you do not see map check this issue: [Solved] ROS 2 Tutorial -> 8. SLAM - No /scan_filtered on ROSbot

Regards,

I have installed the repository in ros2_ws. Still I get the same error:

ros2 launch tutorial_pkg slam.launch.py
[INFO] [launch]: All log files can be found below /home/husarion/.ros/log/2024-03-22-09-57-14-917281-husarion-41900
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [async_slam_toolbox_node-1]: process started with pid [41941]
[INFO] [rviz2-2]: process started with pid [41943]
[async_slam_toolbox_node-1] [INFO] [1711101435.494789743] [slam]: Node using stack size 40000000
[async_slam_toolbox_node-1] [INFO] [1711101435.822728843] [slam]: Using solver plugin solver_plugins::CeresSolver
[async_slam_toolbox_node-1] [INFO] [1711101435.831042806] [slam]: CeresSolver: Using SCHUR_JACOBI preconditioner.
[rviz2-2] [INFO] [1711101449.630327594] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-2] [INFO] [1711101449.630881106] [rviz2]: OpenGl version: 4.5 (GLSL 4.5)
[rviz2-2] [INFO] [1711101452.194591945] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-2] [ERROR] [1711101452.834577712] [rviz2]: Error retrieving file [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/body.stl]: Couldnā€™t open file /ros2_ws/install/rosbot_description/share/rosbot_description/meshes/body.stl
[rviz2-2] [ERROR] [1711101452.835458109] [rviz2]: Error retrieving file [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/body.stl]: Couldnā€™t open file /ros2_ws/install/rosbot_description/share/rosbot_description/meshes/body.stl
[rviz2-2] [ERROR] [1711101452.841675762] [rviz2]: Could not load resource [file:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/orbbec_astra.dae]: Unable to open file ā€œfile:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/orbbec_astra.daeā€.
[rviz2-2] [ERROR] [1711101452.890508199] [rviz2]: Could not load resource [file:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/orbbec_astra.dae]: Unable to open file ā€œfile:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/orbbec_astra.daeā€.
[rviz2-2] [ERROR] [1711101452.892359678] [rviz2]: Error retrieving file [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/cover.stl]: Couldnā€™t open file /ros2_ws/install/rosbot_description/share/rosbot_description/meshes/cover.stl
[rviz2-2] [ERROR] [1711101452.893066041] [rviz2]: Error retrieving file [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/cover.stl]: Couldnā€™t open file /ros2_ws/install/rosbot_description/share/rosbot_description/meshes/cover.stl
[rviz2-2] [ERROR] [1711101452.894304490] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.daeā€.
[rviz2-2] [ERROR] [1711101452.895151369] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.daeā€.
[rviz2-2] [ERROR] [1711101452.896812832] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.daeā€.
[rviz2-2] [ERROR] [1711101452.897654082] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.daeā€.
[rviz2-2] [ERROR] [1711101452.899454525] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.daeā€.
[rviz2-2] [ERROR] [1711101452.900386700] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.daeā€.
[rviz2-2] [ERROR] [1711101452.901992071] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.daeā€.
[rviz2-2] [ERROR] [1711101452.902836654] [rviz2]: Could not load resource [file:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.dae]: Unable to open file ā€œfile:///ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_b.daeā€.
[rviz2-2] [ERROR] [1711101452.904281860] [rviz2]: Could not load resource [file:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/slamtec_rplidar_ax.dae]: Unable to open file ā€œfile:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/slamtec_rplidar_ax.daeā€.
[rviz2-2] [ERROR] [1711101452.905375014] [rviz2]: Could not load resource [file:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/slamtec_rplidar_ax.dae]: Unable to open file ā€œfile:///ros2_ws/install/ros_components_description/share/ros_components_description/meshes/slamtec_rplidar_ax.daeā€.
[ERROR] [rviz2-2]: process has died [pid 41943, exit code -11, cmd ā€˜/opt/ros/humble/lib/rviz2/rviz2 -d /home/husarion/ros2_ws/install/tutorial_pkg/share/tutorial_pkg/rviz/slam.rviz --ros-args -r __node:=rviz2ā€™].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[async_slam_toolbox_node-1] [INFO] [1711101532.848170781] [rclcpp]: signal_handler(signum=2)
[INFO] [async_slam_toolbox_node-1]: process has finished cleanly [pid 41941]

Hello @Yadun_Murali,
Do you source workspace with rosbot_ros repo before launching slam.launch.py?

yes. I sourced the workspace

1 Like

Hi. Any ideas how I can proceed?

Hello,

I think I understand what the problem is. Formerly in the rosbot_ros package, it contained the absolute path to the mesh file. What was fixed some time ago.

There are two options to fix this:

  1. Faster: It is necessary to build the package in the ros2_ws folder or faster copy all meshes from rosbot_ros to: ~/ros2_ws/install/rosbot_description/share/rosbot_description/meshes/wheel_a.dae directory.
  2. Nicer: You can also create a new compose with updated images (e.g. compose.new.yaml) with the following content.
x-common-config:
  &common-config
  network_mode: host
  ipc: host
  restart: unless-stopped

services:

  rosbot:
    image: husarion/rosbot:humble-0.13.1-20240201
    <<: *common-config
    devices:
      - ${SERIAL_PORT:?err}
    command: >
      ros2 launch rosbot_bringup combined.launch.py
        mecanum:=${MECANUM:-False}
        serial_port:=$SERIAL_PORT
        serial_baudrate:=576000

  astra:
    image: husarion/astra:humble
    <<: *common-config
    devices:
      - /dev/bus/usb/
    command: ros2 launch astra_camera astra_mini.launch.py

  rplidar:
    image: husarion/rplidar:humble
    <<: *common-config
    devices:
      - /dev/ttyRPLIDAR:/dev/ttyUSB0
    command: >
        ros2 launch sllidar_ros2 sllidar_launch.py
        serial_baudrate:=${RPLIDAR_BAUDRATE:-256000}

It is run with docker compose -f compose.new.yaml up command. Remember to disable previously running robot and sensor containers if docker compose down is enabled.

Let me know if you managed to solve the problem

I would have to download the specific docker image, right?
Should I install firmware from the downloaded image? or can I just run it like this?

Yes you need to upgrade version (if you prefer second option). If I remember this issue should be fixed from version humble-0.8.0 or greater.
I the firmware between these two versions should be identical, but to be sure you can use the script below to flash the firmware.

docker stop rosbot microros
docker run --rm -it --privileged husarion/rosbot:humble-0.13.1-20240201 flash-firmware.py -f /root/firmware.bin

That error is gone now. Now I went through the other link you shared where scan_filtered topic is not available.
I add the remapping command to compose yaml file in rplidar service. When I do that the rplidar wonā€™t start.

Also when I run the SLAM Tutorial packages.
I get errors in MAP (No map received)

RobotModel Status:Error
baselink no transform from base
.
.
.
slamtec_rpl no transform from ā€¦

Can you send me some logs. Iā€™m not sure what you mean.

The problem was because /scan_filtered topic was not available.
I mapped the /scan topic to /scan_filtered and SLAM map generation works.

Now I am running Navigation tutorial, ros2 launch tutorial_pkg navigation.launch.py

after running this command the rviz comes with map. but the robot model wonā€™t load. When I change the Global Options ā†’ Fixed Frame from Map to Base_link, the robot model loads, but the map goes. Please help me out.

Thank you

Hello @Yadun_Murali,
It seems that for some reason a relationship was not created between tf map and tf odom or base_link. Please run rqt_tf_tree (ros2 run rqt_tf_tree rqt_tf_tree --force-discover) or view_frames (ros2 run tf2_tools view_frames) with the system running) and send me the output tree.

Hello

The odom topic, which is created by ekf, and several topics related to wheel steering are missing here. The correct tf tree should look like this:

1. Please describe:

  1. How do you start the robot.
  2. Are there any warnings/errors after startup?
  3. Is the firmware version correct?
  4. Did you wait several second after running ROSbot,

2. Personally, I suggest to follow this steps:

  1. Update/Create new compose.yaml as above: Error running SLAM tutorial - #7 by RafalGorecki

  2. Flash firmware:

    docker run --rm -it --privileged husarion/rosbot:humble-0.13.1-20240201 \
            ros2 run rosbot_utils flash_firmware
    

3.Run robot

docker compose up rosbot rplidar
  1. Run slam.launch.py
ros2 launch tutorial_pkg slam.launch.py

slam

Note

  1. If you want to have robot model available you need to have rosbot_description package build and source before running slam.launch.py. In above video I source rosbot_2r_ws where i store rosbot_ros repo.
  2. I changed scan_topic: /scan_filtered ā†’ scan_topic: /scan in slam.yaml, befor running slam.launch.py

Demo - Autonomy

If you want to use navigation, you can also use this demo: Autonomous navigation & mapping for ROSbot 2R / 2 PRO

Regards

The SLAM works fine. I followed all the steps as described by you.

The only problem is with Navigation. Is there any way I could do Navigation by following tutorial?

What exactly is happening in navigation and where is the problem occurring?

For ROSbot 2R you also need to replace topic /scan_filter ā†’ /scan in navigation.yaml. If you havenā€™t done this, it should help.

I already changed the topic.

So when I run ros2 launch tutorial_pkg navigation.launch.py.
The rviz comes up.
But the RobotModel doesnā€™t load.
and in Global Status: Error
Fixed Frame: Frame [map] does not exist. but map loads fine

and in Local Planner; Map ; status; Warn
message No map received

But when I changed Global Options; Fixed Frame to base link,
the robot model is loaded but map is gone.

husarion-rosbot-1 | [ros2_control_node-2] [WARN] [1714117625.403533221] [RosbotImuSensor]: Feedback message from imu wasnā€™t received yet
husarion-rosbot-1 | [spawner-6] [INFO] [1714117629.084444904] [spawner_imu_broadcaster]: Waiting for ā€˜/controller_managerā€™ services to be available

Also in the docker startup, I get this output sometimes.
and I canā€™t control the robot anymore

Edit: Now the warning is gone. docker startups okay. but still canā€™t control