Using SLAM Toolbox ...
 
Notifications
Clear all

Using SLAM Toolbox + Nav2 with RPLIDAR A1

1 Posts
1 Users
0 Reactions
89 Views
Posts: 5
Moderator
Topic starter
(@tanyap)
Member
Joined: 5 months ago

The following must be running correctly:

  • RPLIDAR publishes /scan (LaserScan)
  • TF tree is complete: map --> odom -->  base_link --> laser
  • SLAM toolbox publishes /map and map --> odom
  • Nav2 runs without AMCL + without map_server while you are mapping
    • Nav2 expects SLAM to provide those

Bringup: 

1) Install packages (Jazzy)

sudo apt update
sudo apt install -y \
  ros-jazzy-navigation2 ros-jazzy-nav2-bringup \
  ros-jazzy-slam-toolbox \
  ros-jazzy-tf2-ros

2) Run RPLIDAR A1 driver (rplidar_ros)

ros2 launch rplidar_ros view_rplidar_a1_launch.py

Confirm the scan topic (in another terminal)

ros2 topic list | grep scan
ros2 topic echo /scan --once

header.frame_id has to be laser or laser_frame. This frame must match the TF.

3) Provide the TF from base_link --> laser

If not already published with URDF + robot_state_publisher, publish a static transform:

Ex; laser is 0.20m forward, 0.10m up from base_link , no rotation 

ros2 run tf2_ros static_transform_publisher \

  0.20 0.0 0.10 0 0 0 base_link laser

Check:

ros2 run tf2_ros tf2_echo base_link laser

4) Check odometry (odom --> base_link)

Odom comes from wheel encoders.

ros2 topic echo /odom --once

ros2 run tf2_ros tf2_echo odom base_link

5) Start SLAM toolbox (online async)

6) Start Nav2 (navigation only, no AMCL/map_server)

7) Start RViz

8) Save map


Share:
Scroll to Top