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.

WahbaFactor

WahbaFactor estimates a Rot3 from a direction correspondence using the classical three-dimensional chordal Wahba residual. The factor stores both directions as Unit3, supports full three-dimensional Gaussian weighting, and provides an exact D=1 QCQP conversion.

Open In Colab

Chordal direction alignment

We use the convention that RbaR^a_b rotates coordinates from frame bb into frame aa. Given a known bDirection and its measured_aDirection, the unwhitened residual is

e(Rba)=Rbadb−d~a.e(R^a_b)=R^a_b d^b-\widetilde{d}^a.

The residual is a three-vector formed from the two unit vectors in R3\mathbb{R}^3. It is not Unit3::errorVector. This distinction determines both the likelihood and the algebraic structure: the chordal residual is affine in the nine entries of the rotation matrix.

three-dimensional chordal residual: [ 0.00244182 -0.01033505 -0.01540794]
weighted factor cost: 0.000405312

Relation to RotateDirectionsFactor

RotateDirectionsFactor represents the same geometric correspondence with a two-dimensional tangent-space residual on Unit3. It therefore takes a two-dimensional noise model and defines a different nonlinear likelihood. WahbaFactor takes a three-dimensional noise model and minimizes Euclidean chord length. The two residuals both vanish at an exact correspondence, but they are not interchangeable away from it.

WahbaFactor residual dimension:           3
RotateDirectionsFactor residual dimension: 2

Exact D=1 QCQP conversion

With x=vec⁡(Rba)x=\operatorname{vec}(R^a_b), every whitened residual is affine, Bx−cBx-c, so its squared norm is the exact quadratic 12xTBTBx−cTBx+12cTc\tfrac12x^{\mathsf T}B^{\mathsf T}Bx-c^{\mathsf T}Bx+\tfrac12c^{\mathsf T}c. QcqpProblem(graph, 1) combines that cost with the quadratic constraints defining Rot3. No measurement linearization is introduced.

The factor rejects matrix-valued QCQP column dimensions, null cost graphs, robust noise, and constrained noise because those cases do not represent the supported finite quadratic objective.

nonlinear cost:          0.000405312
QCQP cost:               0.000405312
equality violation:      2.282e-17
inequality violation:    0.000e+00