Manifold Optimization

Camera poses are elements of the Lie group , which is a 6-dimensional smooth manifold — not a Euclidean space. Laser plane normals live on the unit sphere . Optimizing these parameters with standard Euclidean updates (adding to the parameter vector) would violate the manifold constraints: rotations would become non-orthogonal, quaternions would lose unit norm, and normals would lose unit length.

Manifold optimization solves this by computing updates in the tangent space and then retracting back to the manifold.

The Retract-Update Pattern

For a parameter on a manifold :

  1. Compute update in the tangent space (a Euclidean space of dimension equal to the manifold's degrees of freedom)
  2. Retract: where maps from tangent space back to the manifold

This is also called local parameterization: the optimizer sees a Euclidean space of the correct dimension, and the manifold structure handles the constraint.

SE(3): Rigid Transforms

Ambient dimension: 7 (quaternion + translation )

Tangent dimension: 6 ()

Plus operation (): Given current pose and tangent vector :

where is the SE(3) exponential map (see Rigid Transformations):

Minus operation (): The inverse — compute the tangent vector between two poses — uses the SE(3) logarithm.

Implementation in calibration-rs

The se3_exp function in the factor module computes the exponential map generically over RealField for autodiff compatibility:

#![allow(unused)]
fn main() {
fn se3_exp<T: RealField>(xi: &[T; 6]) -> [[T; 4]; 4]
}

This uses Rodrigues' formula with special handling for the small-angle case () to avoid division by zero.

SO(3): Rotations

Ambient dimension: 4 (unit quaternion)

Tangent dimension: 3 (axis-angle )

Plus operation:

SO(3) is used for rotation-only parameters. In calibration-rs, most poses use the full SE(3), but SO(3) is available for specialized problems.

: Unit Sphere

Ambient dimension: 3 (unit vector , )

Tangent dimension: 2 ()

The manifold is used for laser plane normals — 3D unit vectors with 2 degrees of freedom.

Plus operation: Given current normal and tangent vector :

  1. Compute orthonormal basis of the tangent plane at
  2. Tangent vector in 3D:
  3. Retract:

For small , this is equivalent to the exponential map on .

Basis Construction

The tangent plane basis is constructed deterministically:

  1. Choose a reference vector not parallel to (e.g., or )
  2. , normalized

Euclidean Parameters

For intrinsics (), distortion (), and other unconstrained parameters, the manifold is simply with:

No special treatment needed.

ManifoldKind in the IR

The optimization IR specifies the manifold for each parameter block:

#![allow(unused)]
fn main() {
pub enum ManifoldKind {
    Euclidean,  // R^n, standard addition
    SE3,        // 7D ambient, 6D tangent
    SO3,        // 4D ambient, 3D tangent
    S2,         // 3D ambient, 2D tangent
}
}

The backend maps these to solver-specific manifold implementations.

Fixed Parameters on Manifolds

For Euclidean parameters, individual indices can be fixed (e.g., fix but optimize ). For manifold parameters (SE3, SO3, S2), fixing is all-or-nothing: either the entire parameter block is optimized or the entire block is fixed. This is because the tangent space decomposition does not naturally support partial fixing on non-Euclidean manifolds.