Unscented Kalman Filter (UKF)
Problem Statement
For strongly nonlinear dynamics, first-order Jacobian linearization can degrade EKF accuracy. The UKF uses deterministic sigma-point propagation to capture higher-order effects without symbolic Jacobians.
Model and Formulation
Given state mean \mu and covariance P, construct 2n+1 sigma points:
Propagate each point through nonlinear models, then recover moments:
Algorithm Procedure
- Generate sigma points using
(\alpha,\beta,\kappa)scaling. - Propagate points through process model for prediction.
- Project predicted points into measurement space.
- Compute gain from cross-covariance and update posterior state.
What This Simulation Measures
GPS is unavailable; the drone localises from noisy ranges to four surveyed ground anchors. That measurement model is nonlinear in the state, which is what makes it a UKF demo — given a linear model the UKF reduces exactly to the Kalman filter and there is nothing to show.
Tuning Guidance
- Use small
\alpha(1e-3to1e-1) for local spread control. - Set
\beta=2for approximately Gaussian priors. - Increase process noise if sigma clouds collapse under model mismatch.
- Scale
Qwith the step size.Qis the covariance accumulated over one step. A fixeddiag([...])at 200 Hz claims the velocity random-walks by 0.32 m/s every 5 ms; the filter concludes its own prediction is worthless and degenerates into echoing the measurement. Build it from an acceleration noise density instead (uav_sim.estimation.constant_velocity_q), and the tuning survives a change of rate. - Sanity-check the reported 1σ against the actual error. A filter whose covariance is much tighter than its error has stopped listening.
Failure Modes and Diagnostics
- Poor scaling parameters can produce non-positive definite covariance.
- Non-Gaussian heavy-tailed noise can still break Gaussian-moment assumptions.
- Monitor covariance eigenvalues to detect numerical instability.
Implementation and Execution
bash
python -m uav_sim.simulations.estimation.ukfEvidence

References
- Wan and Van der Merwe, The Unscented Kalman Filter for Nonlinear Estimation (2000)
- Julier and Uhlmann, Unscented Filtering and Nonlinear Estimation, Proceedings of the IEEE (2004)