A robot's sensors are liars. The Kalman Filter is the mathematical truth-seeker that uses probability to find the real state hidden behind the noise.
1The Predict Step
The Kalman Filter starts with the Predict step. It uses the robot's internal model of motion (e.g., 'If I turn the wheels at this speed, I should be here in 10ms') to estimate the new state. This prediction is not perfect—motors slip and physics is complex—so the Uncertainty (the width of our Gaussian bell curve) grows larger during this step. We are 'Guessing' our new position based on our previous actions.
2The Update Step
Once a sensor reading arrives (e.g., from a GPS or LiDAR), we perform the Update step. We compare the Measurement to our Prediction. If they match, our uncertainty shrinks. If they disagree, the filter calculates the Kalman Gain—a weight that decides whether to trust the prediction or the measurement more. This results in an Optimal Estimate that is mathematically more accurate than either the sensor or the prediction alone.
3Non-Linearity and EKF
The standard Kalman Filter assumes that systems move in straight lines (linear). But the real world is Non-Linear—robots turn, accelerate, and rotate. To handle this, we use the Extended Kalman Filter (EKF). It uses a mathematical trick called Linearization (calculating the derivative or 'Jacobian') at every step to approximate the curved motion as a series of tiny straight lines. This is the foundation of modern navigation systems in everything from smartphones to self-driving cars.
