Quaternion estimator algorithm explained

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

A*

that minimises the loss function

l\left(A\right)=

1
2
n
\sum
i=1

ai\left\|wi-Avi\right\|2

where

wi

are the vector observations in the reference frame,

vi

are the vector observations in the body frame,

A

is a rotation matrix between the two frames, and

ai

are a set of weights such that

style\sumiai=1

. It is possible to rewrite this as a maximisation problem of a gain function

g

g\left(A\right)=1-l\left(A\right)=\sumiai

\top
w
i

Avi

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\left(A\right)=\operatorname{tr}\left(AB\top\right)

where

B=style\sumiaiwi

\top
v
i
is known as the attitude profile matrix.

q=\left(v1,v2,v3,q\right)

with vector part

v=\left(v1,v2,v3\right)

and scalar part

q

, representing the rotation of angle

\theta=2\cos-1q

around an axis whose direction is described by the vector
style1
\sin
\theta
2

v

, subject to the unity constraint

q\topq=1

. It is now possible to express

A

in terms of the quaternion parametrisation as

A=\left(q2-vv\right)I+2vv\top+2qV x

where

V x

is the skew-symmetric matrix

V x = \begin{pmatrix} 0&v3&-v2\\ -v3&0&v1\\ v2&-v1&0\\ \end{pmatrix}

.

Substituting

A

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

q

g(q)=q\topKq

where the

4 x 4

matrix

K= \begin{pmatrix} S-\sigmaI&z\\ z\top&\sigma \end{pmatrix}

is defined from the quantities

\begin{align} S&=B+B\top\\ z&=\sumiai\left(wi x vi\right)\\ \sigma&=\operatorname{tr}B. \end{align}

q\topq

, obtaining an unconstrained gain function

\hat{g}\left(q\right)=q\topKq-λq\topq

that attains a maximum when

Kq=λq

.

This implies that the optimal rotation is parametrised by the quaternion

q*

that is the eigenvector associated to the largest eigenvalue

λmax

of

K

.[1] [2]

Solution of the characteristic equation

The optimal quaternion can be determined by solving the characteristic equation of

K

and constructing the eigenvector for the largest eigenvalue. From the definition of

K

, it is possible to rewrite

Kq=λq

as a system of two equations

\begin{align} y&=\left((λ+\sigma)I-S\right)-1z\\ λ&=\sigma+zy \end{align}

where

y=style

1
q

v

is the Rodrigues vector. Substituting

y

in the second equation with the first, it is possible to derive an expression of the characteristic equation

λ=\sigma+z\top\left((λ+\sigma)I-S\right)-1z

.

Since

λmax=maxg\left(A\right)

, it follows that

λmax=1-minl\left(A\right)

and therefore

λmax1

for an optimal solution (when the loss

l

is small). This permits to construct the optimal quaternion

q*

by replacing

λmax

in the Rodrigues vector

y

q*=

1
\sqrt{1+\left|
y
λmax
\right|2
} (\mathbf, 1)^\top .

The

y

vector is however singular for

\theta=\pi

. 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 x 3

matrix

S

is

\det\left[S-\xiI\right]=-\xi3+2\sigma\xi2-k\xi+\Delta=0

where

\begin{align} \sigma&=

1
2

\operatorname{tr}{S

} \\k &= \operatorname \left(\operatorname \mathbf \right) \\\Delta &= \det \mathbf\end

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

-S3+2\sigmaS2-kS+\Delta=0

allowing to write

\left((\omega+\sigma)I-S\right)-1=

\alphaI+\betaS+S2
\gamma

where

\begin{align} \alpha&=\omega2-\sigma2+k\\ \beta&=\omega-\sigma\\ \gamma&=(\omega+\sigma)\alpha-\Delta \end{align}

and for

\omega=λmax

this provides a new construction of the optimal vector

\begin{align} y*&=\left((λ+\sigma)I-S\right)-1z\\ &=

\alphaI+\betaS+S2
\gamma

z \end{align}

that gives the conjugate quaternion representation of the optimal rotation as

q*=

1
\sqrt{\gamma2+\left|x\right|2
} (\mathbf, \gamma)^\top

where

x=\left(\alphaI+\betaS+S2\right)z

.

The value of

λmax

can be determined as a numerical solution of the characteristic equation. Replacing

\left((\omega+\sigma)I-S\right)-1

inside the previously obtained characteristic equation

λ=\sigma+z\top\left((λ+\sigma)I-S\right)-1z

.

gives

λ4-(a+b)λ2-cλ+(ab+c\sigma-d)=0

where

\begin{align} a&=\sigma2-k\\ b&=\sigma2+z\topz\\ c&=\Delta+z\topSz\\ d&=z\topS2z \end{align}

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. Shuster and Oh (1981)
  2. Markley and Mortari (2000)
  3. Crassidis (2007)
  4. Psiaki (2000)
  5. Wu et al. (2017)
  6. Xiaoping et al. (2008)

Sources

External links