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

Localization & SLAM · Theory · M1

M1-T5 — Odometry and Motion Models

Integrating wheel motion gives a smooth pose estimate that is wrong by an amount that never stops growing.

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

Odometry is the cheapest motion sensor a robot has and the first input to nearly every SLAM system. Understanding exactly how an encoder count becomes a pose, and which assumptions that conversion makes, is what lets you recognise and calibrate the errors the next lab asks you to diagnose.

Learning objectives

After this lesson, you should be able to:

  • Derive the forward speed and turn rate of a differential-drive robot from wheel speeds.
  • Integrate encoder increments into a 2D pose and explain the midpoint approximation.
  • Identify the main systematic and random sources of odometry error.
  • Explain why even a calibrated odometry error grows without bound, and why that makes it an input rather than a solution.

The intuition

A differential-drive robot has two driven wheels on one axle. If both turn at the same speed it goes straight. If one is faster it curves toward the slower one. If they turn in opposite directions it spins on the spot. By counting how far each wheel turned, the robot can compute how it moved, then add that movement to its previous pose. This is called dead reckoning, the same method sailors used with a log line and a compass.

Differential drive geometryA differential drive robot with two wheels of radius r separated by the wheelbase b. A curved arc path is shown with the instantaneous centre of rotation and a heading change.centre of rotation startend v = ( v_R + v_L ) / 2 ω = ( v_R − v_L ) / b v_L, v_R: left and right wheel speeds b: wheelbase (distance between wheels) v: forward speed ω: turn rate
Differential drive: wheel speeds give forward speed v and turn rate ω. Over a short time step the robot moves along a circular arc.

The weakness is clear from the idea: every step builds on the last. There is nothing in dead reckoning that checks the answer against the world, so a mistake in step 1 is carried forever.

The mathematics

A wheel encoder counts ticks. With N ticks per revolution and wheel radius r, a count of Δn ticks means the wheel travelled

Wheel travel from encoder ticks
Δs=2π⋅r⋅ΔnN\Delta s=\frac{2\pi \cdot r\cdot \Delta n}{N}

For the left and right wheels this gives ΔsL and ΔsR. With wheelbase b, the robot’s forward motion and turn in that step are

Increments from the wheels
Δs=ΔsR+ΔsL2\Delta s=\frac{\Delta s_{R}+\Delta s_{L}}{2}
Δθ=ΔsR−ΔsLb\Delta \theta =\frac{\Delta s_{R}-\Delta s_{L}}{b}
r
wheel radius in metres. A 1% error in r is a 1% error in all distances.
b
wheelbase: the distance between the contact points of the two wheels. Errors here corrupt the turn angle.
Δs
distance moved by the robot centre during the step.
Δθ
heading change during the step, positive counter-clockwise.
N
encoder ticks per wheel revolution.

The pose is updated by moving along the arc. The standard midpoint model uses the heading at the middle of the step:

Odometry pose update, midpoint model
x←x+Δs⋅cos⁡(θ+Δθ2)x\leftarrow x+\Delta s\cdot \cos (\theta +\frac{\Delta \theta }{2})
y←y+Δs⋅sin⁡(θ+Δθ2)y\leftarrow y+\Delta s\cdot \sin (\theta +\frac{\Delta \theta }{2})
θ←θ+Δθ\theta \leftarrow \theta +\Delta \theta

Using θ at the start of the step would be less accurate, and using the end would be biased the other way: the midpoint is exact for straight lines and a good approximation for small arcs.

Error sources

Sources of odometry error
SourceTypeEffectFix
Wheel radius error (and difference between the two wheels)SystematicScales distance; a left/right difference turns a straight line into an arcCalibrate rL and rR
Wheelbase errorSystematicScales the turn angleCalibrate b with turn-in-place tests
Wheel slipRandom, situationalEncoders report motion that did not happenFuse with IMU or LiDAR; limit acceleration
Encoder quantisationRandomFixed resolution, small per-step noiseHigher-resolution encoders
Floor irregularitiesRandomUnmodelled motionExternal correction

The systematic errors are the large ones, and they are repeatable. That is good news: a repeatable error can be measured and removed.

A worked example: one step and one square

