Loading the lesson...
In the print dialog, choose "Save as PDF" as the destination.
ROS2 Practical - Lab 06
Simultaneous Localization and Mapping with SLAM Toolbox.
RVizsudo apt install ros-jazzy-slam-toolbox
export TURTLEBOT3_MODEL=waffle_pi
ros2 launch turtlebot3_lab06 lab06.launch.pySLAM Toolbox and launch the labros2 run turtlebot3_teleop teleop_keyboardRequired Step
unconfigured
inactive
active [3]
ros2 lifecycle get /slam_toolbox
ros2 lifecycle set /slam_toolbox configure
ros2 lifecycle set /slam_toolbox activateros2 lifecycle get /slam_toolbox # should show: active [3]
ros2 topic echo /map --once| Color | Meaning |
|---|---|
| Gray | Unknown |
| White | Free space |
| Black | Obstacle |
map to odom to base_link0.1s; laser data becomes an occupancy grid.map
global frame, corrected by loop closure
odom
drifts over time
base_link
robot's own local frame
| Sync | Async | |
|---|---|---|
| Determinism | Deterministic, repeatable | Non-deterministic |
| Debugging | Simple, sequential | Harder, multi-threaded |
| Performance | Single-core, higher latency | Multi-core, lower latency |
| Best for | Learning, limited resources | Production, high-frequency sensors |
configure + activate| Parameter | Value |
|---|---|
| Resolution | 0.05m per pixel (5cm grid) |
| Update rate | 50Hz transforms, 2Hz map updates |
| Scan range | up to 12m (TurtleBot3 Waffle Pi LDS) |
| Loop closure | enabled for map consistency |
SLAM Toolbox was not activated. Run configure then activate, and confirm the state reads active [3].SLAM needs motion. Check that /scan is publishing and the laser is visible in Gazebo.TURTLEBOT3_MODEL is set and /cmd_vel exists.odom. Use view_frames to debug the TF tree.ros2 lifecycle set /slam_toolbox configure
ros2 lifecycle set /slam_toolbox activate
ros2 run tf2_tools view_framesSLAM Toolbox nodes are lifecycle nodes: unconfigured to inactive to active, manual activation required every launchSLAM builds a map and tracks the robot's position in it simultaneously, fusing LiDAR, IMU, and odometrymap, odom, and base_link form the core TF chain that every SLAM/navigation feature depends onMahmoud Abas|TurtleBot3 Lab 06 - SLAM (Simultaneous Localization and Mapping)