Moving horizon estimation
- Also called: MHE, receding horizon estimation
- Category: State estimation & navigation › Localisation
- Tags: state-estimation, optimization, parameter-estimation, sensor-fusion, model-predictive-control
An optimization-based state estimator that fits a dynamics model to the measurements in a sliding window of recent timesteps, re-solving at each step and able to enforce constraints.
Definition
Moving horizon estimation (MHE) estimates the current state of a system, and optionally unknown parameters or disturbances, by solving an optimization problem over a window of the most recent N measurements. The decision variables are the states across the window, or equivalently the first state plus the process noise at each step. The cost penalizes the mismatch between predicted and measured outputs, the size of the process noise needed to explain the data, and the deviation of the first state in the window from a prior estimate. At the next timestep the window slides forward by one sample, the oldest measurement is dropped, and the problem is solved again.
The term that anchors the first state of the window is called the arrival cost. It stands in for all the measurements that have already left the window. With a linear model, Gaussian noise, no constraints and an exact arrival cost, MHE gives the same estimate as the Kalman filter. In practice the arrival cost is approximated, often with an extended Kalman filter covariance update or a fixed quadratic weight, and the window length is chosen to balance estimation quality against computation.
MHE is often described as the estimation counterpart of model predictive control: MPC optimizes over a future horizon to choose controls, while MHE optimizes over a past horizon to explain measurements. Its advantages over recursive filters are that it can impose hard constraints, such as positive masses, joint limits or contact forces inside friction cones, and that it relinearizes the whole window at every solve instead of committing to one linearization per step, which helps with strongly nonlinear models. The price is a nonlinear least-squares solve at every timestep, so real-time implementations rely on structure-exploiting solvers, warm starts and a limited number of iterations per step. Adding model parameters to the estimated state turns MHE into an online system identification tool, which is how the Parameterized DDP paper uses it.
Why it matters
Many robot estimation problems involve constraints and nonlinearities that recursive filters handle poorly. MHE sits between a filter and a full batch smoother: it uses a window of data and an optimizer, yet keeps computation bounded, which makes it practical for estimating states and parameters that feed a model predictive controller.
Key applications
- Online estimation of payload mass, friction and other parameters for MPC
- Constrained state estimation for legged robots in contact
- Vehicle and drone state and disturbance estimation
- Sensor fusion with delayed or irregular measurements
- Fault and anomaly detection from model residuals
In practice
A team building an aerial manipulator wants to estimate the mass and center of mass of an unknown payload after grasping it. They add these parameters to the state of an MHE problem that uses the last fraction of a second of IMU, motor speed and pose data, with constraints that keep the mass positive and the center of mass within the gripper's reach. Each control cycle, the solver is warm-started from the previous window shifted by one sample and runs a few Gauss-Newton iterations in a code-generated solver such as acados, and the estimates are passed to the flight MPC. Tuning the arrival cost weight is the main trade-off: too low and the estimates are noisy, too high and they react slowly when the payload changes.
Common misconceptions
- MHE is a Kalman filter with a data buffer — it solves an optimization over the whole window at every step, can enforce constraints and relinearizes the full window
- Information outside the window is simply lost — the arrival cost carries it forward, though only approximately
- A longer window is always better — longer windows cost more computation and can slow the response to genuine changes, especially when parameters are modeled as constant
Who should know this
- State estimation engineers
- Model predictive control engineers
- Aerial and legged robot developers
- Researchers working on online system identification
Related technologies
- acados
- CasADi
- Kalman Filter
- Factor Graph Smoothing
- Gauss-Newton Method
Related terms
- Extended Kalman Filter
- Model Predictive Control
- Pose Graph Optimization
- Sensor Fusion
- Differential dynamic programming
- System Identification
Related projects
- FAST-LIVO2: Fast, direct LiDAR-inertial-visual odometry from HKU-MARS, published in IEEE T-RO
- Drake: MIT robotics toolbox for model-based dynamics, optimization, and control system design
- GTSAM: Factor-graph optimization library powering many modern SLAM backends
- OpenVINS: The reference open platform for visual-inertial state estimation research
- manif: Header-only C++ Lie theory library for robotics state estimation
- MuJoCo MPC: DeepMind's interactive real-time model predictive control framework for MuJoCo
Videos
- Moving Horizon Estimation in MATLAB, Python, and Simulink: APMonitor.com