Interactive Kalman Filter & Sensor Fusion Sandbox
Master linear Kalman filtering and optimal recursive estimation. Fuse noisy odometry with GPS measurements, observe Kalman Gain $K(t)$ convergence, and explore dynamic 2D error covariance uncertainty ellipses.
📐 The 5 Golden Kalman Equations & ROS 2 Sensor Fusion
1. Time Update (Predict)
Project state forward in time using internal physical kinematic model:
P_k^- = F_k P_{k-1} F_k^T + Q_k
The process noise covariance $Q$ adds uncertainty to the prior error covariance $P^-$ at every timestep. In dead-reckoning without external sensor updates, $P^-$ grows indefinitely.
2. Measurement Update (Correct)
Compute optimal Kalman Gain $K_k$ and correct the state estimate:
\hat{x}_k = \hat{x}_k^- + K_k \left(z_k - H_k \hat{x}_k^-\right)
P_k = (I - K_k H_k) P_k^-
When sensor measurement noise $R \to 0$, $K \to 1$ (complete belief in sensor). When $R \to \infty$, $K \to 0$ (sensor ignored; belief stays with physical model).
3. ROS 2 robot_localization Integration
In modern autonomous mobile robotics (ROS 2), the robot_localization package runs dual Extended Kalman Filters (EKF):
- Local EKF: Fuses continuous high-frequency wheel odometry (encoders) with IMU angular velocity at 50Hz to publish a smooth, drift-free
odom -> base_linktransform. - Global EKF: Fuses local odometry with low-frequency, noisy RTK-GPS or visual SLAM landmarks to publish absolute georeferenced
map -> odomposes without jumps.