Φferromotion · textbook · chapter 6 rust → wasm · on-device

The estimator that stays honest

A robot's sense of where it is drifts, and the filter that tracks that drift has to model how its own error grows. The invariant EKF models it exactly — for any error, however large — where a standard filter's model quietly falls apart. This page runs both, on your device, with the same Rust estimator the native tools use.

01 — the problemA model of your own error

An estimator carries two things: a best guess of the state, and a sense of how uncertain that guess is. The uncertainty is propagated through a linear model of how the error evolves — and that model is what keeps the filter honest about its own confidence. If the error-model is wrong, the filter's uncertainty is wrong: it grows overconfident, trusts a bad estimate, and diverges.

The catch is that the true error dynamics are nonlinear, so the model has to be a linearization — and a standard EKF linearizes around its current estimate. Exactly when the estimate is far off, the linearization point is far off, and the error-model is least trustworthy right when it matters most.

02 — the setupA wrong guess, dead-reckoned

Below, a robot moves under IMU dead-reckoning. Its filter started with a wrong initial guess, so the true path (gold) and the robot's belief (red) pull apart. The question is not whether the guess is wrong — it is — but whether the filter knows how wrong, i.e. whether its error-model tracks the real error.

InEKF model error
EKF model error
actual error size

the plot is how far each filter's error-model is from the true error — drag the initial error up and watch the red curve balloon while the green stays on zero

03 — the invariant trickAn error that doesn't care where you are

Barrau & Bonnabel's move is to measure the error not as a subtraction but as a ratio on the group the state lives on — attitude, velocity and position together as one element of SE₂(3). In those coordinates the error obeys ξ̇ = A ξ with a matrix A that depends only on gravity — not on the estimate, not on the measurements, not on how large the error is.

That is the whole difference. The InEKF's A is a constant, so its linear error-model is not an approximation around a point — it is exact everywhere. The standard EKF's transition F carries the estimate's own attitude inside it, so its model is only tangent at the current guess and drifts away as the guess does. Same robot, same measurements, same initial error; one filter's error-model is right to machine precision and the other's is off by as much as the error itself.

04 — the guaranteeExact, at any error

On load, this page ran both filters across error sizes from small to enormous and recorded how far each error-model strayed from the truth:

worst InEKF model error, over error sizes ×0.5 – ×10
worst standard-EKF model error, same sweep
verdict

The InEKF number is machine zero and stays there no matter how wrong the guess starts — the theorem is not "small-error accurate," it is exact. The EKF number climbs with the error, because its model is only ever tangent to the truth at a point it has already left.

05 — the pointConsistency you can prove

Pick the error so its model is exact.

An estimator is only as honest as its error-model. By measuring error on the group instead of by subtraction, the invariant EKF gets a model that is exact for any error — so its uncertainty stays truthful, and it does not talk itself into a confident wrong answer.

This is why invariant estimation runs under so many legged robots and drones now: the same filter machinery you already know, but consistent by construction rather than by luck and hand-tuning. It is the estimation counterpart to the guarantees in the earlier chapters — the barrier that cannot be crossed, the goal that must be reached — a hard property secured by choosing the right structure, not by hoping the linearization holds.

What you just drove: the Se₂(3) group, riekf_a_matrix and standard_ekf_f from ferromotion-control, compiled to WebAssembly — the same code the native tools link against. Truth and a wrong estimate are dead-reckoned through one IMU stream; the true right-invariant error is compared against the InEKF's estimate-independent prediction and a standard EKF's estimate-dependent one. Nothing precomputed — every slider move re-runs the simulation.

Verified in the library: the invariant error-model is exact (≈1e-13) at every error size from ×0.2 to ×8 · the standard-EKF model is >100× worse and degrades as the error grows · the invariant attitude error is conserved · A is state-independent while F is not. Each is a test in cargo test, not a claim in prose. See also ch.1 · ch.2 · ch.3 · ch.4 · ch.5.

Institute for Physical AI · the Rust library · crates.io