Robotics From Zero
Module: Map The Unknown

Why Mapping Matters

Understand why robots need maps, explore different types of maps, and learn the difference between mapping and navigation with pre-existing maps.

6 min read

Why Your Robot Needs a Map

A self-driving test vehicle with multiple cameras and LiDAR sensors mounted on the roof — the sensor array used for building 3D maps
A self-driving test vehicle bristling with cameras and LiDAR sensors. These sensors continuously scan the environment to build and update 3D maps — exactly the mapping challenge we'll explore in this module.

Imagine trying to navigate a building blindfolded while someone gives you directions: "Walk forward 10 steps, turn left, walk 5 more steps." If you miscount even slightly, you'll end up in the wrong place. Now imagine you had a map and could see landmarks — suddenly navigation becomes much easier and more reliable.

Robots face the same challenge. They can count wheel rotations and measure turns, but small errors accumulate quickly. A map transforms this problem from "how many steps did I take?" to "where am I relative to these landmarks?"

Maps enable planning — showing how a robot with a map can plan an efficient path versus blindly stumbling around
Without a map, a robot must grope forward blindly, hoping it doesn't hit anything. With a map, it can plan an efficient route, anticipate obstacles, and correct accumulated drift using landmarks.

The Three Mapping Scenarios

Three mapping scenarios — pre-made map, real-time SLAM, and dynamic map updates
Robots encounter three distinct mapping situations: using a pre-made map (like a warehouse floor plan), building a map from scratch with SLAM, or updating an existing map as the environment changes.

Robots encounter three distinct mapping situations:

1. Pre-Made Maps (Given Map)

Someone creates the map ahead of time — maybe a human draws it, or the robot builds it during a setup phase. The robot's job is just to figure out where it is on this known map. Think of a warehouse robot that gets the floor plan before its first shift.

2. Real-Time Mapping (SLAM)

The robot builds the map as it explores, while simultaneously using that incomplete map to navigate. This is called SLAM (Simultaneous Localization And Mapping), and it's one of the hardest problems in robotics. We'll dive deep into SLAM in lesson 4.

3. Map Updates (Dynamic Environments)

Even if you have a map, the world changes. Doors open and close, people move furniture, construction adds new walls. Smart robots update their maps as they discover changes.

Note

Most real-world robots use a hybrid approach: they start with a rough map (building blueprints) but refine and update it through experience.

Types of Robot Maps

Not all maps look like the paper ones you'd find in a glove compartment. Robots use different map representations depending on their needs:

Occupancy Grids

The most common type. The world is divided into a grid of cells, and each cell is marked as free space, occupied (obstacle), or unknown. Think of it like a pixelated black-and-white image where black = obstacle, white = free, and gray = uncertain.

Feature Maps

Instead of storing every detail, these maps only remember distinctive landmarks — corners, doorways, specific objects. Much more compact, but requires good feature detection.

Topological Maps

These store connectivity rather than geometry — like a subway map that shows which stations connect but not the exact distances. Useful for high-level planning in large spaces.

Metric Maps

These store precise measurements — distances in meters, angles in radians. Occupancy grids are usually metric maps because each cell represents a real-world distance.

Map types comparison — occupancy grid, feature map, topological map, and metric map side by side
Four common map representations. Occupancy grids divide space into cells (like pixels). Feature maps store only landmarks. Topological maps capture connectivity (like a subway map). Metric maps store precise measurements.

Why Mapping is Hard

You might think "just use the LiDAR to see everything and remember it." But reality is messy:

  • Sensor noise — every measurement has small errors
  • Moving objects — people, other robots, sliding doors
  • Symmetry — many hallways look identical
  • Scale — a building might have millions of grid cells
  • Changing viewpoints — the same corner looks different from different angles

Good mapping algorithms handle all this uncertainty gracefully, combining multiple measurements over time to build a confident picture of the world.

What's Next?

In the next lesson, we'll dive into occupancy grid mapping — how robots divide space into cells, update cell probabilities based on sensor readings, and handle the uncertainty of noisy sensors.

Got questions? Join the community

Discuss this lesson, get help, and connect with other learners on r/softwarerobotics.

Join r/softwarerobotics

Frequently Asked Questions

What is SLAM in robotics?

SLAM (Simultaneous Localization and Mapping) is the problem of building a map of an unknown environment while simultaneously tracking the robot's position within that map. It's a chicken-and-egg problem solved by probabilistic methods like graph-based SLAM, particle filter SLAM, and visual SLAM.

What is an occupancy grid map?

An occupancy grid is a 2D grid where each cell stores the probability of being occupied by an obstacle. Values range from 0 (free) to 1 (occupied). It is the standard representation for 2D navigation — the robot uses it for path planning and obstacle avoidance.

What is loop closure in SLAM?

Loop closure is detecting when a robot has returned to a previously visited location. When detected, it corrects the accumulated drift in both the map and the robot's estimated trajectory. Without loop closure, SLAM maps distort over long distances as small errors compound.

Related Lessons

Discussion

Sign in to join the discussion.