LESSON 14 · NAVIGATION

Make a map and check its limits

Save a useful map with its scale and coordinate metadata.

Environment and verification

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.

Scan + odometryAssociationMap updateSaved artefacts
An original overview of the information or commissioning sequence.

Try it, step by step.

1

Prepare packages

Requires a robot already publishing scans and odometry transforms.

slam-and-mapping-1.txt
sudo apt install ros-jazzy-slam-toolbox ros-jazzy-nav2-map-server

Expected: Matching mapping packages.

2

Start mapping

Adapt scan and frame names using SLAM Toolbox documentation.

slam-and-mapping-2.txt
ros2 launch slam_toolbox online_async_launch.py use_sim_time:=true

Expected: A map when required sensor/transform inputs are valid.

3

Save a map

Explore first, then save.

slam-and-mapping-3.txt
mkdir -p ~/nexviora_maps
ros2 run nav2_map_server map_saver_cli -f ~/nexviora_maps/training_room

Expected: Image and YAML metadata with resolution and origin.

Explore the interactive lab →

If something goes wrong

Blank map
Check scan, transforms and simulation clock.
Duplicated walls
Review timing, odometry and loop closures.

Check your understanding

Unknown cells mean what?

Make it yours

Compare maps from slow and fast simulated passes.

Your learning progress

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.

Look up a term · Version notes · Report an issue