Sensor fusion and the Kalman filter in drone navigation
Published:
Sensor fusion is the process of combining measurements from several sensors into a single, more reliable estimate of a vehicle's state. On drones it is what turns a noisy IMU, a camera and an altimeter into a usable position, velocity and orientation. The Kalman filter and its variants are the most common tools for the job.
Why fuse sensors at all?
Every navigation sensor has a weakness. An IMU responds instantly but drifts. A camera limits drift but needs light and texture. A barometer bounds altitude but reacts to air pressure changes. A magnetometer gives heading but is disturbed by nearby metal and electrical current.
Because these weaknesses rarely occur at the same time, combining sensors gives an estimate that is better than any single one, and that keeps working when one sensor temporarily fails.
How the Kalman filter works
The Kalman filter keeps an estimate of the vehicle's state together with a measure of how uncertain that estimate is. It repeats two steps:
- Predict: use a motion model, usually driven by IMU data, to move the state forward in time. Uncertainty grows during this step.
- Update: when a measurement arrives from another sensor, compare it with what the prediction expected and correct the state. Uncertainty shrinks.
- Weighting: the size of each correction depends on how much the filter trusts the prediction versus the measurement, based on their uncertainties.
EKF, UKF and other variants
The original Kalman filter assumes linear models. Real vehicle motion and many sensor models are nonlinear, so practical systems use variants. The extended Kalman filter (EKF) linearizes the models around the current estimate and is widely used in flight controllers. The unscented Kalman filter (UKF) handles stronger nonlinearity with a different approximation.
Some modern systems, especially visual-inertial ones, use optimization over a sliding window of recent measurements instead of a filter. The goal is the same: the best estimate that agrees with all the measurements.
Common pitfalls
A fusion system is only as good as its assumptions:
- Wrong noise settings make the filter trust a sensor too much or too little.
- Poor time synchronization between sensors introduces errors during fast motion.
- Calibration errors, such as an inaccurate camera-to-IMU alignment, show up as drift.
- Faulty measurements need to be detected and rejected rather than blindly fused.