State Estimation
Kalman filters, factor graphs, and pose estimation from noisy sensors.
- Last reviewed
- Reading time
- 14 min
- Citations
- 12
Control closes the loop under one quiet assumption: that someone knows the state. The pole's angle, the arm's configuration, the quadruped's velocity over ground. Nobody does. What the robot actually has is a stream of sensor readings, each one noisy, some biased, a few missing outright. State estimation is the discipline that turns that stream into a usable estimate, with an honest number attached describing how wrong the estimate might be.
The honest number is what separates the field from curve fitting. A controller that knows the estimate's uncertainty can act cautiously when the number is large and aggressively when it is small; a controller handed a bare guess cannot. Every estimator in this module is built to carry both.
The lab below is that idea running. A target wanders in one dimension, a position sensor drops about one reading in five, and the blue band is the filter's own claim about how wrong it might be. Move the measurement-noise slider up and the estimate smooths and lags while the band widens; move the process-noise slider up instead and the estimate hugs every reading. Nothing about the world changed either time. Only what the filter believes about it.
What the filter assumes about the target’s per-step acceleration. Raise it and the band swells between fixes while the estimate chases every reading.
What the filter assumes about the sensor’s scatter. Raise it and the gain drops: the estimate smooths, lags, and the band widens.
step 60 / 600 seed 1 sigma 0.72 gain 0.52 rms err 0.90
A constant-velocity Kalman filter tracking a wandering target from a noisy position sensor. The band is the filter's own ±2σ position uncertainty: it is widest where readings dropped out and the estimate coasted on the model. The world is fixed by the seed in the readout, so a run is exactly reproducible: Reseed generates the next world, Reset returns to world 1 with the matched default beliefs (σq 0.20, σr 1.00). Things worth trying: drag σr up and watch the gain fall and the estimate smooth out; drag σq up and watch the estimate hug every reading while the band swells between fixes.
Over the 61-step window ending at step 60, the estimate stays within 0.90 units rms of the true path while roughly one reading in five drops out, and the shaded band is the filter's own plus or minus two sigma position uncertainty under the assumed noise levels (sigma q 0.20, sigma r 1.00), not a measured error bar, so it swells wherever the estimate coasted between fixes.
Sampled truth, estimate and uncertainty across the window
| step | true | estimate | ±2σ | reading |
|---|---|---|---|---|
| 0 | 1.45 | 1.48 | 1.90 | 1.64 |
| 12 | 1.13 | 0.74 | 1.88 | n/a |
| 24 | -1.37 | -0.73 | 1.88 | n/a |
| 36 | 0.80 | -0.90 | 1.71 | -0.58 |
| 48 | 3.14 | 3.46 | 1.37 | 2.65 |
| 60 | 0.20 | 0.52 | 1.44 | -0.68 |
The Bayes filter
The full probabilistic answer starts with a belief: not a guess at the state, but a probability distribution over it, . Two alternating steps keep the belief current Thrun 2005.
The predict step pushes the belief through the process model. Given the control , the distribution over the new state convolves yesterday's belief with the motion's uncertainty:
Prediction only ever smears the belief outward, because motion adds uncertainty. The update step then folds in the measurement through the sensor model , sharpening the belief where the measurement says the state is likely:
with the normalizer. Predict, update, repeat: that alternation is the Bayes filter, and every tractable estimator in robotics is this recursion under extra assumptions that make the integral computable Thrun 2005.
The Kalman filter
Kalman's 1960 result is the case where the recursion collapses into matrix algebra Kalman 1960. The Kalman filter assumes the process and measurement models are linear and every noise term is Gaussian:
with and . Under those assumptions a Gaussian belief stays Gaussian forever, and the whole recursion reduces to tracking its mean and covariance. Predict:
Update, through the Kalman gain :
The gain is the whole idea in one ratio: prior uncertainty over prior-plus-sensor uncertainty. A filter that trusts its model gets a small gain and mostly ignores the sensor; a filter that trusts its sensor gets a gain near one and jumps to the reading. Under the linear-Gaussian assumptions this recursion is the minimum-variance estimator outright, and Kalman's projection-based derivation still makes it the best linear estimator when the noise is merely white rather than Gaussian Kalman 1960.
McGee and Schmidt's November 1985 NASA history credits Schmidt's Ames group with adapting Kalman's linear filter to nonlinear circumlunar navigation in the early 1960s. By early 1961, their simulations supported the approach, but operation on available flight computers had not yet been verified. The report distinguishes this work from Battin's Apollo navigation studies at MIT and Potter's square-root implementation used in Apollo. It also records the decision to use ground radar for primary Apollo navigation, with an onboard backup. This is the participants' retrospective account, not a claim that Ames alone engineered the flight system
McGee 1985.
That is what the lab at the top of this module is showing. The near-black trace is the truth, the gray dots are the readings, the blue trace is the estimate, and the band is the filter's own position uncertainty. The world's noise is fixed by the seed in the readout; the sliders set what the filter believes about the noise, and the defaults are matched to the truth. Raising drops the gain, and raising climbs it: the band then swells across each measurement gap, the predict-update sawtooth made visible.
One more thing to notice: the band is a claim the filter makes about itself. Set the sliders too low for the world it actually lives in and the estimate draws a narrow band that the truth keeps escaping. An overconfident filter is worse than no filter, because nothing downstream knows to distrust it.
The extended Kalman filter
Real robots are not linear. Joint angles enter through sines and cosines, range sensors see a nonlinear slice of the world, and the process model becomes with measurements . The extended Kalman filter keeps the Gaussian belief and makes the recursion local: linearize both models about the current estimate using their Jacobians and , then propagate the covariance through the tangent system Thrun 2005:
The mean moves through the true nonlinear maps and ; only the covariance takes the linearized route. In McGee and Schmidt's history, the Ames group moved from linearization about a nominal reference trajectory to relinearization about the current estimated state. They thought this "might offer substantial advantages". An accidentally off-nominal simulation converged after initial overshoots; the report calls this modification the extended Kalman filter. That example was not a general convergence guarantee: the report also discusses instability from round-off, inadequate statistical models and nonlinearities
McGee 1985.
The failure mode is baked into that construction. Linearization is valid near the estimate, and the estimate is exactly what you are unsure about. When the nonlinearity is strong over the region the covariance covers, the propagated stops describing the true error: the filter grows overconfident, the covariance and the actual error part ways, and the estimate can diverge. Reasoning about the covariance structure of spatial estimates is where the robotics community learned these lessons, in the work of Smith, Self, and Cheeseman on uncertain spatial relationships Smith 1990. The standard escapes are to keep the Gaussian but drop the analytic linearization, pushing a few deterministically chosen sample points through the true nonlinearity instead, which is the unscented Kalman filter of Julier and Uhlmann Julier 1997, or to drop the Gaussian assumption entirely and carry the belief as a set of particles Thrun 2005.
Factor graphs: keep the whole trajectory
In EKF-based SLAM, marginalizing old poses commits their linearized information to a Gaussian approximation; the filter cannot later relinearize those discarded pose variables. Full smoothing retains the trajectory and can revisit its linearization, but this does not guarantee that nonlinear optimization reaches the global minimum Dellaert 2006Cadena 2016. Keep the entire trajectory as the thing being estimated, and write the posterior over it as a product of factors, one per measurement and one per motion constraint:
That factorization, drawn as a bipartite graph of variable nodes and factor nodes, is a factor graph, and Kschischang, Frey, and Loeliger's 2001 paper is the reference that unified the inference algorithms on such graphs under the sum-product algorithm Kschischang 2001. With Gaussian factors, maximizing the posterior is one sparse nonlinear least-squares problem over the whole trajectory at once:
Dellaert and Kaess's 2006 Square Root SAM formulation jointly estimates the SLAM trajectory and landmark map. With known data associations, Gaussian process and measurement models, a uniform landmark prior, and the initial reference frame fixed, this gives a nonlinear least-squares problem. Nonlinear optimization solves successive linearized systems: for a full-rank system, QR acts on the measurement Jacobian, while Cholesky acts on the information matrix. Variable ordering controls fill-in and therefore the cost Dellaert 2006. iSAM made the approach incremental, updating only the part of the factorization a new measurement actually touches Kaess 2008. With Gaussian noise models, iSAM2 uses a Bayes tree for incremental nonlinear least-squares estimation, with incremental variable reordering and relinearization. An update re-eliminates the affected cliques and their ancestors, then reattaches unaffected subtrees. Changes in estimates can still propagate down the tree; relinearization and partial-update thresholds trade accuracy for computation. The update cost is not constant: large loop closures can be as expensive as a batch solution Kaess 2012. This family is what modern visual-inertial odometry and offline mapping run on: GTSAM, a BSD-licensed C++ library that implements smoothing and mapping using factor graphs and Bayes networks, powers many such systems in academia and industry Dellaert 2026; Forster and colleagues' on-manifold preintegration is what made high-rate inertial data fit the framework, collapsing anywhere from a small number to hundreds of IMU readings between two keyframes into a single preintegrated factor Forster 2017.
Cadena and colleagues describe a classical SLAM period from 1986 to 2004 that included EKF, Rao-Blackwellised particle-filter and maximum-likelihood approaches, followed by an algorithmic-analysis period from 2004 to 2015. Their survey presents MAP estimation, often expressed using factor graphs, as the de-facto standard formulation, but also highlights EKF-based systems with state-of-the-art performance. It reports a smaller filtering-versus-MAP performance gap when EKF linearization is accurate, sliding-window filters are used, and inconsistency is addressed. Graphs do not remove resource limits: the survey discusses unbounded graph growth and information-loss tradeoffs in sparsification, not a universal rule that smoothing wins Cadena 2016. What a robot then keeps from that estimate, a point cloud, a signed-distance field, a mesh, and which of those a planner can actually consume, has its own treatment in scene representation and mapping.
Where this meets the learned stack
State estimation is the layer of the classical stack that learning has penetrated least, and the reason is the honest number: a covariance you can trust is worth more than a point estimate that is usually right. Learned components mostly enter as better sensors. A learned depth model or a learned visual-odometry frontend feeds the same filter or factor graph, which keeps the uncertainty bookkeeping classical even when the measurement model is a network.
One connection is deeper than the rest. The latent-dynamics world models in the world-models module are learned state estimators in disguise: a recurrent latent state that predicts the next observation is a belief state by another name, trained end to end instead of derived. What learning changes is where the models come from; the predict-update structure underneath has survived every regime change since 1960.
With estimation in place, the classical stack closes: kinematics describes the body, planning picks the motion, control executes it, and estimation tells all three what actually happened.
Timing is part of the state
Many apparent estimator failures begin before the filter. A camera exposure, encoder reading and inertial sample that carry the same receipt time may describe different physical instants. Feeding them into a precise model creates a confident estimate of a state that never existed. Clock offset, transport delay and rolling-shutter timing belong in the measurement contract beside frame and covariance.
Test the pipeline in that order: verify clock domains and timestamp monotonicity, measure sensor latency, validate transforms, then tune process and measurement noise. Replay a recorded motion and inspect innovations by sensor; persistent directional residuals suggest calibration or timing bias rather than random noise. The calibration guide covers spatial and temporal residuals, while the ROS 2 guide covers timestamped message and transform interfaces. A larger covariance can express uncertainty. It cannot repair misassociated time.
See also
- Robot Calibration
Camera intrinsics, hand-eye transforms, kinematic zeroes, timing and dynamics: the measurements that make sensor coordinates agree with motion.
- ROS 2 for Machine Learning Engineers
Topics, services, actions, QoS, tf2, rosbag2 and MoveIt explained as the production boundary around a learned policy.
- Perception for Manipulation
Calibration through 6-DoF pose: the pipeline that finds the object, and its error budget.
- Latent-Dynamics World Models
Dreamer, TD-MPC2, and DayDreamer: compact learned dynamics for imagination-based control.
Linked from
- Robot Learning Curriculum for ML Engineers
A dependency-aware route from supervised learning to real robot policies, with the minimum robotics stack each stage assumes.
- Control
PID, LQR, MPC, and whole-body QP: the classical stack under every learned policy.
- Perception for Manipulation
Calibration through 6-DoF pose: the pipeline that finds the object, and its error budget.
- Scene Representation and Mapping
What a robot remembers about the space around it, and why the map that renders best is not the map a planner can use.
- Robot Calibration
Camera intrinsics, hand-eye transforms, kinematic zeroes, timing and dynamics: the measurements that make sensor coordinates agree with motion.
- Drones and Aerial Robotics
Autonomous flight, aggressive maneuvers, and swarm coordination.
References
R. E. Kalman, J. Basic Engineering, 1960.
https://doi.org/10.1115/1.3662552
Leonard A. McGee, Stanley F. Schmidt, NASA TM-86847, 1985.
https://ntrs.nasa.gov/citations/19860003843
Sebastian Thrun, Wolfram Burgard, Dieter Fox, MIT Press, 2005.
https://mitpress.mit.edu/9780262201629/probabilistic-robotics/
Randall C. Smith, Matthew Self, Peter Cheeseman, Autonomous Robot Vehicles, 1990.
https://doi.org/10.1007/978-1-4613-8997-2_14
Simon J. Julier, Jeffrey K. Uhlmann, Proc. SPIE 3068, 1997.
https://doi.org/10.1117/12.280797
Frank R. Kschischang, Brendan J. Frey, Hans-Andrea Loeliger, IEEE Trans. Information Theory, 2001.
https://doi.org/10.1109/18.910572
Frank Dellaert, Michael Kaess, Int. J. Robotics Research, 2006.
https://doi.org/10.1177/0278364906072768
Michael Kaess, Ananth Ranganathan, Frank Dellaert, IEEE Trans. Robotics, 2008.
https://doi.org/10.1109/TRO.2008.2006706
Michael Kaess, Hordur Johannsson, Richard Roberts, Viorela Ila, John J. Leonard, Frank Dellaert, Int. J. Robotics Research, 2012.
https://doi.org/10.1177/0278364911430419
Cesar Cadena, Luca Carlone, Henry Carrillo, Yasir Latif, Davide Scaramuzza, José Neira, Ian Reid, John J. Leonard, IEEE Transactions on Robotics, 2016.
https://arxiv.org/abs/1606.05830
Christian Forster, Luca Carlone, Frank Dellaert, Davide Scaramuzza, IEEE Trans. Robotics, 2017.
https://arxiv.org/abs/1512.02363
Frank Dellaert, GTSAM Contributors, 2026.
https://gtsam.org/
Spot a factual error or missing qualification? Report a content correction.