Express relative pose locally
Subtract the two world positions and rotate that displacement into the source pose’s frame. Subtract source heading from target heading, wrapping the result around ±π.
13 / POSE-GRAPH SLAM · LOOP CLOSURE
A drone has already completed a circular survey. Its pose graph holds 25 historical poses linked by noisy relative-motion constraints. A supplied loop closure relates two visits. Gauss–Newton optimization adjusts the estimated past trajectory to fit those measurements together.
Predict: a loop is attached to the wrong historical pose. Can the optimizer reduce its mathematical cost while making the reconstructed path less accurate?
A SLAM back end estimates recorded planar poses by minimizing a weighted sum of squared relative-pose residuals. Gauss–Newton uses local Jacobians and a backtracking line search.
Each pose contains x, y and heading. The first pose [4, 0, π/2] removes the free global translation and rotation. The remaining 72 coordinates are optimized jointly.
Relative translations are expressed in the source pose’s local frame. Loop identities are supplied: correct 0 → 24, or deliberately wrong 0 → 18 using the same measurement.
The 24-second survey and noisy measurements stay fixed. Optimizer iterations revise historical estimates; they are not flight ticks. Detailed 3D geometry illustrates planar poses at a fixed 2 m display height.
Input versus evaluator: the optimizer receives measured edges, their declared weights and the fixed first pose. True poses, trajectory error and the knowledge that a loop is wrong belong to the evaluator. No automatic place recognition or outlier rejection is implemented.
THE SURVEY IS RECORDED · NOW OPTIMIZE ITS GRAPH
Green: current estimate. Amber: initial odometry. Arrows show the correction from the initial estimate.
Largest position change: 0 m
Drag to orbit · scroll to zoom · Focus selected pose for a closer view. The single solid drone marks one recorded true pose; graph markers are historical estimates, not other drones.
INSPECT A HISTORICAL POSE
Selection moves the inspection marker along an already recorded survey. It neither runs the optimizer nor records another flight. Optimizer iterations can revise all 24 unfixed poses together.
Pose 0 is fixed exactly. The displayed solid drone uses the selected true historical pose; its estimated counterpart and initial odometry position can differ. Only the anchor is supplied as exact world information.
| Pose | x / m | y / m | Heading / ° |
|---|
INSPECT ONE MEASURED CONSTRAINT
Translation measurements and residuals use the source pose’s local axes. The angular residual is wrapped to ±π. Whitened components divide by their declared standard deviations; the displayed contribution is their squared sum.
| Edge | From → to | Kind | Weighted cost |
|---|
LATEST SOLVER STEP
Largest current position correction from initial odometry: 0.000 m.
| Pose | Δx / m | Δy / m | Δheading / ° |
|---|
| Step fraction α | Trial cost | Armijo bound | Cost − bound | Accepted |
|---|
OPTIMIZATION HISTORY / SAME GRAPH
The objective uses measured constraints. Trajectory RMSE uses evaluator truth. A wrong loop can improve the objective while distorting the path. Before / After changes the scene only; these histories and all inspectors retain the computed result. Costs from different association scenarios minimize different graphs and are not an accuracy ranking.
PREDICT · COMPARE · EXPLAIN
Compare integrated odometry alone, the supplied correct loop, and the same measurement attached to a wrong historical pose. Keep the seed fixed; inspect both residuals and physical trajectory error.
Independent optimization copies use seed 7, the same recorded survey and declared stop conditions. Opening these results leaves the active graph and selection unchanged.
| Association | Stop condition | Iterations | Graph cost | Trajectory RMSE / m | Endpoint / m |
|---|
POSE-GRAPH SLAM / WEIGHTED LEAST SQUARES
The previous EKF-SLAM workshop updated a current pose and landmark map. Here the unknowns are historical robot poses. Their relative constraints connect a recorded trajectory, and an iteration can adjust past estimates across the whole graph.
This is the optimization back end of a small pose-graph SLAM example. Detecting a revisit and deciding which poses correspond are separate front-end problems, supplied directly in this lesson.
Subtract the two world positions and rotate that displacement into the source pose’s frame. Subtract source heading from target heading, wrapping the result around ±π.
Compare the predicted relative pose with the fixed measured edge. Scale translation and angle by their sensor standard deviations, then sum squared components across edges.
Linearize residuals, solve the anchored normal equations and propose a joint pose increment. A backtracking line search checks the actual nonlinear cost before accepting a step.
A wrong loop still contributes a weighted residual. Without a robust loss or outlier detector, the optimizer tries to satisfy it. Numerical convergence does not validate the data association.
The initial poses are integrated from the same odometry edges. An open chain can therefore have near-zero residual cost even though noise has displaced it from the true path. Another measurement adds information; a low objective alone does not.
The page shows residuals, corrections and errors. It does not interpret the Hessian as a calibrated posterior covariance, perform marginalization, optimize landmarks, recover missed loop associations or guarantee a global minimum.
Primary method context: Grisetti, Kümmerle, Stachniss and Burgard — A Tutorial on Graph-Based SLAM. This educational implementation uses a supplied planar relative-pose graph, one fixed anchor and a small dense Gauss–Newton solver with backtracking. It is not a complete visual, LiDAR or multi-robot SLAM pipeline.