Error State Extended Kalman Filter (ES-EKF)
What’s in a State?
We can think of the vehicle state as composed of two parts
$$ \underbrace{\mathbf{x}}_{\text{True state|}}=\underbrace{\hat{\mathbf{x}}}_{\text{Nominal state ("Large")}}+\underbrace{\delta \mathbf{x}}_{\text{Error state ("small")}} $$💡 Idea
Instead of doing Kalman Filter in the full state (which might have lots of complicated nonlinear behaviours). we use the EKF to directly estimate the error state instead, and then use the estimate of the error state as a correction for nominal state.
ES-EKF Steps
Loop
Update nominal state with motion model (for a bunch of times until getting the measurement)
Propagate uncertainty (for a bunch of times until getting the measurement)
If a measurement is available
Compute Kalman Gain
Compute error state
$$ \delta \hat{\mathbf{x}}_{k}=\mathbf{K}_{k}\left(\mathbf{y}_{k}-\mathbf{h}_{k}\left(\check{\mathbf{x}}_{k}, \mathbf{0}\right)\right) $$Correct nominal state
$$ \hat{\mathbf{x}}_{k}=\check{\mathbf{x}}_{k}+\delta \hat{\mathbf{x}}_{k} $$Correct state covariance
$$ \hat{\mathbf{P}}_{k}=\left(\mathbf{1}-\mathbf{K}_{k} \mathbf{H}_{k}\right) \check{\mathbf{P}}_{k} $$
Why Use the ES-EKF?
Better performance compared to the vanilla EKF
The “small” error state is more amenable to linear filtering than the “large” nominal state, which can be integrated nonlinearly
Easy to work with constrained quantities (e.g. rotations in 3D)
We can also break down the state using a generalized composition operator
$$ \underbrace{\mathbf{x}}_{\text{true state}}=\underbrace{\hat{\mathbf{x}}}_{\text{Nominal state (constrained)}} \bigoplus \underbrace{\delta\mathbf{x}}_{\text{Error state (unconstrained)}} $$
Summary
The error-state formulation separates the state into a “large” nominal state and a “small” error state
- nominal state: keeps track of the motion model, predicts what the state should be
- error state: captures the modeling errors and the process noise that accumulate over time
The ES-EKF uses local linearization to estimate the error state and uses it to correct the nominal state
The ES-EKF can perform better thant the vanilla EKF, and provides a natural way to handle constrained quantities like 3D rotations