Metatransformer report
Localization and wheel odometry
Practice · 70 minutes · Estimate a mobile robot’s pose from wheel motion while tracking how scale, slip, and heading error accumulate.
Text report: images and diagrams are omitted, and links to project files are inactive. Keep the exported project alongside this PDF for wiring diagrams, models, and linked files.
Learning outcomes
- Convert encoder counts to differential-drive pose increments, propagate a simple uncertainty argument, and design a calibration that exposes systematic error.
Prerequisites
- kinematic-chains
- rates-integration
Concepts
Localization answers “where am I relative to a map or starting frame?” Odometry answers a narrower question: “how did motion sensors say I moved?” A toy car can count wheel rotation and integrate small increments, but every diameter error, missed count, and slip becomes part of the estimate. Odometry is useful precisely because it is frequent and local, not because it is an absolute truth.
For a wheel of diameter d with N counts per revolution, distance per count is πd/N. A differential-drive robot with left and right travel Δs_L and Δs_R has center travel Δs = (Δs_R + Δs_L)/2 and heading change Δθ = (Δs_R - Δs_L)/b, where b is wheel separation. For small increments, update x by Δs cos(θ + Δθ/2), y by Δs sin(θ + Δθ/2), and θ by Δθ. The midpoint heading reduces error compared with using only the old heading.
Calibration makes parameters empirical. Command several straight runs to estimate effective distance per count, and rotations to estimate effective track width. A nominal 65 mm wheel under load may behave differently because of tire compression. Choosing calibrated effective diameter is a build decision, but tuning it to one floor may hide slip rather than create a universal constant.
A common misconception is that equal commanded PWM means equal wheel distance. Motors, load, and traction differ; encoders measure rotation, and even equal rotation can slip against the floor. Heading error is especially costly because later forward motion projects in the wrong direction. External landmarks, a camera, or other absolute observations can correct drift, but fusion must represent uncertainty and frame relationships. Never use an odometry-only bench exercise to claim navigation accuracy in an untested environment.
Worked example
Problem
A differential-drive robot has 65 mm wheels, 20 counts/revolution, and 150 mm wheel separation. In one interval left advances 10 counts and right 14 counts. Estimate center travel and heading change.
Steps
- Distance per count = π × 65 mm / 20 = 10.21 mm/count.
- Left travel = 102.1 mm and right travel = 142.9 mm; center travel = (102.1 + 142.9)/2 = 122.5 mm.
- Heading change = (142.9 - 102.1) mm / 150 mm = 0.272 rad = 15.6° toward the left-wheel side.
Result
The odometry increment is about 122.5 mm forward along the arc with a 0.272 rad heading change.
Sanity check
Because the right wheel traveled farther, the robot must curve left; the dimensionless distance difference divided by track width correctly yields radians.
Check your understanding
After several meters, wheel odometry position drifts while encoder counts remain repeatable. Which observation most directly distinguishes wheel-scale error from intermittent floor slip?
A. Change the screen color B. Repeat measured straight runs on two surfaces and compare error proportionality and run-to-run variability C. Increase the stored pose to more decimal places D. Assume the encoder is perfect because counts repeat
Your answer: ______________________________
Reasoning:
Answer key
ANSWER KEY — check only after attempting the question.
B. Repeat measured straight runs on two surfaces and compare error proportionality and run-to-run variability
A consistent proportional error suggests scale calibration, while surface-dependent or irregular error supports slip. More digits do not add accuracy, and repeatable shaft counts cannot prove wheel-to-floor motion. Screen appearance is unrelated to the motion evidence.
Hands-on lab
Goal
Calibrate encoder distance and observe accumulated odometry error on a low-speed differential-drive platform.
Equipment
- Low-voltage two-wheel robot with encoders
- tape measure
- masking tape
- large paper sheet
- marker
- wheel blocks or stand
Procedure
- With drive power off, measure nominal wheel diameter and wheel separation and record uncertainty.
- Raise or restrain the robot; verify count sign and counts per revolution by turning each wheel by hand.
- Mark a one-meter straight lane, run at low speed, and log left/right counts plus odometry endpoint for three trials.
- Introduce a deliberate diagnostic fault in software by increasing the configured wheel diameter 10%; predict and observe the scale change, then restore it.
- If safe, repeat on a different loose paper or textured surface and distinguish systematic calibration from variable slip.
What to observe
- Expected: the 10% diameter configuration error makes estimated travel about 10% too large for the same counts.
- Record actual measured travel, counts, estimated travel, lateral deviation, and surface for every trial.
- Expected: physical endpoints vary more when traction varies; the amount is an observation, not a promised result.
Transfer challenge
Estimate how one degree of heading error affects lateral position after a 2 m hallway run, then propose one camera or landmark observation that could bound drift.
Cautions
- Use low speed, a clear floor area, and a reachable power cutoff; keep wheels raised for sign tests and never chase a moving robot.
Evidence record
Learner: ____________________ Date: ____________________
Evidence artifact or file: ____________________________________________
| Item | Record |
|---|---|
| Prediction or expected result | |
| Actual observation or measurement | |
| Conditions and tools used | |
| Difference from expectation | |
| Next decision or follow-up |
Notes: