wikillm

Concept · 4 papers · updated 2026-10-18

Unit-quaternion rotation

A unit quaternion q represents a 3D rotation as q v q-bar. The papers use it in different roles: the unknown of a closed-form fit to vector pairs (smallest eigenvector of a 4x4 matrix), of a penalised non-linear fit with translation, or of a dual-quaternion pose fit solved by a trust region; or a network output renormalised after each step. Author-reported results do not compare across roles.

quaternionsrotationoptimization

Markdown7 min read

AI-compiled overview, updated 2026-10-18, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

Overview

A unit quaternion q, with q-bar its conjugate, rotates a 3-vector v to q v q-bar 2311.12655 §5.1. Given pairs of vectors (v, v'), the task is to find the unit q that makes v' close to q v q-bar. The residual is ||v' - q v q-bar||^2 2311.12655 §5.1. The unit-length condition is the part that makes the problem non-trivial: the residual rewrites as a quadratic form only when q has unit length 2311.12655 app. B.

The papers use the quaternion in different roles. In hand-eye calibration it is the unknown of a fitting problem 2311.12655 §4 §5. In motion synthesis it is a per-joint pose output that a network renormalises 2102.04942 §3.1 §3.2. In a LiDAR-inertial-visual estimator the rotation is a filter state updated on a manifold, and the card does not show a unit quaternion for it 2102.12400 §IV-A. In 2-D to 3-D object pose, the unit quaternion is the real part of a dual-number quaternion that also carries the translation 2610.19734 §2.1.

Variants

Three solvers fit a unit quaternion to data. They differ in how the unit-length condition is handled: exactly by construction in the closed form, and by a penalty in the two non-linear fits. A fourth use treats the quaternion as a network output.

Closed form: smallest eigenvector

The residual over all pairs becomes q^T A q, where A is a 4x4 symmetric matrix. It is the sum of (Q(v') - W(v))^T (Q(v') - W(v)) over the pairs, with Q and W the left and right quaternion-product matrices 2311.12655 §5.1 eq. 29 app. A. The minimising unit q is the eigenvector of A for its smallest eigenvalue 2311.12655 §5.1. The eigenvector is defined only up to sign, and q and -q give the same rotation 2311.12655 §5.1.

The rewrite to q^T A q multiplies the residual by ||q||^2 and then drops that factor. This is exact only for unit q 2311.12655 §5.1 app. B. The closed form does not add a penalty; the paper gives the penalty only for the joint method 2311.12655 §5.2. The paper credits the closed-form rotation to Faugeras and Hebert (1986) and to Horn (1987). Those works are named only here 2311.12655 §5.1 app. A.

Card: Hand-Eye Calibration.

Joint penalised non-linear

The unit quaternion is one of seven unknowns, with the translation. The cost adds a penalty λ(1 - q^T q)^2 that keeps q near unit length 2311.12655 §5.2 eq. 30. The paper sets λ = 2 × 10^6 in all its experiments 2311.12655 §5.2. The minimisation uses Levenberg-Marquardt, and the paper says a trust-region method would also suit it [arxiv:2311.12655 §5.2]. The starting value q0 is not stated, and the stopping rule is not stated 2311.12655 §5.2.

Because the penalty only encourages unit length, the optimiser's q is not guaranteed to be unit length. The paper keeps q near unit length only through this penalty 2311.12655 §5.2 eq. 30 eq. 31.

Card: Hand-Eye Calibration.

Dual-quaternion pose, penalised, trust region

Here the unit quaternion is the real part r of a dual-number quaternion r + ε s, with ε² = 0. The rotation is read from r, and the translation from s 2610.19734 §2.1 eq. 6 eq. 7. The constraints are r·r = 1 and r·s = 0 2610.19734 §2.1. Both are enforced by penalties, with λ(r·r − 1)² and λ(r·s)², and λ = 50 in the experiments 2610.19734 §2.2 eq. 13. The paper says a too-large λ slows convergence 2610.19734 §2.2. Its λ is not comparable to the 2 × 10^6 used in the joint solver above (see Contradictions).

The minimiser is a trust-region method. The paper names Levenberg-Marquardt as the alternative and says it is poorly conditioned when its damping is near zero 2610.19734 §4.2. A split variant first minimises a rotation-only error in r eq. 14, then solves a linear least-squares problem for s eq. 15 2610.19734 §2.2. The paper does not say whether r is re-estimated jointly with s afterwards 2610.19734 §2.2. The initial pose and the trust radius are not stated 2610.19734 §4.1. The paper does not state the residual vector for the penalty terms 2610.19734 §4. It does not discuss that r and −r give the same rotation 2610.19734 §2.1.

Card: Dual-quaternion object pose.

Normalised network output

Robust Motion In-betweening stores each joint's rotation as a quaternion of 4 values 2102.04942 §3.1. Its generator predicts quaternion velocities, adds them to the state, and then normalises the quaternions to unit length before forward kinematics 2102.04942 §3.2. Here unit length is enforced by a projection after each step, not by a penalty. The paper does not state how the velocity is added to the previous quaternion 2102.04942 §3.2. The paper does not discuss the sign ambiguity (q and -q are the same rotation) in its losses 2102.04942 §3.6.1.

Card: Robust Motion In-betweening.

When to use which

Pick by where the rotation lives: an unknown in a one-off fit, a network output that must stay valid, or a filter state updated on each sensor event.

SituationUseWhy
No starting guess is available, or a single non-iterative solve is neededClosed formIt needs no q0. The closed-form rotation-then-translation method takes 0.06 to 0.08 s on the paper's third data set, on a Sparc-10 2311.12655 tab. 3.
Noisy measurements, a few motions, and an iterative solve is affordableJoint penalisedIn simulation with two motions and 1% to 6% noise, it is the most accurate in all reported settings 2311.12655 §6. On the third data set it takes 0.21 to 0.25 s 2311.12655 tab. 3.
Pose of a known 3-D object from 2-D point or line matches, with a trust-region solver affordableDual-quaternion, penalised, trust regionAuthor-reported: with 100 points and noise amplitude 1.00 (pixels, per the table caption), translation error is 0.0002 cm, against 11.4770 cm for the linear Faugeras-Toscani method 2610.19734 tab. 2 tab. 8. The paper gives no Levenberg-Marquardt or Newton numbers 2610.19734 §4.2 §6. It reports 4.83 s for 460 points, and the hardware of that table is not stated 2610.19734 tab. 7.
Rotation error is the main concern on real dataCheck per data setOn the third data set, classical Tsai-Lenz has the lowest rotation error (0.014). The closed form has 0.036 and the joint method 0.258 2311.12655 tab. 3. The paper says linear methods can give better rotation on real data 2311.12655 §7.
A learned model outputs rotations that must be valid after every stepNormalised outputThe paper renormalises each predicted quaternion before forward kinematics 2102.04942 §3.2. The card's result tables do not isolate this step.
A filter tracks orientation between sensor eventsManifold updateThe error state is 21-dimensional and updated on the tangent space 2102.12400 §IV-A. The paper runs the IMU propagation at IMU rate and corrects it at LiDAR and camera frames 2102.12400 §IV-I.

The paper's results are author-reported. Its simulations use a 157 mm nominal translation norm for normalisation, and its real data sets are three robot setups 2311.12655 §6 §7. The rankings above come from those setups and do not transfer to other robots without a test.

Implementation sketch

The closed-form rotation and the joint cost share the same residual. The pseudocode below gives the rotation part only. The joint cost in the paper also has translation residuals, which the hand-eye calibration concept page covers.

Pseudocode
# Closed-form unit quaternion from vector pairs  [arxiv:2311.12655 §5.1]
# Input:  pairs v[i], v_prime[i] of 3-vectors, with v_prime ~ q v q-bar
# Output: unit quaternion q, defined up to sign

def closed_form_rotation(v, v_prime):
    # 1. Sum the 4x4 symmetric matrices  [eq. 29]
    A = zeros(4, 4)
    for i in range(len(v)):
        # Q, W: left and right quaternion-product matrices  [app. A]
        D = Q(v_prime[i]) - W(v[i])
        A = A + transpose(D) @ D
    # 2. Eigenvector of A for its smallest eigenvalue  [§5.1]
    return smallest_eigenvector(A)
Pseudocode
# Joint penalised rotation fit  [arxiv:2311.12655 §5.2]  [eq. 30]
# Input:  pairs as above, starting value q0 (not stated in the paper)
# Output: quaternion q, unit length only approximately

def joint_rotation(v, v_prime, q0):
    def cost(q):
        total = 0
        for i in range(len(v)):
            # rotation residual, weight lambda_1 = 1  [§5.2]
            total += norm2(v_prime[i] - rotate(q, v[i]))
        # penalty towards unit length, lambda = 2e6  [§5.2]
        total += 2e6 * (1 - dot(q, q)) ** 2
        return total
    # Levenberg-Marquardt  [§5.2]
    return levenberg_marquardt(cost, q0)
Pseudocode
# Renormalise a predicted quaternion after an update  [arxiv:2102.04942 §3.2]
# Input:  q, the quaternion after adding the predicted velocity
# Output: the same rotation direction with unit length

def normalize_unit(q):
    # Divide by the norm; the paper's exact integration rule is not stated
    return q / norm(q)

Here rotate(q, x) is q x q-bar 2311.12655 app. A.

Contradictions

No direct disagreement across papers. The papers use the quaternion in different roles and report different quantities, so their numbers do not compare.

The penalty weights differ by orders of magnitude: 2 × 10^6 on (1 − q^T q)^2 for the joint hand-eye solver 2311.12655 §5.2, and 50 on (r·r − 1)^2 for the dual-quaternion pose solver 2610.19734 §2.2. The two penalties sit on different residuals, and the second also has an orthogonality term, so the weights are not interchangeable.

Within one paper: the text says the joint non-linear method gives "sometimes slightly less accurate rotation" on real data 2311.12655 §7. In 2311.12655 tab. 3, the classical joint method has a rotation error of 0.258, against 0.014 for the classical Tsai-Lenz baseline. The paper does not comment on this gap.

Papers

  • Hand-Eye Calibration: a closed-form unit-quaternion rotation solver and a joint penalised non-linear solver, applied to hand-eye calibration.
  • Robust Motion In-betweening: unit quaternions as the per-joint pose output of a generator, renormalised to unit length.
  • R2LIVE: an error-state filter that updates orientation on the manifold. The card lists this concept, but the rotation is not written as a unit quaternion there.
  • Dual-quaternion object pose: a dual-number quaternion pose fit from point and line correspondences, with a penalised unit-length term and a trust-region solver.

Source and license

Compiled from the papers listed on this page, all published under CC BY, CC BY-SA or CC0, with citations. See each paper's page for its authors and license.