A robot has wheel radius r = 0.05 m, wheelbase b = 0.30 m and an encoder with N = 1000 ticks per revolution. Pose is (0, 0, 0).

  1. Ticks to distance. In one step the left wheel counts 80 ticks and the right 100. ΔsL = 2π × 0.05 × 80 / 1000 = 0.02513 m. ΔsR = 2π × 0.05 × 100 / 1000 = 0.03142 m.
  2. Robot motion. Δs = (0.03142 + 0.02513) / 2 = 0.02827 m. Δθ = (0.03142 − 0.02513) / 0.30 = 0.02094 rad (1.2°). The right wheel went farther, so the robot turned left (positive).
  3. Pose update. The midpoint heading is 0 + 0.02094 / 2 = 0.01047 rad. x = 0.02827 × cos(0.01047) = 0.02827 m, y = 0.02827 × sin(0.01047) = 0.000296 m. New pose (0.0283, 0.0003, 0.0209).
  4. Now a square, with a 1% wheelbase error. The robot drives four 2 m sides, turning 90° at each corner. If the true wheelbase is 0.30 m but the model uses 0.303 m (1% too large), the computed turn is smaller than the real one: each corner is under-estimated by about 1% of 90°, or 0.9°. After four corners the heading estimate is off by about 3.6°, yet the robot truly turned 360°.
  5. Result. Integrating the four sides with the mis-estimated headings (0°, 89.1°, 178.2°, 267.3°) ends about 0.09 m from the start: the believed path does not close. One percent in one parameter turned into a closure error of 9 cm after 8 m of driving, and the error is systematic, so a longer run makes it larger.

This is exactly what the lab does with a tool that lets you switch each error source on and off.

Engineering implications and limitations

Using odometry well

  • Calibrate first. Drive a known square and a known straight line; solve for rL, rR and b. This often removes most of the error for free (see the next lab).
  • Treat it as short-term information. Over a metre it is excellent; over a kilometre it is useless. Fuse it with measurements that do not drift.
  • Model the noise honestly. A motion model gives the probability of a pose after a command. Heading noise should depend on how much the robot turned and how far it travelled.
  • Detect slip. If the wheels spin but an IMU or scan matching says the robot did not move, odometry must be down-weighted. Climbing a ramp or driving on a wet floor are typical.
  • Publish the covariance. Downstream SLAM needs to know how much to trust odometry; a fixed constant is a common source of bad maps.

Limits

No calibration removes slip, floor irregularities or the wheel’s deformation under load. A calibrated robot still drifts; it drifts more slowly. And the error is not just growing, it is unbounded: after a long drive the uncertainty of the position is larger than the building. That is why mapping and place recognition are needed: they supply measurements that are tied to the world rather than to the path.

Common misconceptions

“Odometry is accurate if the encoders are accurate.”

Encoder resolution is rarely the limit. Wheel radius, wheelbase and slip dominate; a perfect encoder with a wrong wheel radius is still wrong.

“Calibrating once is enough.”

Tyres wear, loads change and tyre pressure varies; the calibration changes slowly. Re-check it after any mechanical change.

“Random noise is why odometry fails.”

Systematic error is usually larger and is the reason the end of a square does not close.

Engineering takeaways

  1. Differential drive: v = (vR + vL) / 2 and ω = (vR − vL) / b.
  2. Odometry integrates increments into a pose; the midpoint model is the standard update.
  3. Systematic errors in r and b dominate and can be calibrated; slip and noise cannot.
  4. Heading error compounds into position error, so turning is where odometry hurts most.
  5. Odometry is unbounded in error and must be corrected by measurements of the world.

References and further reading

Primary papers and authoritative documentation.

  • Borenstein, J. and Feng, L. (1996). Measurement and correction of systematic odometry errors in mobile robots. IEEE Transactions on Robotics and Automation 12(6). UMBmark: the standard calibration method.
  • Siegwart, R., Nourbakhsh, I. and Scaramuzza, D. (2011). Introduction to Autonomous Mobile Robots, 2nd ed., MIT Press, chapters 3 and 5: kinematics and error models.
  • Thrun, S., Burgard, W. and Fox, D. (2005). Probabilistic Robotics, chapter 5: velocity and odometry motion models.
  • Kelly, A. (2013). Mobile Robotics: Mathematics, Models and Methods. Cambridge University Press: error propagation for dead reckoning.

Knowledge check

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

Question 1

A robot is commanded to drive straight but its true path curves steadily to the left, while its odometry reports a straight line. What is the most likely cause, and why can odometry not see it?

Explanation

A difference between the true wheel radii (one wheel is effectively larger than the model assumes). The encoders count the same ticks per wheel, so the model computes equal distances and a straight line, while the real wheels cover different distances and the robot curves. Odometry is blind to errors in its own parameters, which is why a calibration run measured against an outside reference is needed.

Question 2

Why is the heading estimate more damaging to position accuracy than a distance estimate of the same relative error?

Explanation

A distance error scales the displacement along the direction of travel. A heading error rotates the whole remaining path, so every later step is displaced sideways, and the sideways error grows with distance travelled.

Question 3

After calibrating the wheel radii and wheelbase, a square run still does not close exactly. Is this a failure of calibration?

Explanation

No. Calibration removes systematic error but not random error such as slip and floor irregularities. A small residual is expected, and the fact that error is not removed entirely is why odometry has to be corrected by outside measurements.

What’s next

Time to try it. The second lab gives you a robot that returns to its start but whose odometry says it is metres away, and asks you to find out why.

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-T6 — Sensors Used in SLAM

Compare LiDAR, cameras, IMUs, wheel encoders, GPS and radar by what they measure, their noise and their failure modes.

Nothing below is required to finish this lesson.