Kalman filter
The Kalman filter is the workhorse algorithm for tracking something that moves while you can only watch it through noisy sensors. It keeps the robot's belief as a Gaussian — a bell curve with a best-guess center and an honest width — and updates that belief in a tight, endlessly repeating two-step loop. First it predicts where things should be now, using a model of how the system moves; then it corrects that prediction with a fresh sensor reading. Think of it as a disciplined optimist who makes a forecast, peeks at reality, and then quietly splits the difference in exactly the right proportion every single time.
That "right proportion" is the heart of it, and it is decided by trust. At each correction the filter weighs two sources against each other: its own prediction and the new measurement. If the sensor is known to be reliable and the prediction shaky, it leans hard toward the measurement; if the sensor is jittery and the prediction solid, it mostly keeps its forecast. This automatic, evidence-weighted blend is computed by a quantity called the Kalman gain, and it is what lets the filter squeeze a clean, steady estimate out of two sources that are each individually too noisy to trust alone.
What makes the Kalman filter special is that, for systems whose motion and sensing are linear (straight-line, proportional math) and whose noise is Gaussian, it is provably optimal — no other estimator using the same information can do better at minimizing the average squared error. It is also wonderfully cheap: it never stores history, only a running mean and covariance, so it can run thousands of times a second on tiny hardware. That blend of mathematical optimality and practical thrift is why versions of it sit inside spacecraft, phones, GPS units, and nearly every self-driving system on the road.
A car's GPS reports a position only once a second and jumps around by a few meters, while its wheel sensors update constantly but slowly drift. A Kalman filter fuses the two — predicting smoothly from the wheels between GPS fixes, then snapping back toward each GPS reading when it arrives — and the dot on your map glides instead of teleporting.
The filter blends a smooth-but-drifting source with a noisy-but-anchored one into a clean track.
The plain Kalman filter assumes everything is linear and Gaussian. Real robots curve, turn, and carry odd noise, so engineers usually reach for its bent cousins — the extended Kalman filter (EKF) or unscented Kalman filter (UKF) — which keep the same predict-correct skeleton but bolt on tricks to handle curved, nonlinear motion.