Quaternion estimator algorithm

From testwiki
Revision as of 04:24, 22 July 2024 by imported>OAbot (Open access bot: hdl updated in citation with #oabot.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description The quaternion estimator algorithm (QUEST) is an algorithm designed to solve Wahba's problem, that consists of finding a rotation matrix between two coordinate systems from two sets of observations sampled in each system respectively. The key idea behind the algorithm is to find an expression of the loss function for the Wahba's problem as a quadratic form, using the Cayley–Hamilton theorem and the Newton–Raphson method to efficiently solve the eigenvalue problem and construct a numerically stable representation of the solution.

The algorithm was introduced by Malcolm D. Shuster in 1981, while working at Computer Sciences Corporation.[1] While being in principle less robust than other methods such as Davenport's q method or singular value decomposition, the algorithm is significantly faster and reliable in practical applications,[2][3] and it is used for attitude determination problem in fields such as robotics and avionics.[4][5][6]

Formulation of the problem

Wahba's problem consists of finding a rotation matrix 𝐀* that minimises the loss function

l(𝐀)=12i=1nai𝐰i𝐀𝐯i2

where 𝐰i are the vector observations in the reference frame, 𝐯i are the vector observations in the body frame, 𝐀 is a rotation matrix between the two frames, and ai are a set of weights such that iai=1. It is possible to rewrite this as a maximisation problem of a gain function g

g(𝐀)=1l(𝐀)=iai𝐰i𝐀𝐯i

defined in such a way that the loss l attains a minimum when g is maximised. The gain g can in turn be rewritten as

g(𝐀)=tr(𝐀𝐁)

where 𝐁=iai𝐰i𝐯i is known as the attitude profile matrix.

In order to reduce the number of variables, the problem can be reformulated by parametrising the rotation as a unit quaternion 𝐪=(v1,v2,v3,q) with vector part 𝐯=(v1,v2,v3) and scalar part q, representing the rotation of angle θ=2cos1q around an axis whose direction is described by the vector 1sinθ2𝐯, subject to the unity constraint 𝐪𝐪=1. It is now possible to express 𝐀 in terms of the quaternion parametrisation as

𝐀=(q2𝐯𝐯)𝐈+2𝐯𝐯+2q𝐕×

where 𝐕× is the skew-symmetric matrix

𝐕×=(0v3v2v30v1v2v10).

Substituting 𝐀 with the quaternion representation and simplifying the resulting expression, the gain function can be written as a quadratic form in 𝐪

g(𝐪)=𝐪𝐊𝐪

where the 4×4 matrix

𝐊=(𝐒σ𝐈𝐳𝐳σ)

is defined from the quantities

𝐒=𝐁+𝐁𝐳=iai(𝐰i×𝐯i)σ=tr𝐁.

This quadratic form can be optimised under the unity constraint by adding a Lagrange multiplier λ𝐪𝐪, obtaining an unconstrained gain function

g^(𝐪)=𝐪𝐊𝐪λ𝐪𝐪

that attains a maximum when

𝐊𝐪=λ𝐪.

This implies that the optimal rotation is parametrised by the quaternion 𝐪* that is the eigenvector associated to the largest eigenvalue λmax of 𝐊.[1][2]

Solution of the characteristic equation

The optimal quaternion can be determined by solving the characteristic equation of 𝐊 and constructing the eigenvector for the largest eigenvalue. From the definition of 𝐊, it is possible to rewrite

𝐊𝐪=λ𝐪

as a system of two equations

𝐲=((λ+σ)𝐈𝐒)1𝐳λ=σ+𝐳𝐲

where 𝐲=1q𝐯 is the Rodrigues vector. Substituting 𝐲 in the second equation with the first, it is possible to derive an expression of the characteristic equation

λ=σ+𝐳((λ+σ)𝐈𝐒)1𝐳.

Since λmax=maxg(𝐀), it follows that λmax=1minl(𝐀) and therefore λmax1 for an optimal solution (when the loss l is small). This permits to construct the optimal quaternion 𝐪* by replacing λmax in the Rodrigues vector 𝐲

𝐪*=11+|𝐲λmax|2(𝐲,1).

The 𝐲 vector is however singular for θ=π. An alternative expression of the solution that does not involve the Rodrigues vector can be constructed using the Cayley–Hamilton theorem. The characteristic equation of a 3×3 matrix 𝐒 is

det[𝐒ξ𝐈]=ξ3+2σξ2kξ+Δ=0

where

σ=12tr𝐒k=tr(adj𝐒)Δ=det𝐒

The Cayley–Hamilton theorem states that any square matrix over a commutative ring satisfies its own characteristic equation, therefore

𝐒3+2σ𝐒2k𝐒+Δ=0

allowing to write

((ω+σ)𝐈𝐒)1=α𝐈+β𝐒+𝐒2γ

where

α=ω2σ2+kβ=ωσγ=(ω+σ)αΔ

and for ω=λmax this provides a new construction of the optimal vector

𝐲*=((λ+σ)𝐈𝐒)1𝐳=α𝐈+β𝐒+𝐒2γ𝐳

that gives the conjugate quaternion representation of the optimal rotation as

𝐪*=1γ2+|𝐱|2(𝐱,γ)

where

𝐱=(α𝐈+β𝐒+𝐒2)𝐳.

The value of λmax can be determined as a numerical solution of the characteristic equation. Replacing ((ω+σ)𝐈𝐒)1 inside the previously obtained characteristic equation

λ=σ+𝐳((λ+σ)𝐈𝐒)1𝐳.

gives

λ4(a+b)λ2cλ+(ab+cσd)=0

where

a=σ2kb=σ2+𝐳𝐳c=Δ+𝐳𝐒𝐳d=𝐳𝐒2𝐳

whose root can be efficiently approximated with the Newton–Raphson method, taking 1 as initial guess of the solution in order to converge to the highest eigenvalue (using the fact, shown above, that λmax1 when the quaternion is close to the optimal solution).[1][2]

See also

References

  1. 1.0 1.1 1.2 Shuster and Oh (1981)
  2. 2.0 2.1 2.2 Markley and Mortari (2000)
  3. Crassidis (2007)
  4. Psiaki (2000)
  5. Wu et al. (2017)
  6. Xiaoping et al. (2008)

Sources