← Kybernetes

Where Am I? The Kalman Filter

Everything so far assumed you know the state. You don't, because sensors lie. Down there is a boat (κυβερνήτης means helmsman; of course it's a boat) whose position fix arrives a few times a second, scattered by noise. You go first: click the chart where you think the boat is (hide the truth for the honest version). Then watch the Kalman filter play the same game: predict, then correct, blending a motion model with the lying sensor, each weighted by how much it deserves to be trusted. The breathing ring is the filter admitting how unsure it is. Hold 🛰 Outage and watch honesty in action.

The sensor & the model

Trust model: silky track, but it lags every course change (turns break the constant-velocity assumption). Trust sensor: no lag, all jitter. σa is where you tell the filter how much the boat manoeuvres.

Interfere

Hold the outage (or O) and the ellipse balloons while the filter coasts on its model. In 🧑 mode, steer with ←→↑↓. Manoeuvre hard and watch the filter struggle to keep up.

Scoreboard: who finds the boat best?

Raw fix error (RMS, 20 s)–
Kalman error (RMS, 20 s)–
Filter beats sensor by–
Your last clickclick the map…
Filter at that moment–

Press 👁 to hide the truth, watch the dots for a few seconds and click where the boat is. Then reveal it and check who was closer: you or the filter.

Predict · Correct · Repeat

Predict: what the model expects

Between fixes, the filter rolls its motion model forward: the boat probably kept going. Uncertainty grows with every blind step. That's Q, the tax the model pays for the real boat not being a physics equation.

Correct: what the sensor swears

A fix arrives, off by an unknowable amount. The filter doesn't believe it; it blends it, weighted by the Kalman gain: prediction confident → nudge; prediction lost (after an outage) → leap. The gain is recomputed every step from the two uncertainties.

The ellipse: honesty as a feature

The filter's real output isn't a point, it's a distribution: best guess plus how wrong it might be. Grows while predicting, snaps tight on every fix. Downstream systems (your rocket's controller, say) can act differently when the ellipse is huge. A sensor can't do that.