Skip to content

SLAM & navigation

"Go to the kitchen" hides three hard problems: what does the world look like (mapping), where am I in it (localization), and how do I get there (navigation).

SLAM — mapping and localization at once

Simultaneous Localization And Mapping: the robot builds the map while figuring out where it is on that very map — a chicken-and-egg problem solved incrementally. Lidar scans are matched against each other; odometry provides the in-between guesses; loop closures (recognizing a place you've seen) snap the accumulated error away.

Drive the robot around a space and watch the map grow in RViz (the RViz button in the app's VNC) — walls appear as the lidar sweeps them.

With a map, Nav2 (the standard ROS 2 navigation stack) turns a goal into motion:

  • Global planner — a route through the map around known obstacles.
  • Local planner — steers along that route while dodging what the sensors see right now (someone's foot).
  • Costmaps — the map plus live sensor data, expressed as "how bad is it to be here", which both planners consult.
  • TF — the coordinate-frame bookkeeping (map → odom → robot → sensors) that keeps everyone talking about the same "here".

Try it

The navigation practice walks through mapping a world and sending goals. Watch the planned path bend around obstacles in RViz — that is the whole stack cooperating: sensors → SLAM → costmaps → planners → wheels.

AI