Reading and display settings

Appearance

System follows your operating system and keeps following it, even if you change it later. The header's sun, moon and monitor cycle the same three options.

Text size (%) 100%

Default. Scales every text size on the site, equations and tables included.

Reading width 70ch

How much text runs across one line of prose. Narrower is easier to track; wider fits more on screen.

Line spacing 1.6

The leading on body text. Taller leading helps a tired eye stay on the line.

Density

Padding and gaps around controls, cards, and tables — how much breathing room the layout leaves itself.

Motion

System follows your operating system. Reduced removes every transition on this site. Full keeps them on unless your system asks for less.

1

The recipe

Linearize in the tangent space, retract with ⊕

🎯 Goal: state Gauss–Newton on a Lie group in four lines, and see why it beats both "optimize a parametrization" and "optimize the matrix entries, then fix them up".

To minimize $F(X) = \tfrac12\sum_i\lVert r_i(X)\rVert^2$ over a group element $X$:

$$ J_i = \frac{\partial r_i(X\oplus\delta)}{\partial\delta}\Big|_{\delta=0},\qquad \Bigl(\sum_i J_i^\top J_i + \lambda I\Bigr)\,\delta = -\sum_i J_i^\top r_i,\qquad X \leftarrow X\oplus\delta. $$

With $\lambda = 0$ this is Gauss–Newton; with $\lambda > 0$ adapted per iteration it is Levenberg–Marquardt. The linear system always has the dimension of the group (3 for a rotation, 6 for a pose), never the 9 or 12 entries of a matrix, and $\oplus$ keeps every iterate a valid rotation. The alternatives each break something. Optimizing Euler angles inherits gimbal lock: the Jacobian loses rank near $\pm90^\circ$ pitch, and the solver crawls or diverges there. Optimizing nine matrix entries and re-orthonormalizing afterwards takes steps the constraint immediately undoes. It wastes iterations, and it has no clean covariance at the end. Solvers expose the recipe as an interface: Ceres calls it a Manifold (Plus and Minus), GTSAM calls it retract and localCoordinates, and g2o calls it oplusImpl.

2

Aligning two point clouds on SE(3)

The inner loop of ICP

🎯 Goal: run Gauss–Newton on $SE(3)$ to align matched point clouds, compare with an Euler-angle parametrization near gimbal lock, and check the result against the closed-form Kabsch solution.

Given matched points $p_i$ (source) and $q_i$ (target), find the pose $T$ minimizing $\sum_i\lVert Tp_i - q_i\rVert^2$. The residual is $r_i = Tp_i - q_i$, and its right Jacobian comes straight from the table in Part 9: $J_i = [\,R\ \ -R[p_i]_\times\,]$. This is the inner loop of ICP (iterative closest point), which re-matches points between solves. With known matches there is also a closed-form answer, Kabsch's SVD method (here computed with Horn's quaternion form). Gauss–Newton on $SE(3)$ reaches it in a handful of iterations from almost any start.

Switch the solver to "Euler angles" to see what a parametrization costs. The true pose is pitched to $85^\circ$, close to gimbal lock, and the same Gauss–Newton steps on $(\psi,\theta,\phi,t)$ with a numerical Jacobian converge far more slowly, or stall.

Magenta: target points $q_i$. Blue: source points moved by the current estimate $T p_i$, with a thin line to their match. Right: $\log_{10}$ cost per iteration. Drag to orbit.

3

Averaging rotations

Geodesic mean, chordal mean, geodesic median

🎯 Goal: compute the mean of a set of rotations three ways, and see how each reacts to outliers.

Many sensors measure one orientation, or many relative measurements imply one: the best single rotation is some kind of average. The geodesic (Karcher) mean minimizes $\sum_i\lVert\operatorname{Log}(M^\top R_i)\rVert^2$. Its Gauss–Newton step is just the average of the residuals, $M\leftarrow M\oplus\tfrac1N\sum_i\operatorname{Log}(M^\top R_i)$, which is the circle's intrinsic mean from Part 1 in 3D. The chordal mean averages the matrices and projects back to $SO(3)$ (Part 1's "average then snap"). It is closed-form, and because chordal distance saturates at large angles (Part 5), a far-away outlier pulls on it only weakly. The geodesic median minimizes $\sum_i\lVert\operatorname{Log}(M^\top R_i)\rVert$ (not squared) with Weiszfeld's reweighting. Being an L1 estimator, it also shrugs off gross outliers. Add outliers and compare: the geodesic mean, whose pull grows with an outlier's distance, is dragged by more than ten degrees, while the other two stay within a few degrees.

Every rotation drawn as $\operatorname{Log}(R_{\text{true}}^\top R)$, so the truth is the centre of the ball of radius π. Gray: inliers. Magenta: outliers. Colored crosses: the three estimates. Drag to orbit.

4

A pose graph closed by one loop

Gauss–Newton on 20 poses in SE(2)

🎯 Goal: watch Gauss–Newton over many $SE(2)$ poses at once spread the error of one loop closure around a whole trajectory.

A robot drives a loop of 20 poses, integrating noisy odometry $Z_{i,i+1}$, and at the end recognizes its starting place, which gives one extra edge $Z_{19,0}$. Each edge has the residual $r_{ij} = \operatorname{Log}(Z_{ij}^{-1}X_i^{-1}X_j)\in\mathbb{R}^3$. The state is 19 free poses (the first is fixed), so each Gauss–Newton step solves a $57\times57$ system and updates every pose by $X_k\leftarrow X_k\oplus\delta_k$. The Jacobians here are numerical, for brevity. A real solver uses the analytic ones from Part 9 and exploits the sparsity: each edge touches only two poses. Dead reckoning (magenta) drifts; one step bends the whole loop back toward the truth.

truth dead reckoning (initial guess) current estimate
5

In practice

Where ⊕ goes
Always apply the update with the same ⊕ the Jacobians were derived for. Right Jacobians with a left update (or the reverse) converge slowly or not at all: a classic silent bug.
Retraction choice
Exp is the natural ⊕, but any map that agrees with it to first order works (Cayley map, $R(I+[\delta]_\times)$ followed by projection). Convergence near the optimum is unchanged; large steps differ.
Robust losses
Replace $\lVert r\rVert^2$ with Huber or Cauchy on the tangent-space residual to down-weight outliers, as the geodesic median did in section 3.
Initialization
Rotation problems are non-convex. Chordal relaxations and closed forms (Kabsch, rotation averaging) give starting points inside the basin of convergence of the refinement.
Uncertainty
At convergence, $(\sum J_i^\top J_i)^{-1}$ is the covariance of the tangent-space error $\delta$ at the optimum, which is the subject of the next part.
6

Check your understanding

0/5 answered