Odometry: Navigation by Counting Your Steps
Two encoders and arithmetic give a live position estimate for free — one that starts perfect and rots with every metre, because wheels lie a little and integration believes them completely.
Builds on: 2.3 The Complementary Filter: One Truth from Two Liars1.3 Gears: Trading Speed for Strength
Same idea, other course:Vector: position as integrated velocity
Dead reckoning on two wheels
A differential-drive robot — two driven wheels, one caster — knows its wheel rotations to a fraction of a degree, thanks to encoders. Multiply ticks by wheel circumference: distance travelled per wheel. From the pair, everything:
Update heading, advance position along it, repeat every loop tick — and the robot carries a live (x, y, θ) estimate computed entirely from its own step-counting. This is odometry, the navigational sibling of the gyro’s integration, and it inherits the family curse.
The rot
Wheels lie a little: they slip on dust, squash under load, and are never exactly the diameter on the datasheet. Each lie is tiny; integration keeps them all. Distance errors grow steadily — but heading errors are the killers, because a heading error rotates every metre that follows: drive ten metres with a one-degree heading lie and you arrive 17 cm sideways of your estimate. After three trips around the room, the odometry says you are in the hallway.
The failure pattern deserves its name: locally excellent, globally rotten. Over a second, odometry is the best sensor you own — smooth, fast, millimetre-fine. Over a building, it is fiction. The complementary-filter instinct from Unit 2 should be tingling: a drift-free but slower witness is needed to anchor it. That witness is next lesson’s map.
Calibration buys time
Before fighting drift with fusion, shrink it at the source: drive a measured straight line and scale the wheel diameter until reported matches real; spin ten full turns in place and trim the track width until the heading agrees. Called UMBmark in the literature, it is an afternoon’s work that cuts drift severalfold — and it still only postpones the rot. Integration always wins in the end.
Sailors called it dead reckoning: log-line speed × time on a compass bearing, and a growing circle of doubt around the pencilled position — until a lighthouse fixed it to truth. Replace lighthouse with lidar and you have Unit 5’s remaining two lessons.
⚗️ Lab — The Doubt Circle
Drive a robot around a marked course. Ghost robot: where odometry believes it is. Sliders for wheel slip and calibration error.
- Drive one lap with perfect wheels: ghost and robot dance as one. Now add 2% slip and watch them separate — slowly, then not slowly.
- Add a small track-width miscalibration and turn in place a few times: heading rot beats distance rot, every time.
- Watch the doubt circle grow with distance travelled. Note it never shrinks — nothing in odometry can un-lie.
Work it by hand — 0 / 2
No multiple choice here: compute the value and type it. Suffixes like 2.5k or 20m are understood; answers within ±2% count.