1
$\begingroup$

I’m attempting to run the slam_toolbox. My setup includes ROS2 Humble, Raspberry Pi 4, and RPLIDAR A1.

Previously, I encountered an issue with a terminal message like:

[async_slam_toolbox_node-1] [INFO] [1716851249.460114140] [slam_toolbox]: Message Filter dropping message: frame 'laser' at time 1716851249.163 for reason 'discarding message because the queue is full'

when launching:

ros2 launch slam_toolbox online_async_launch.py

I found a solution to this error here, where I followed the advice to build a complete TF tree (tf2). In my case, it looks like this:

map -> odom -> base_link -> laser

where the dynamic transformations are: map -> odom and odom -> base_link, and the static one is: base_link -> laser.

However, I cannot initiate the dynamic transformation between map -> odom because my /map topic is empty. My TF tree now: enter image description here

My question is as follows: Should I be sending data to the /map topic in some way, or should the SLAM Toolbox process the odometry and lidar data and publish to /map itself?

For collecting data from the lidar, I am using the project: github.com/Slamtec/sllidar_ros2 I also obtain odometry from the lidar using the project: github.com/MAPIRlab/rf2o_laser_odometry

$\endgroup$

3 Answers 3

2
$\begingroup$

Should I be sending data to the /map topic in some way, or should the SLAM Toolbox process the odometry and lidar data and publish to /map itself?

No, SLAM publishes the map topic. SLAM Toolbox however needs your odometry and lidar data to work and processes it into the map published on /map by default.

Do you see any other errors?

[async_slam_toolbox_node-1] [INFO] [1716851249.460114140] [slam_toolbox]: Message Filter dropping message: frame 'laser' at time 1716851249.163 for reason 'discarding message because the queue is full'

TF issues like this are tricky for me to help with, they can be caused by innumerous causes. Best I can offer here is to google that warning and read old tickets until you have some understanding of the kinds of things that can make this go wrong and start experimenting with your system until you have something working you can build up with. More or less experimenting is what I'd do (though I know what parts to poke). Perhaps start with something you know is working like Nav2's examples and then change one thing at a time towards your solution until you find your problem.

$\endgroup$
2
$\begingroup$

I’ve solved the issue, and the map is now building correctly!

enter image description here

The mistake was that I initially constructed the TF tree incorrectly. In my case, the ‘robot’ was the lidar itself, so I had two static transformations:

from 'base_link' to 'odom':

ros2 run tf2_ros static_transform_publisher --frame-id base_link --child-frame-id odom --x 0.0 --y 0.0 --z 0.0 --roll 0.0 --pitch 0.0 --yaw 0.0

and from 'base_link' to 'laser'

ros2 run tf2_ros static_transform_publisher --frame-id base_link --child-frame-id laser --x 0.0 --y 0.0 --z 0.0 --roll 0.0 --pitch 0.0 --yaw 0.0

For those (like me) who are just starting to work with slam_toolbox: before building your TF tree, think carefully about how the sensors/objects in your robot are interconnected, which have dynamic links, and which are static.

rqt_graph: enter image description here

For collecting data from the lidar, I am using the project: github.com/Slamtec/sllidar_ros2

I also obtain odometry from the lidar using the project: github.com/MAPIRlab/rf2o_laser_odometry

Also in the node that transforms data from /scan to /odom, I changed the name of the published topic:

  Node(
                package='rf2o_laser_odometry',
                executable='rf2o_laser_odometry_node',
                name='rf2o_laser_odometry',
                output='screen',
                parameters=[{
                    'laser_scan_topic' : '/scan',
                    'odom_topic' : '/odom', #'/odom_rf2o' ->  '/odom'
                    'publish_tf' : True,
                    'base_frame_id' : 'base_link',
                    'odom_frame_id' : 'odom',
                    'init_pose_from_topic' : '',
                    'freq' : 20.0}],
            ),

And in slam_toolbox/config/mapper_params_online_async.yaml

 # ROS Parameters
    odom_frame: odom
    map_frame: map
    base_frame: base_link #base_footprint -> base_link
    scan_topic: /scan
    use_map_saver: true
    mode: mapping #localization

Thanks, Steve ❤️

$\endgroup$
0
$\begingroup$

I have the same error : with Slam and only using RPLIDAR A3.

Problem

I have followed the steps below to configure and launch SLAM Toolbox, but the /map topic is not receiving data, and the map is not being generated.

Commands Executed

Start the LiDAR

ros2 launch rplidar_ros rplidar_a3_launch.py

Start laser odometry

ros2 launch rf2o_laser_odometry rf2o_laser_odometry.launch.py

Publish static transformations

ros2 run tf2_ros static_transform_publisher --x 0.0 --y 0.0 --z 0.0 --roll 0.0 --pitch 0.0 --yaw 0.0 --frame-id base_link --child-frame-id laser

ros2 run tf2_ros static_transform_publisher --frame-id odom --child-frame-id base_link --x 0.0 --y 0.0 --z 0.0 --roll 0.0 --pitch 0.0 --yaw 0.0

Launch SLAM Toolbox with custom parameters

ros2 launch slam_toolbox online_async_launch.py params_file:=/home/pc/lidar_slam/src/slam.yaml


### SLAM Toolbox YAML Configuration
I am using the following parameters in the YAML file:

odom_frame: odom
map_frame: map
base_frame: base_link
scan_topic: /scan
use_map_saver: true
mode: mapping

Problem Observed

Even after launching all the nodes and setting up the configurations, the /map topic remains empty, and no map is being generated.

Here is a screenshot showing the current state: enter image description here


Questions

  1. Are there any issues with my TF configuration or the SLAM Toolbox YAML parameters?
  2. Could this problem be related to the publishing rates of /scan or /odom topics?
  3. What steps can I take to debug and resolve the lack of data in the /map topic?
$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.