Robotics
← Roadmap/State Estimation

Kalman / EKF / UKF

Optimal recursive estimation for (nearly) linear-Gaussian systems.

Progress0/17 questions
hardState EstimationSkip to practice questions ↓

Prerequisites

Why it matters in robotics

The Kalman filter is the workhorse of robotic state estimation — localization, IMU fusion, and tracking. For a linear system with Gaussian noise it is the optimal estimator, fusing a motion-model prediction with noisy measurements into a single mean-and-covariance belief, automatically weighing how much to trust the prediction versus the new measurement. Its extensions carry the same idea to the nonlinear systems that dominate real robots, handling the curved, non-straight-line relationships that linear methods can't capture directly.

What to study

  • Linear KF: predict/update equations & the Kalman gain
  • Why it's the optimal linear-Gaussian estimator (MMSE)
  • EKF: linearization via Jacobians, and its failure modes
  • UKF: the unscented transform vs. EKF
  • Tuning Q and R; observability & filter divergence
  • IMM (Interacting Multiple Model): switching motion models for maneuvering targets

Where to study

  1. Kalman Filter — 5-minute intuitionVideoCyrill Stachniss· ~6 min
  2. How a Kalman filter works, in picturesArticleTim Babb· ~25 min

Cheatsheet

Symbols used below

xxstate estimate
PPstate covariance (uncertainty)
FFstate transition matrix (motion model)
B,uB, ucontrol input matrix & control input
QQprocess noise covariance
HHmeasurement matrix
RRmeasurement noise covariance
KKKalman gain
zzmeasurement (sensor reading)
IIidentity matrix
nndimension of the state (used for sigma-point count)
ffthe (possibly nonlinear) true motion/measurement function

Predict

x=Fx+Bux^- = Fx + Bu

P=FPF+QP^- = FPF^\top + Q

Update

K=PH(HPH+R)1K = P^-H^\top(HP^-H^\top + R)^{-1}

x=x+K(zHx)x = x^- + K(z - Hx^-)

P=(IKH)PP = (I - KH)P^-

Kalman gain limits

As RR \to \infty: K0K \to 0 — trust the prediction.

As R0R \to 0: K1K \to 1 — trust the measurement.

Q vs R, at a glance

Q (process noise) — small ⇒ tight, model-trusting. Large ⇒ wide, agile, noisier.

R (measurement noise) — shrinks or grows the gain the same way.

Predictx⁻ = F x + B uP⁻ = F P Fᵀ + QUpdateK = P⁻Hᵀ(HP⁻Hᵀ+R)⁻¹x = x⁻ + K(z − H x⁻)priorposteriormeasurement zₖcontrol uₖ
The Kalman filter alternates a predict step (push state + covariance through the motion model) and an update step (blend in the measurement via the gain K).
 KFEKFUKF
AssumptionLinear, GaussianNonlinear, locally linearizedNonlinear, no linearization
How it handles nonlinearityN/A — exact1st-order Taylor (Jacobians)Sigma points through the true ff
OptimalityOptimal (MMSE)ApproximateApproximate, usually tighter than EKF
CostLowestLow (Jacobians)Higher (2n+12n{+}1 sigma points)
y = f(x)EKF tangent (Jacobian)UKF sigma pointsinput p(x)output (non-Gaussian)
A Gaussian pushed through a nonlinearity isn't Gaussian. The EKF approximates f by its tangent (Jacobian) at the mean; the UKF propagates sigma points through f, capturing the spread more faithfully.

Application focus

Select an application above.

Practice questions (17)