Documented target: Ubuntu 24.04 · ROS 2 Jazzy · Gazebo Harmonic where used. Browser labs tested; ROS/Ubuntu/hardware execution not performed here.
What you will understand
- Explain mapping inputs.
- Launch mapping in a known simulation.
- Save and inspect metadata.
Prerequisites: Estimate motion and locate the robot and its stated environment.
The idea, made clear.
SLAM estimates motion while building a map. Occupancy grids encode beliefs about cells; unknown is different from free. A room drawing without sensor or coordinate evidence is not equivalent to a mapping result.
Loop closure can reduce drift by recognizing a previously visited area. Repetitive corridors, moving people and weak geometry can create wrong associations. Move slowly through overlapping views and isolate problems before adjusting many parameters.
Keep the saved map image and YAML together. Resolution converts pixels to metres; origin places the grid in a frame. Inspect both artefacts before navigation. Attractive walls without correct scale or frame alignment can mislead a planner.
Try it, step by step.
Prepare packages
Requires a robot already publishing scans and odometry transforms.
sudo apt install ros-jazzy-slam-toolbox ros-jazzy-nav2-map-serverExpected: Matching mapping packages.
Start mapping
Adapt scan and frame names using SLAM Toolbox documentation.
ros2 launch slam_toolbox online_async_launch.py use_sim_time:=trueExpected: A map when required sensor/transform inputs are valid.
Save a map
Explore first, then save.
mkdir -p ~/nexviora_maps
ros2 run nav2_map_server map_saver_cli -f ~/nexviora_maps/training_roomExpected: Image and YAML metadata with resolution and origin.
If something goes wrong
- Blank map
- Check scan, transforms and simulation clock.
- Duplicated walls
- Review timing, odometry and loop closures.
Check your understanding
Make it yours
Compare maps from slow and fast simulated passes.
Optional progress stays in this browser. No account needed.
Go to the source documentation
Commands are educational examples for the stated environment, not a transcript of local ROS execution. Verify actual behavior on your machine.