Quaternion estimator algorithm

From testwiki
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(𝐀)=12βˆ‘i=1nai‖𝐰iβˆ’π€π―iβ€–2

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(𝐀)=1βˆ’l(𝐀)=βˆ‘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 ΞΈ=2cosβˆ’1q 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

𝐕×=(0v3βˆ’v2βˆ’v30v1v2βˆ’v10).

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=1βˆ’minl(𝐀) and therefore Ξ»maxβ‰ˆ1 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σξ2βˆ’kΞΎ+Ξ”=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σ𝐒2βˆ’k𝐒+Ξ”=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)Ξ»2βˆ’cΞ»+(ab+cΟƒβˆ’d)=0

where

a=Οƒ2βˆ’kb=Οƒ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 Ξ»maxβ‰ˆ1 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