Robotics From Zero
All Issues
Issue #4

From Lost to Found: Mapping and Navigation

How robots build maps and find their way — SLAM, path planning, and the algorithms behind autonomous navigation.

3 min read

The chicken-and-egg problem

Imagine you are dropped into a building you have never visited. To navigate, you need a map. But to build a map, you need to know where you are. And to know where you are, you need... a map.

This circular dependency is one of the most famous problems in robotics, and it has a name: SLAM — Simultaneous Localization and Mapping. The robot must solve both problems at once, refining its position estimate and its map in tandem as it explores.

If that sounds tricky, it is. But decades of research have produced algorithms that handle it remarkably well. Our blog post What Is SLAM in Robotics? breaks down the core ideas, from scan matching to graph-based optimization, in a way that does not require a PhD to follow.

Building the map

At its core, a SLAM system takes sensor observations (usually from LiDAR or a depth camera) and stitches them together into a coherent representation of the environment. The most common representation for 2D robots is the occupancy grid — a grid of cells where each cell stores a probability of being occupied, free, or unknown.

The Map the Unknown module walks you through this process step by step, starting with Why Mapping Matters and building up to the full SLAM pipeline in SLAM Explained. If you have not worked through it yet, it pairs perfectly with this newsletter.

Finding a path

Once the robot has a map, the next question is: "How do I get from here to there?" This is the domain of path planning, and two families of algorithms dominate the field.

Grid-based planners like A* treat the map as a graph and search for the shortest path from start to goal. A* is deterministic, complete (it will always find a path if one exists), and optimal. The downside is that it scales poorly in high-dimensional spaces — fine for a wheeled robot on a 2D floor, less practical for a robot arm with six joints.

Sampling-based planners like RRT (Rapidly-exploring Random Trees) take a different approach. Instead of searching exhaustively, they randomly sample points in the configuration space and grow a tree of feasible motions toward the goal. RRT is fast in high dimensions and can handle complex constraints, but the paths it produces are rarely optimal without post-processing.

Our Plan a Path module covers both families in detail. The Grid-Based Planning lesson lets you step through A* visually, and Sampling-Based Planning does the same for RRT.

Loop closure: the secret ingredient

One concept that often gets overlooked is loop closure. When a robot returns to a place it has already visited, the SLAM system can recognize the overlap and correct the accumulated drift in its position estimate. Without loop closure, maps slowly degrade as small errors compound over time. Our lesson on Loop Closure explains how this works and why it is critical for long-duration autonomy.

What's ahead

Next time we will shift gears and look at reactive behaviors — how robots respond to unexpected obstacles in real time using techniques like behavior trees and potential fields. We will also be publishing a new blog post on local versus global planning strategies, so stay tuned.

Until then, try loading one of our pre-built maps in the 2D Playground and experimenting with different planners. There is no better way to build intuition for how A* and RRT behave than watching them run.

See you next issue!

-- The Robotics From Zero Team

Enjoyed this issue?

Subscribe to get future newsletters delivered to your inbox.

Subscribe