Solutions of /scan topic -Nav2 on ROS2

By ihsumlee , 28 February 2026
content

Got it — and your screenshots actually show the important detail:

  • You launched SLAM with the arguments:=... form (good).

  • But in your “echo /scan –once” terminal, /scan still has no messages.

  • Meanwhile earlier you proved /robot_0/base_scan does publish.

So the remap is still not taking effect for SLAM Toolbox (or your echo terminal is not in the same ROS domain / not using sim time, but remap is the main suspect).

Let’s fix this in the most bulletproof way: don’t rely on launch remap at all. Instead, set SLAM Toolbox’s scan_topicparameter directly using a params file.


âś… Solution (most reliable): Use a SLAM params file with

scan_topic: /robot_0/base_scan

 

Step 1) Create a custom params file

mkdir -p ~/nav_class_ws/config
cp /opt/ros/jazzy/share/slam_toolbox/config/mapper_params_online_async.yaml \
   ~/nav_class_ws/config/mapper_params_stage.yaml

 

Step 2) Edit it

nano ~/nav_class_ws/config/mapper_params_stage.yaml

Find these keys (add them if missing) and set exactly:

slam_toolbox:
  ros__parameters:
    use_sim_time: true
    scan_topic: /robot_0/base_scan

Some versions already have scan_topic: scan or similar — replace it.

Save and exit.


Step 3) Relaunch SLAM Toolbox using your params file

Stop your current SLAM launch (Ctrl+C), then:

source /opt/ros/jazzy/setup.bash
source ~/nav_class_ws/install/setup.bash

ros2 launch slam_toolbox online_async_launch.py \
  slam_params_file:=/home/lee/nav_class_ws/config/mapper_params_stage.yaml

(That path must match your username; yours is lee, so this is correct.)


Step 4) Verify SLAM is now consuming the correct scan

Now test:

ros2 topic echo /robot_0/base_scan --once

Then check map:

ros2 topic echo /map --once

You should finally get a /map message.

 


If /map --once still hangs: check TF frames (second most common blocker)

Your LaserScan message shows:

frame_id: laser

SLAM Toolbox needs a TF transform from robot base frame to laser and odom chain.

Run:

ros2 run tf2_ros tf2_echo base_link laser

If that hangs, your base frame might not be base_link. Common alternatives:

  • robot_0/base_link

  • base_footprint

  • robot_0/base_footprint

So try:

ros2 run tf2_ros tf2_echo base_footprint laser

To avoid guessing, generate TF graph:

ros2 run tf2_tools view_frames

Open frames.pdf and tell me the exact names you see for:

 

  • base frame (base_link/base_footprint)

  • laser frame (laser)

  • odom frame (odom)

 

 


Why /scan exists but has no messages (in your case)

Even if you remap, /scan will only have messages if some node is actually publishing to it.

Your Stage publishes to /robot_0/base_scan.

The remap is meant to make SLAM subscribe to that; it does not automatically create a new /scan publisher.

 

So: don’t use /scan as a “success check” here.

Better success checks

Use these instead:

ros2 node list | grep slam
ros2 param get /slam_toolbox scan_topic
ros2 topic echo /map --once

 


Quick request (so I can finish this without guessing)

Please run and paste:

ros2 node list | grep slam
ros2 param list /slam_toolbox | grep scan
ros2 param get /slam_toolbox scan_topic

Then I can tell you immediately whether SLAM is reading /robot_0/base_scan or still stuck on /scan.

Tags