MTBuilder AcademyLearn it. Test it. Build it.
Systems & robotsLesson 43 of 48
Practice70 minutes1 project connections

Localization and wheel odometry

Estimate a mobile robot’s pose from wheel motion while tracking how scale, slip, and heading error accumulate.

After this lesson, you can
  • Convert encoder counts to differential-drive pose increments, propagate a simple uncertainty argument, and design a calibration that exposes systematic error.
Print / Save PDF
ReadPracticedBench demonstrated
Related study — optional context
01

Understand

The working idea

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.

02

Follow the reasoning

Worked example

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.

  1. 1

    Distance per count = π × 65 mm / 20 = 10.21 mm/count.

  2. 2

    Left travel = 102.1 mm and right travel = 142.9 mm; center travel = (102.1 + 142.9)/2 = 122.5 mm.

  3. 3

    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 checkBecause the right wheel traveled farther, the robot must curve left; the dimensionless distance difference divided by track width correctly yields radians.

03

Try it yourself

Independent check

After several meters, wheel odometry position drifts while encoder counts remain repeatable. Which observation most directly distinguishes wheel-scale error from intermittent floor slip?
04

Move to the bench

Calibrate encoder distance and observe accumulated odometry error on a low-speed differential-drive platform.

Gather
  • Low-voltage two-wheel robot with encoders
  • tape measure
  • masking tape
  • large paper sheet
  • marker
  • wheel blocks or stand

Experiment

  1. With drive power off, measure nominal wheel diameter and wheel separation and record uncertainty.
  2. Raise or restrain the robot; verify count sign and counts per revolution by turning each wheel by hand.
  3. Mark a one-meter straight lane, run at low speed, and log left/right counts plus odometry endpoint for three trials.
  4. Introduce a deliberate diagnostic fault in software by increasing the configured wheel diameter 10%; predict and observe the scale change, then restore it.
  5. If safe, repeat on a different loose paper or textured surface and distinguish systematic calibration from variable slip.

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 it

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.

Limits and 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.
05

Keep evidence

Bench note

Record what you expected, what you actually measured or observed, and one difference worth investigating. This is self-reported evidence, not a certification.

0 / 5,000A bench demonstration needs a concrete note of at least 20 characters.
Terms in this lessonBrowse the advanced glossary

Sources and further reading

  1. Modern Robotics
  2. Control Tutorials for MATLAB and Simulink