Skip to the lesson
FixTheRobot Explore Robotics / Localization & SLAM / M1 SLAM Foundations / M1-T3

Localization & SLAM · Theory · M1

M1-T3 — Why SLAM Is Difficult

Five difficulties that explain nearly every design choice in the rest of the track.

  • Lesson 3 of 6
  • Module 1: SLAM Foundations
  • Theory
  • About 7 minutes to read

SLAM looks simple on paper: place measurements using the pose. Five things make it hard in practice, and each one comes back in a later module as the reason a technique exists. Learning to name them is the fastest way to diagnose a failing system.

Learning objectives

After this lesson, you should be able to:

  • Explain why odometry error is unbounded and quantify how a small heading error becomes a large position error.
  • Describe data association and perceptual aliasing and give an example of each.
  • Explain why dynamic objects break a static-world assumption.
  • Say why computation and memory grow with time and map size, and how systems limit this.

The intuition

Walk across a field with your eyes closed, counting steps and aiming straight. Stop after 100 steps and you will be off by a good distance, even though each step was almost perfect. A tiny angular mistake on step one gets multiplied by every later step. This is the heart of the first difficulty.

The five difficulties

1. Coupled errors
The pose error at time t is copied into everything observed at t. Errors in the map and in the trajectory are correlated, so they cannot be corrected independently.
2. Drift
Dead-reckoning (integrating motion) accumulates error without limit. A heading error is the worst because it grows with every metre travelled.
3. Ambiguity
Deciding which map element a measurement belongs to (data association) is hard. Two corridors that look the same cause perceptual aliasing: a false match that, if accepted, corrupts the map.
4. Dynamic world
People, vehicles, opened doors and moved furniture violate the assumption that the world is still.
5. Cost
The state grows with the number of poses and landmarks, and real-time operation needs bounded computation on small computers.
Drift grows with distanceA plot of position error against distance driven. A straight rising line for a systematic heading bias, and a slower curve for random noise. Neither stays flat.025507510000.30.60.91.2distance driven (m)position error (m) systematic biasrandom noise Neither error bound stops growing. Without an outside reference, the onlyfix is to recognise something seen before.
Position error versus distance. A systematic bias (a slightly wrong wheel size) grows linearly. Random noise grows more slowly, roughly with the square root of distance. Neither is bounded.

The mathematics

To see why drift is unbounded, integrate a robot that moves a distance d each step with heading θ. The position after N steps is the sum of the steps. If the heading has a small constant error ε, the position error is the length of the difference between the true and the believed path:

Position error from a heading bias
error≈N⋅d⋅ε\text{error}\approx N\cdot d\cdot \varepsilon
(heading bias ε in radians, small)
N
number of steps.
d
distance per step in metres.
ε
a heading error in radians that does not average out, such as a wheelbase that is mis-measured.
σd
random error per step, which does average partly: its total grows as √N.

If the errors are random instead of systematic, they partially cancel, and the accumulated error grows as

Random walk growth
error≈σd⋅N(random, per−step σd)\text{error}\approx \sigma _{d}\cdot \sqrt{N}(\text{random},\,\text{per}-\text{step}\,\sigma _{d})

Both grow with N, so there is no steady state. Adding more steps never makes dead-reckoning better. Notice that these formulas describe magnitude only. Direction matters: heading errors turn into position errors perpendicular to travel, and they compound over the whole route.

Coupling: why the errors are not independent

Let a landmark be observed at relative position rt from a pose estimated as x̂t = xt + et. The mapped landmark is x̂t + rt = L + et. So the map error equals the pose error. Two landmarks seen from the same pose share the same et: their positions are correlated. This is a cost, because errors cannot be fixed independently. It is also an opportunity: correcting one landmark, such as when a loop closes, corrects every landmark and pose linked to it.

SLAM is hard because errors accumulate, are shared, and cannot be measured directly. It is tractable because they are shared.

A worked example: a 100 m corridor

A robot drives 100 m along a straight corridor in 1 m steps (N = 100, d = 1). Two things are slightly wrong.

  1. A heading bias. The robot’s initial heading estimate is off by ε = 0.01 rad (0.57°). After 100 m the sideways error is N · d · ε = 100 × 1 × 0.01 = 1.0 m. This is the straight orange line in the figure.
  2. Random noise. Each step has σd = 0.02 m of random error. After 100 steps, the expected error is 0.02 × √100 = 0.2 m.
  3. Compare. The 1.0 m systematic error dominates the 0.2 m random one by a factor of five. This is why calibration matters (the next lab): removing the bias is worth more than reducing the noise.
  4. Now add a revisit. A doorway mapped at the start is seen again from the end of the corridor. If place recognition matches it, the 1.0 m contradiction becomes a correction for the whole path. If nothing recognises it, the 1.0 m error simply stays.

Ambiguity in the same corridor

Now suppose the corridor has identical doorways every 10 m, and after a long run the pose has drifted by 5 m. The robot sees a door and the map predicts doors at 10 m and 20 m from the believed position. Both candidates are equally far from the believed pose, so a single match cannot tell them apart. Choosing the wrong one shifts the pose by 10 m. This is perceptual aliasing, and why systems keep several hypotheses or demand consistency over several measurements before accepting a match.

Engineering implications and limitations

How each difficulty shapes the design

Difficulties of SLAM and the design response
DifficultyConsequenceAnswer used in practice
DriftPose diverges from the world over timeLoop closure and graph optimization (Module 4); external references such as GPS
Coupled errorsCannot fix one landmark aloneJoint estimation of all poses and landmarks
AmbiguityFalse matches corrupt the mapRobust data association, gating, robust loss functions
Dynamic scenesMoving objects become ghost wallsMotion filtering, semantic masks, map clean-up (Module 8)
CostState grows with timeSparse formulations, keyframes, submaps, sliding windows

Limits

No algorithm removes these difficulties; they only manage them. A system that handles 100 m of corridor may fail in 1 km of identical corridor. Always test where the problems peak: long straight runs, symmetry, crowds, and sudden environment change. A failure rarely announces itself. The robot simply goes on believing in a map that has quietly become wrong.

Common misconceptions

“Better sensors remove drift.”

A better sensor reduces the rate of drift, but integration still accumulates error without bound. Only a measurement relative to something previously seen, or an external reference, bounds it.

“Random noise is the main problem.”

Systematic errors (a wrong wheel radius, a tilted sensor) usually dominate because they do not average out. Random noise grows slower than systematic bias.

“Moving objects are rare.”

In offices, streets and homes, people and vehicles are common, and a moving object seen in many scans can be built into the map as a wall.

Engineering takeaways

  1. Dead-reckoning error grows without bound; heading error is the most damaging.
  2. Systematic bias grows linearly with distance and usually dominates random error, which grows roughly as the square root.
  3. Because the pose error is copied into the map, correcting one fixes many: this makes loop closure powerful.
  4. Data association errors are worse than noise: one false match can break a map.
  5. Every real SLAM system trades accuracy, robustness and compute; know which difficulty each design choice addresses.

References and further reading

Primary papers and authoritative documentation.

Knowledge check

Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.

Question 1

Two robots drive the same 50 m. One has a wheel radius error of 1%, the other has random noise per step with the same overall magnitude. Which accumulates a larger position error and why?

Explanation

The wheel radius error is systematic: it scales every step in the same direction, so it grows linearly with distance. Random errors partially cancel and grow roughly with the square root of distance, so the systematic error is larger for the same per-step magnitude.

Question 2

A robot builds a map of a long corridor with identical doors. Why can a correct-looking match still be dangerous?

Explanation

Identical features cause perceptual aliasing: a match to the wrong door is geometrically plausible but wrong. Accepting it shifts the pose by the spacing between doors and corrupts the map, and nothing in the single measurement reveals it.

Question 3

Why does the fact that map errors are correlated with pose errors make loop closure so effective?

Explanation

Because all landmarks and poses along the path share and inherit the same accumulated error, one recognised revisit gives a constraint that can be propagated to all of them at once, correcting the whole trajectory and map instead of one point.

What’s next

To fix drift you first need to describe a pose precisely and know in which frame it is expressed. That is next.

Practice this lesson

Diagnose Drifting Odometry

A robot returns to its start but odometry says it is metres away: find the dominant error source and calibrate it.

Next lesson

M1-T4 — Robot Poses and Coordinate Frames

Describe a 2D pose and the world, odom, base and sensor frames, and read a frame-chain statement correctly.

Nothing below is required to finish this lesson.