Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Certifiable Rotation Averaging on SO(2)

This notebook builds a small, self-contained rotation ring and solves it with GTSAM’s Burer–Monteiro Riemannian Staircase. It then solves the corresponding gauge-fixed QCQP with both the monolithic and chordal MOSEK-backed SDP formulations.

Open In Colab

A consistent rotation ring

For every directed edge (i,j)(i,j) we measure Rij=Ri⊤RjR_{ij}=R_i^\top R_j and minimize the Frobenius residual ∥RiRij−Rj∥F2\lVert R_iR_{ij}-R_j\rVert_F^2. The measurements below form an exact ring, while the initial rotations receive deterministic random perturbations. Because the objective is unchanged by one common left rotation, we remove that gauge only when comparing against ground truth.

8 relative-rotation factors, 8 variables

Run the Riemannian Staircase

At every rank, an augmented-Lagrangian solve finds a stationary point. The certificate matrix is then tested for positive semidefiniteness. A negative eigenvalue triggers a lift to the next rank; otherwise the relaxation is certified.

Certified: True
Final rank: 2
Certificate lower bound / minimum eigenvalue: -1.000e-03
Solver time: 0.000 s; notebook wall time: 0.001 s

Round and gauge-align the certified solution

roundedValues() returns one 2×22\times2 QCQP matrix Xi=Ri⊤X_i=R_i^\top per key. A single column-sign correction handles the common O(2)O(2) reflection ambiguity, SVD projects each transposed block to SO(2)SO(2), and one common left rotation aligns the result with the chosen ground-truth gauge.

Maximum initial error: 28.434 deg
Maximum rounded error: 2.544e-14 deg
<Figure size 1200x400 with 2 Axes>
<Figure size 1300x350 with 3 Axes>

Solve the lifted SDP with MOSEK

The staircase above does not require a commercial solver. The next two approaches use GTSAM’s optional MOSEK wrappers and therefore require a GTSAM build with GTSAM_WITH_MOSEK=ON and a valid MOSEK license.

For the explicit SDP formulations, we remove the global rotation gauge by fixing R0=IR_0=I with a hard Frobenius prior. The remaining ring factors are unchanged.

Gauge-fixed QCQP with 9 factors

Monolithic SDP

MosekMonolithicSDP places the complete lifted matrix in one positive-semidefinite cone.

Status: ProblemStatus::PrimalAndDualFeasible
Objective: 2.90223e-12
MOSEK time: 0.010 s
Maximum Rot2 error: 2.322e-12

Chordal SDP

MosekChordalSDP uses a symbolic elimination ordering to replace the single cone with smaller clique cones. Here COLAMD selects the ordering, and the resulting Bayes tree exposes the decomposition.

Status: ProblemStatus::PrimalAndDualFeasible
Objective: 5.36193e-12
MOSEK time: 0.013 s
Bayes-tree cliques: 6
Maximum Rot2 error: 7.997e-12

The Riemannian Staircase certifies the relaxation without a commercial solver, while the two optional MOSEK paths solve the gauge-fixed relaxation directly. The monolithic formulation uses one PSD cone; the chordal formulation uses the Bayes-tree cliques to split it into smaller cones.