Kalman Filter

Wheel counting drifts and GPS jumps. Which do you trust to tell you where you are?

Average error GPS alone — Wheels alone — Filter —

Coasting on wheels, uncertainty growing

0.02
0.18
2
1

GPS alone holds its last reading between fixes. Drag inside the plot to give the filter a GPS fix at the current time.

What you are looking at

True path
The position the robot actually reaches in the simulation.
Raw GPS dots
The position reported at each fix. GPS alone keeps using the last fix until a new one arrives.
Wheels alone
The position from counting wheel movement, with errors that build up.
Filter estimate
The position predicted from the wheels and adjusted when a GPS fix arrives.
Uncertainty
The shaded band extends two standard deviations on either side of the estimate.

Try this

  1. Watch a GPS dot arrive and the uncertainty band tighten.
  2. Pick Noisy fixes. Watch how far the estimate moves toward each dot.
  3. Compare Spaced fixes and Frequent fixes. Watch the band between fixes and see which error is lowest.

Key idea

Use the wheels to predict where the robot is between GPS fixes. At each fix, give GPS more weight if the wheel prediction is uncertain or the GPS is reliable.