1. Introduction
Mechanical state estimation of a vehicle is a field of interest. A vehicle is considered a rigid body, and its state of motion is represented by 4 mathematical objects: two of them represent its position and velocity, and the other two represent its orientation, and angular velocity. This paper is focused on the estimation of the angular state, composed of orientation, and angular velocity.
Although there are other mathematical tools used for estimation [1], the Kalman Filter [2] has become the algorithm par excellence in this area. Because of its simplicity, the rigor and elegance in its mathematical derivation, and its recursive nature it is very attractive for many practical applications. Its non-linear versions have been widely used in orientation estimation: the Extended Kalman Filter (EKF), and the Unscented Kalman Filter (UKF) [3]. However, there are problems arising from the used parametrization to represent the orientation.
The orientation of a system is represented by the rotation transformation that relates two reference frames: a reference frame anchored to that system, and an external reference frame. A thorough survey of attitude representations is provided in Reference [4]. The parametrization used to represent the rotation transformation could be singular, or present discontinuities among others. Table 1 summarizes the main characteristics of the most used parametrizations.
Having in mind that the special orthogonal group SO(3) has dimension three, ideally we would seek for a continuous and non-singular representation expressed by 3 parameters. However, since 1964 we know that “...it is topologically impossible to have a global 3-dimensional parametrization without singular points for the rotation group” [5]. Knowing this, we would not be wrong to say that unit quaternions are the most convenient representation we have, and that we will have for orientations. In Reference [6] the literature on attitude estimation is reviewed until 1982, when other parametrizations like Euler angles were common, and founds the basis of modern quaternion-based attitude estimation, in which this paper is supported. After that work, many others have explored this viewpoint, and have demonstrated its superiority [7,8,9,10,11,12].
Quaternions are 4-dimensional entities, but only those having unit norm represent a rotation transformation. This fact implies a problem in applying the ordinary Kalman Filter, so different approaches have emerged. Since a quaternion is of dimension 4, one tends to think at first on a4×4 covariance matrix, and in the direct application of the Kalman Filter [13]. Given that all predictions are contained in the surface defined by the unit constraint, the covariance matrix shrinks in the orthogonal direction to this surface, which leads to a singular covariance matrix after several updates. A second perspective was firstly approached in Reference [6] and was after named as “Multiplicative Extended Kalman Filter” [8,11,12]. In this second approach we define an “error-quaternion” that is transformed to a 3-vector. We use this vector to build the covariance matrix, and we talk about a “3×3 representation of the quaternion covariance matrix”. However, there are still details in this adaptation that are currently being developed. Namely, the “covariance correction step” [14].
This paper presents a new viewpoint on the problem of attitude estimation using Kalman filters when the orientation is represented by unit quaternions. Noticing that unit quaternions live in a manifold (the unit sphere inR4), we use basic concepts from manifold theory to define the mean and covariance matrix of a distribution of unit quaternions. With these definitions we develop two estimators based on the Kalman filter (one EKF-based and another UKF-based) arriving at the concepts of “multiplicative update” and “covariance correction step” in a natural and satisfying way. The inartificial emergence of these ideas establishes a solid foundation for the development of general navigation algorithms. Lastly, we also analyze the accuracy in the estimations of these two estimators using simulations.
The organization of this paper is as follows. In Section 2 we review quaternion basics. We also expose the new viewpoint on the definition of the quaternion mean and covariance matrix. In Section 3 we present the developed estimation algorithms. In Section 4 we define the performance metric, describe the simulation scheme, and present the results of the simulations. We also discuss the results. Finally, Section 5 concludes the paper.
2. Quaternions Describing Orientations 2.1. Quaternions
Quaternions are hypercomplex numbers composed of a real part and an imaginary part. The imaginary part is expressed using three different imaginary units{i,j,k}satisfying the Hamilton axiom:
i2=j2=k2=i∗j∗k=−1.
A quaternionqcan be represented with 4 real numbers, and using several notations:
q=q0+q1i+q2j+q3k≡
≡q0,q1,q2,q3T≡
≡q0,qT.
We will denote quaternions with bold italic symbols (q), while vectors will be denoted with bold upright symbols (q). Vectors will be written in matrix form, and the transposed of a matrixMwill be denoted asMT.
Quaternion product is defined by Equation (1) which produces the multiplication rule
p∗q=p0q0−p·qp0q+q0p+p×q,
where(·)represents the usual dot product, and(×) represents the 3-vector cross product. Note that the quaternion product (*) is different from the product denoted by (⊗) in reference [4]. Given this multiplication rule, the inverse of a quaternionq(the one for whichq∗q−1=q−1∗q=1) is given by
q−1=1∥q∥2q∗=1∥q∥2q0,−qT,
whereq∗represents the complex conjugate quaternion. Note that ifqis a unit quaternion (a quaternion with∥q∥=1), thenq−1=q∗.
2.2. Quaternions Representing Rotations
Each rotation transformation is mapped with a rotation matrixRand with two unit quaternionsqand−qall of them related through
R(q)=1−2q22−2q322(q1q2−q3q0)2(q1q3+q2q0)2(q1q2+q3q0)1−2q12−2q322(q2q3−q1q0)2(q1q3−q2q0)2(q2q3+q1q0)1−2q12−2q22.
Note thatR(q)=R(−q).
Quaternions representing rotations have the form
q=cos(θ/2),q^sin(θ/2)T,
whereq^denotes the unit vector that defines the rotation axis, andθthe angle of rotation. Having this form, they satisfy the restriction
∥q∥2=q02+q12+q22+q32=1.
This means that quaternions describing rotations live in the unit sphere ofR4,S3. This space is a manifold, and some concepts regarding these mathematical objects are useful in our context. In particular, the concept of chart is of special interest.
2.3. Distributions of Unit Quaternions
When dealing with the Kalman filter, the distribution of a random variablexis encoded by its meanx¯=E[x]and its covariance matrixPdefined as
P=Ex−x¯x−x¯T.
This definition makes sense when our random variables are defined in the Euclidean space. But how do we define the covariance matrix of a random variable living in a manifold like ours? How can we define the covariance for unit quaternions ifq−q¯does not represent a rotation? (Unit quaternions form a group under multiplication, but not under addition. This means that the addition of two unit quaternions may not result in another unit quaternion. Therefore, the addition of two unit quaternions may not represent a rotation.) What would be the covariance matrix if each quaternion was equiprobable in the unit sphere? We cannot redefine the covariance matrix, because the Kalman filter uses this precise form in its derivations, but we can take advantage of the properties of a manifold. Let us retrieve some important definitions:
Definition 1 (Homeomorphism).
A homeomorphism is a functionf:X→Ybetween two topological spaces X and Y satisfying the next properties:
1. f is a bijection,
2. f is continuous,
3. its inverse functionf−1is continuous.
If such a function exists, we say that X and Y are homeomorphic.
Definition 2 (Manifold).
A n-manifold Mnis a topological space in which each point is locally homeomorphic to the Euclidean spaceRn. This is, each pointx∈Mnhas a neighborhoodN⊂Mnfor which we can define a homeomorphismf:N→BnwithBnthe unit ball ofRn.
Definition 3 (Chart).
A chart for a manifoldMnis a homeomorphism φ from an open subsetU⊂Mnto an open subset of the Euclidean spaceV⊂Rn. This is, a chart is a function
φ:U⊂Mn→V⊂Rn,
with φ a homeomorphism. Traditionally, a chart is expressed as the pair(U,φ).
Given these definitions we can continue our reasoning.
In Reference [8] it talks about four “attitude error representations”. Namely, the one we will call Orthographic (O), the Rodrigues Parameters (RP), the Modified Rodrigues Parameters (MRP), and the Rotation Vector (RV). The first three are what we know as stereographic projections (and are called Orthographic, Gnomonic, and Stereographic respectively). The last one is a projection called Equidistant. But all four are charts defining a homeomorphism from the manifoldS3to the Euclidean spaceR3. This is, they map a pointqin the manifold with a pointeinR3 . Table 2 arranges these chart definitions, together with their domain and image. We must ensure the charts to be bijections so that they properly define a homeomorphism, and that they do not mapqand−qwith different points ofR3since they represent the same rotation. We achieve this by the given definitions of the domain and image for each chart.
Figure 1 shows how points in the sphereS2(subspace of the sphereS3where quaternions live) are mapped to points inR2(subspace ofR3 where the images of the charts are contained) through each one of the named charts. Since our charts are homeomorphisms, it is possible to invert the functions. Figure 2 shows how points fromR2 are mapped to points in the manifold through the inverted charts. As pointed in Reference [8], all four charts provide the same second-order approximation for a pointe∈R3near the origin, to a quaternionq∈S3
φ−1(e)≈1−∥e∥28,e2T.
We should notice that havingR3andS3different metrics, a chartφwill inevitably produce a deformation of the space. However, for quaternions in the neighborhood of the identity quaternion (top of the sphere), our charts behave like the identity transformation between the imaginary part of these quaternions, and the points near the origin inR3 as suggested by (10). This is a desirable property, as this means that the space around the identity quaternion closely resembles the Euclidean space, which is the space for which the Kalman filter is designed. But this just happens in the neighborhood of the identity quaternion. However, we can extend this property for any quaternionq¯∈S3noting that any quaternionq∈S3can be expressed as a “deviation” from the first one through the quaternion product:
q=q¯∗δq¯,
whereδq¯represents such a deviation. (This definition is arbitrary: we could have chosen to relate the quaternions throughq=δq¯∗q¯ , but it is important to establish one of these definitions, and then be consequent with it. However, (11) entails a computational advantage for the computation of (37).) Then, we define a chartφq¯for each quaternionq¯∈S3as
eq¯=φq¯(q)=φδq¯,
whereδq¯=q¯∗∗qand where we have denoted the point of the Euclidean space mapped with the quaternionq∈S3through the chartφq¯aseq¯. Then, we will have a set of chartsφq¯q¯, each one resembling the Euclidean space around a quaternionq¯∈S3, and mapping this last quaternion to the origin ofR3. We will refer to the Euclidean space associated with the chartφq¯as theq¯-centered chart. Thus, the homeomorphismφq¯−1takes a pointeq¯in theq¯-centered chart and maps it to a pointqin the manifold through
q=φq¯−1eq¯=q¯∗φ−1eq¯.
After reviewing these concepts, we can define the covariance matrix of a distribution of unit quaternions.
Given a unit quaternionq¯and a chartφ, we will define the expected value of a distribution of unit quaternions in theq¯-centered chart as
e¯q¯=Eeq¯,
and its covariance matrix as
Pq¯=Eeq¯−e¯q¯eq¯−e¯q¯T,
and the probability density of each unit quaternionqwould be defined through the homeomorphismq=φq¯−1(eq¯). Then, a distribution of unit quaternions needs of four mathematical objects to be encoded:φ,q¯,e¯q¯,Pq¯. Although a distribution of unit quaternions is unique, given this definition, its expected valuee¯q¯and its covariance matrixPq¯may take different values depending on the chosen quaternionq¯and chartφ. However, knowing that the Kalman filter is designed for the Euclidean space, it will be convenient to choose a unit quaternionq¯central in the distribution, in order that the manifold space around it closely resembles the most significant region for the covariance matrix in theq¯-centered chart. It is particularly convenient to choose a quaternionq¯such thate¯q¯=0so that the covariance matrix is centered in the origin of theq¯-centered chart.
2.4. Transition Maps
At some step of the Kalman filter, we will have a distribution of unit quaternions defined in aq¯-centered chart, and we will be interested in expressing our distribution in anotherp¯-centered chart. The concept of transition map is relevant for this purpose.
Definition 4 (Transition map).
Given two charts(Uα,φα)and(Uβ,φβ)for a manifold M, withUαβ=Uα∩Uβ≠∅, we can define a functionφαβ:φα(Uαβ)→φβ(Uαβ)as
φαβ(x)=φβφα−1(x),
withx∈φα(Uαβ). The functionφαβis called a transition map. Being thatφαandφβare homeomorphisms, so isφαβ.
For the present case, let us consider two unit quaternionsp¯andq¯both related through
p¯=q¯∗δ¯.
These two quaternions define the chartsφp¯andφq¯. We build the transition map that relates a pointeq¯expressed in theq¯-centered chart with a pointep¯expressed in thep¯-centered chart doing
ep¯=φp¯φq¯−1eq¯=
=φp¯∗∗q¯∗φ−1eq¯=
=φδ¯∗∗φ−1eq¯.
That is to say, first we take the pointeq¯in theq¯-centered chart, and we obtain its associated quaternionqin the manifold usingφq¯−1. Then, we transform this quaternionqto a pointep¯in thep¯-centered chart. Nevertheless, knowing the quaternionδ¯we do not need to explicitly computeq. In fact, being able to express the same quaternionqas two different deviations,
q=q¯∗δq¯q=p¯∗δp¯⇒δp¯=p¯∗∗q¯︸δ¯∗∗δq¯.
Note the equivalence of expressions (18c) and (19).
Table 3 displays the transition maps for the charts studied. The detailed derivations of these transition maps can be found in Appendix A. Figure 3 attempts to provide some insight into how points are transformed through the transition map of each chart.
3. Manifold Kalman Filters
In this section we present the models adopted for the Manifold Kalman Filters (MKF), and we display the resulting algorithms.
The state of the system at a time t is defined by an orientation, encoded with a unit quaternionqtand by an angular velocityωt′. We will consider them to be random variables, and we will try to estimate their value using a Kalman filter.
Our unit quaternionsqt∈H:∥qt∥=1will define the rotation transformation that relates a vectorvt′expressed in a reference frameS′attached to the solid whose state we want to describe, with the same vectorvtexpressed in an external reference frameS
vt=R(qt)vt′≡vt=qt∗vt′∗qt∗.
For example, if we measure an accelerationat′in reference frameS′the acceleration in the inertial reference frameSwould be given byat=R(qt)at′. This acceleration would be the one that we would have to integrate to obtain the position estimated by an accelerometer.
The vectorωt′will define the angular velocity of the solid measured inS′. Note that we do not include the bias of the sensors in the state of our system. We will assume that our sensors are calibrated, so the biases are zero.
We can predict the value of the random variables that describe the state of our system through the following motion equations:
dω′(t)dt=qω(t),
dq(t)dt=12q(t)∗ω′(t)=12q(t)∗0ω′(t),
whereqω(t)is a random variable that represents the process noise, and is associated with the torque acting on the system, and with its inertia tensor. Its expected value at a given time t will be denoted asq¯tωand its covariance matrix will be denoted asQtω.
We will assume that we have sensors giving measurements of angular velocityωtm(which provide information about the relative change in orientation), and of a vectorvtmwhose valuevtexpressed in the external reference frameSis known (this provides information about absolute orientation). Examples of such sensors could be a gyroscope giving angular velocity measurements, an accelerometer measuring the gravity vector near the Earth surface (vt:=−g), or a magnetometer measuring the Earth magnetic field (vt:=B). The measurement model relates these measurements with the variables that describe the state of the system:
vtm=RT(qt)qtv+vt+rtv,
ωtm=ωt′+rtω,
wherertωandrtvare random variables with zero mean and covariance matricesRtωandRtvrespectively that represent the measurement noises, andqtvis another random variable with meanq¯tvand covariance matrixQtvrepresenting external disturbances in the measurement of the vectorvt. For example, it could represent accelerations others than gravity for an accelerometer, or magnetic disturbances produced by moving irons for a magnetometer.
We will assume that the measurements arrive at discrete times{tn}n. The formatxt|tnwill be used to denote a variable x at a time t, having included measurements up to a timetnwitht>tn. For the n-th time stamp, in which a measurement arrives, we will writext|nfor the sake of simplicity. Then, our knowledge about the state at a time t, having included measurements up to a timetnwitht>tnis described by a distribution encoded in the collection of mathematical objectsφ,p¯,x¯t|np¯,Pt|np¯ as described in Section 2.3. For the present case,x¯t|np¯=e¯t|np¯,ω¯t|n′Tis the expected value of the distribution, andPt|np¯is its6×6covariance matrix, both expressing the quaternion distribution in thep¯-centered chart. Preferably,p¯will be a unit quaternion central in the distribution, so that the mapping of points from thep¯-centered chart to the manifold causes minimal deformation in such distribution. The unit quaternionq¯t|n=φp¯−1e¯t|np¯will be our best estimation of the real quaternionqtthat defines the orientation of the system with respect to the external reference frameSat time t.
The following subsections present the developed Kalman filters: one version based on the EKF and another version based on the UKF. The EKF is based on the linearization of the non-linear models to calculate the predicted covariance matrices. That is, the EKF approximates non-linear functions using their Jacobian matrices. To apply the EKF, our functions must be differentiable. On the other hand, the UKF is based on a deterministic sampling to approximate the distribution of our random variables. We select a minimal set of samples whose mean and covariance matrix are those of the state distribution. Then, they are transformed by the non-linear models, and the resulting set of points is used to compute the means and covariance matrices necessary to perform the Kalman update. This second approach does not need the functions to be differentiable.
3.1. Manifold Extended Kalman Filter
In this section we present the EKF-based estimator: the Manifold Extended Kalman Filter (MEKF). We offer here the main results of the more detailed derivation given in Appendix B.
A measurement
zn=vnmωnm
arrives at timetn. Our knowledge about the orientation at a previous timetn−1is described by a distribution expressed in theq¯n−1|n−1-centered chart. We assume that this distribution has mean
x¯n−1|n−1q¯n−1|n−1 =e¯n−1|n−1q¯n−1|n−1 =0ω¯n−1|n−1′,
and covariance matrixPn−1|n−1q¯n−1|n−1 . This is, we have an initial four
φ,q¯n−1|n−1,ω¯n−1|n−1′,Pn−1|n−1q¯n−1|n−1 .
The state prediction at timetngiven all the information up totn−1is computed through
ω¯n|n−1′=ω¯n−1|n−1′,
δnω=cos∥ω¯n|n−1′∥Δtn2ω¯n|n−1′∥ω¯n|n−1′∥sin∥ω¯n|n−1′∥Δtn2,
q¯n|n−1=q¯n−1|n−1∗δnω,
Fn=RT(δnω)IΔtn0I,
Pn|n−1q¯n|n−1 =FnPn−1|n−1q¯n−1|n−1 +QnFnT,
with
Qn=Qnω(Δtn)33−Qnω(Δtn)22−Qnω(Δtn)22QnωΔtn.
The measurement prediction at the same time is given by
v¯n|n−1m=RTq¯n|n−1q¯nv+vn,
ω¯n|n−1m=ω¯n|n−1′,
z¯n|n−1=v¯n|n−1mω¯n|n−1m,
Hn=v¯n|n−1m×00I,
Sn|n−1=HnPn|n−1q¯n|n−1 HnT+RTq¯n|n−1QnvRq¯n|n−1+Rnv00Rnω,
where[v]×stands for
[v]×=0−v3v2v30−v1−v2v10.
At this point, we compute the Kalman gainKnand use it to obtain the optimal estimation of the state:
Kn=Pn|n−1q¯n|n−1 HnTSn|n−1−1,
x¯n|nq¯n|n−1 =x¯n|n−1q¯n|n−1 +Knzn−z¯n|n−1,
Pn|nq¯n|n−1 =I−KnHnPn|n−1q¯n|n−1 ,
wherex¯n|n−1q¯n|n−1 =e¯n|n−1q¯n|n−1 =0,ω¯n|n−1′T. Finally, we need to obtain the updated unit quaternion,q¯n|nand compute the mean and the covariance matrix in theq¯n|n-centered chart, so that the distribution is expressed in the same conditions as at the beginning of the iteration. The pointe¯n|nq¯n|n−1 that results from (41), and that is defined in theq¯n|n−1-centered chart, correspond to a unit quaternion in the manifold. This is the updated unit quaternionq¯n|nwhich we are looking for:
q¯n|n=φq¯n|n−1−1e¯n|nq¯n|n−1 =
=q¯n|n−1∗φ−1e¯n|nq¯n|n−1 =
=q¯n|n−1∗δ¯n.
Knowing that the Kalman update (41) could produce any point in theq¯n|n−1-centered chart we will need to “saturate” to the closest point contained in the image of each chart. The pointe¯n|nq¯n|n−1 in theq¯n|n−1-centered chart is the origin in theq¯n|n-centered chart. Then, the expected value of the state in this new chart will be given byx¯n|nq¯n|n =e¯n|nq¯n|n =0,ω¯n|n′Tas at the beginning of the iteration.
To update the covariance matrix we need to consider its definition (15). We want to computePq¯n|n havingPq¯n|n−1 and knowing the relationep¯eq¯ provided by the transition maps in Table 3. Continuing with the EKF philosophy, the update for the covariance matrix will be found by linearizingep¯eq¯around the point where the majority of information is comprised (in our case, the pointe¯q¯=e¯n|nq¯n|n−1 ):
eip¯eq¯=eip¯e¯q¯+∑j∂eip¯eq¯∂ejq¯eq¯=e¯q¯ejq¯−e¯jq¯+O∥eq¯−e¯q¯ ∥2,
where we have used the big O notation to describe the limiting behavior of the error term of the approximation aseq¯→e¯q¯. In particular, if we define
(T)ij=∂eip¯eq¯∂ejq¯eq¯=e¯q¯,
then,
ep¯−e¯p¯≈ep¯eq¯−ep¯e¯q¯≈Teq¯−e¯q¯,
and the final update for the covariance matrix will be computed through
Pn|nq¯n|n =E(xn|nq¯n|n −x¯n|nq¯n|n )(xn|nq¯n|n −x¯n|nq¯n|n )T≈
≈T(δ¯n)00IPn|nq¯n|n−1 T(δ¯n)00IT.
Table 4 summarizes the resultingT-matrix for each chart, along with their application domain. A detailed derivation of theseT -matrices can be found in Appendix C.
After the final computation we obtain the four
φ,q¯n|n,ω¯n|n′,Pn|nq¯n|n ,
that is a condition equivalent to (27) in which we started the iteration.
3.2. Manifold Unscented Kalman Filter
In this section we present the UKF-based estimator: the Manifold Unscented Kalman Filter (MUKF).
A measurementznarrives at timetn. Our knowledge about the orientation at a previous timetn−1is described by a distribution expressed in theq¯n−1|n−2-centered chart. This distribution is encoded in the four
φ,q¯n−1|n−2,x¯n−1|n−1q¯n−1|n−2 ,Pn−1|n−1q¯n−1|n−2 .
The first step in the UKF is to create the augmentedN×1meanx˜nandN×Ncovariance matrixP˜n. Since the measurement equations are linear for the random variablesrtωandrtvwe can leave their covariance matrices out of the augmented one and add them later:
x˜n=x¯n−1|n−1q¯n−1|n−2 q¯nωq¯nv,
P˜n=Pn−1|n−1q¯n−1|n−2 000Qnω000Qnv.
Then, we obtain the matrixLnwhich satisfiesLnLnT=P˜nand we use it to generate the2N+1sigma points{Xj}j=02N as described in Ref. [15]:
Xi,0=(x˜n)i,
Xi,j=(x˜n)i+Lnij2Wjforj=1,…,N,
Xi,j+N=(x˜n)i−Lnij2Wjforj=1,…,N,
beingWj=(1−W0)/(2N)forj≠0whereW0regulates the importance given to the sigma pointX0in the computation of the mean. These sigma points{Xj}jare expressed in theq¯n−1|n−2-centered chart. We need to express them in the manifold before applying the evolution equations and the measurement equations:
Xjq=φq¯n−1|n−2−1Xje=q¯n−1|n−2∗φ−1Xje,
Yjω=Xjω+Xjqω Δtn,
Yjq=Xjq∗cos∥Yjω∥Δtn2Y^jωsin∥Yjω∥Δtn2,
Zjv=RTXjqXjv+vt,
Zjω=Yjω,
where for the j-th sigma point,Xjeis its chart point part andXjqis the quaternion with which it is mapped,Xjωis its angular velocity part,Xjqω is its angular velocity noise part,Yjωis its angular velocity prediction,Yjqis the quaternion part of its prediction (we have assumed that the angular velocityYjωis constant in the time interval[tn−1,tn) so that we can use (A20)),Xjvis the vector process noise part,Zjvis its vector measurement prediction,Zjωis its angular velocity measurement prediction, andΔtn=tn−tn−1. Note that when applying the inverse chartφ−1we will need to “saturate”Xjeto the closest point in the image ofφ. Having these new sigma points, we can obtain the means and covariance matrices of the distributions present in the UKF. First, definingZj:=Zjv,ZjωTthe means are computed through
q¯n|n−1=∑jWjYjq∥∑jWjYjq∥,
ω¯n|n−1′=∑jWjYjω,
x¯n|n−1q¯n|n−1 =φq¯n|n−1 q¯n|n−1=0ω¯n|n−1′,
z¯n|n−1=∑jWjZj.
where we have used a variation of the result provided in Ref. [16]. Namely,
q¯≈∑j qj∥∑j qj∥,
withqj·qk>0forj,k=0,…,2N. This result is shown to minimize the fourth order approximation of the distance defined as the sum of squared angles between the rotation transformation represented by each quaternionqjand the one represented byq¯. This approach to compute the mean quaternion is extremely efficient, and its derivation is elegant and simple. In order to ensure thatqj·qk>0it is useful to remember the property that bothqand−qrepresent the same rotation. This property is also useful for introducing the quaternions in the domain ofφto execute the next step of the filter.
After this, we use the obtained mean quaternionq¯n|n−1to express each sigma point in theq¯n|n−1-centered chart, and compute the covariance matrices:
Yje=φq¯n|n−1 Yjq=φq¯n|n−1∗∗Yjq,
Pn|n−1q¯n|n−1 =∑jWjYjYjT,
Pn|n−1yz=∑jWjYj Zj−z¯n|n−1T,
Sn|n−1=∑jWjZj−z¯n|n−1Zj−z¯n|n−1T+Rnv00Rnω,
where we have denotedYj:=Yje,Yjω−ω¯n|n−1′T. Finally, we compute the UKF version of the Kalman gainKnand we use it to obtain the optimal estimation of the state:
Kn=Pn|n−1yzSn|n−1−1,
x¯n|nq¯n|n−1 =x¯n|n−1q¯n|n−1 +Knzn−z¯n|n−1,
Pn|nq¯n|n−1 =Pn|n−1q¯n|n−1 −KnSn|n−1KnT,
arriving at the same conditions in which we began the iteration, with a distribution expressed in theq¯n|n−1-centered chart, and encoded by the four
φ,q¯n|n−1,x¯n|nq¯n|n−1 ,Pn|nq¯n|n−1 .
Our best estimation for the orientation at this time is
q¯n|n=φq¯n|n−1−1e¯n|nq¯n|n−1 =q¯n|n−1∗φ−1e¯n|nq¯n|n−1 ,
beinge¯n|nq¯n|n−1 the part of the meanx¯n|nq¯n|n−1 that represent the quaternion in theq¯n|n−1-centered chart.
Note that settingq¯n−1|n−2:=q¯n−1|n−1ande¯n−1|n−1q¯n−1|n−2 :=0at the beginning of each iteration yields the traditional version of the algorithm, where a “reset operation” is performed instead of the covariance matrix update.
4. Simulation Results
This section presents the results of the simulations used to measure the accuracy of each estimator. Simulations are chosen instead of real experiments because a real system entails an uncertainty in the measurement of the true attitude: the attitude that is used to compare with that estimated by the algorithms. There are sources of error ranging from a miscalibration of the measurement system to a possible bias in the “true attitude” produced by another attitude estimator, which makes it problematic to define an adequate metric to measure the accuracy of the algorithms. For this reason, the authors consider that using a simulation is more reliable to avoid possible biases in the results due to said sources of error. Others have performed similar types of tests [7,17]. However, the results do not seem to be statistically conclusive: only the estimations of some orientation trajectories are shown.
We perform our comparison through a simulation in which we do have an absolute knowledge of the attitude of the system: a true oracle exists in a simulation. Therefore, we can compare the real orientation with the attitude estimated by the algorithms having fed them only with simulated measurements that we obtain from such known orientations. We will extract our performance metrics from a wide set of orientation trajectories in order to obtain statistically conclusive results.
We try to answer three questions with the simulation test. The first question is, is there a chart for which we get a greater accuracy in attitude estimation? The second one is, what algorithm produces the most accurate attitude estimation, the MEKF or the MUKF? The last question stems from the fact that previous algorithms on attitude estimation, such as the Multiplicative Extended Kalman Filter, did not contemplate updating the distribution from one chart to another as done at (47b) in the MEKF. However, their estimators performed well [6,7,12]. Then the third question is, does this “chart update” imply an improvement in the accuracy of the attitude estimation?
Although a simulation has been used to compare our algorithms, these have also been tested with a real IMU. In the Supplementary Materials one can find a demonstration video, the source code used in the video, the source code used to generate the simulations, and the source code used to obtain the computational cost of the algorithms in each platform.
4.1. Performance Metric
We have already described a quaternionqas a deviation from another quaternionq¯asq=q¯∗δ. Now we define the instantaneous error between an estimated attitude, represented by a unit quaternionq¯and the real attitude, represented by the unit quaternionq⭑as the angle we have to rotate one of them to transform it into the other. This is, the angle of the rotation transformation defined by the quaternionδesuch thatq⭑=q¯∗δe . Recalling (6), this angle can be computed as:
θe=2arccosq¯∗∗q⭑0=
=2arccosq¯·q⭑,
having previously ensured thatq¯·q⭑≥0using the fact that bothqand−qrepresent the same rotation transformation.
Angleθewill vary along an orientation trajectory. Then, we will define the mean error in orientation estimation for a given trajectory starting at timet=0and ending at timet=Tas
eθ=1T∫0T θe(t)dt.
Finally,eθwill depend on the followed trajectory, and on the set of taken measurements. We will need to generate several orientation trajectories to obtain the mean valuee¯θand the varianceσe¯θ2that characterize the distribution of the error in orientation estimationeθfor each algorithm. We will define the confidence interval for the computede¯θas
e¯θ−3σe¯θ /Ns,e¯θ+3σe¯θ /Ns,
whereNsis the number of samples taken for thee¯θcomputation, so thatσe¯θ2/Nsis the variance of the sample mean distribution.
Being that the lower the better, the value ofe¯θgives us a measure of how well an algorithm estimates the orientation. We will consider that the performance of an algorithm A is better than the performance of other algorithm B ife¯θ(A)<e¯θ(B)and their confidence intervals do not overlap.
4.2. Simulation Scheme
To compute the performance metrics we will need to generate a large number of simulations. Each independent simulation will consist of three steps: initialization, convergence, and estimation.
In the initialization step we set up the initial conditions accordingly to the chosen simulation parameters. This includes generating the initial unit quaternionq⭑0from a uniform distribution inS3setting the initial angular velocityω⭑0′to zero, setting the update frequencyfupdategenerating the variances of the process noisesσω2andσv2from a uniform distribution in the intervals(0,Qmaxω]and(0,Qmaxv]respectively, and initializing the estimation algorithm. The initialization of the MEKF includes settingq¯0|0=1ω¯0|0′=0rad/sandP0|0q¯0|0 =102I. On the other hand, the initialization of the MUKF includes settingq¯0|−1=1e0|0q¯0|−1 =0ω¯0|0′=(1,1,1)Trad/sandP0|0q¯0|−1 =102I. The angular velocity is not initialized to0in the MUKF because it has been observed that it is sometimes necessary to “break the symmetry” for the algorithm to converge; especially when we do not apply the chart update (when we perform the “reset operation”) for the RV chart. The covariance matrices that appear in both algorithms are initialized asQnω=Irads2/s4Qnv=10−2Ip.d.u.(“p.d.u.” stands for “Procedure Defined Unit”. In the present case it depends on the definition of the vectorv),Rnω=RωIrads2/s2,Rnv=RvIp.d.u., whereRωandRvare the variances of the measurement noise that will be used in the simulation. We give this information about the measurement noise to the algorithms because it can be obtained offline, while the information about the process noise cannot. Given that a priori we cannot know how the system will behave, the values ofQnωandQnvhave been chosen according to what we understand could be normal. Choosing these values we are assuming that after a second it is normal for the angular velocity to have changed by1rad/sand also that it is normal to find external noises added to the vectorvtof magnitude10−1p.d.u.. For the mean values we setq¯nω=0rads/s2andq¯v=0p.d.u..
In the convergence step we keep the system in the initial orientationq⭑0 . Simulated measurements are generated using (23) and (24). For each measurement, a differentvtis sampled from a uniform distribution in the unit sphere ofR3. The values for each component ofqtvrtvandrtωare obtained from normal distributions with zero mean and variancesσv2RvandRωrespectively. The termRT(qt) in (23) is obtained from the true attitudeq⭑t, which in the convergence step takes the value ofq⭑t=q⭑0. The termωt′in (24) is the true angular velocity, which in the convergence step takes the valueω⭑t′=0. The tested algorithm updates its state estimation until the inequalityθe(t)<θe0is satisfied, whereθe(t)is the value of the error (72), andθe0is a parameter in the simulation. The convergence step could have been replaced by an initialization of the attitude estimated by the algorithmq¯tto the real valueq⭑tbut then it would have also been necessary to fix a certain covariance matrix. Since the metric of the space generated by each chart is different, it is difficult to set a covariance matrix that provides the same information for each chart. It seemed more natural to the authors to allow the algorithm to find the true attitude by its own means, and for the covariance matrix to converge to a value in each case.
Finally, in the estimation step we generate a random but continuous orientation sequence using a Wiener process for the angular velocity:
ω⭑t′=ω⭑t−δt′+ntδt,
q⭑t=q⭑t−δt∗cos∥ω⭑t′∥δt2ω⭑t′∥ω⭑t′∥sin∥ω⭑t′∥δt2,
wherentis a random vector whose components are sampled from a normal distribution with zero mean and varianceσω2andδtis the simulation time step that is related to the algorithm time step Δt troughdtdtsimδt=Δtbeingdtdtsiman integer parameter that determines the simulation updates per algorithm update. Note that we multiplyntbyδtand not byδt. We do it this way so that the covariance matrix after k steps does not depend on the simulation time stepδt. In fact, after a timeT=kδtthe covariance matrix of the angular velocity will have grown byΔPω=kIσω2δt=Iσω2Tand not by(ΔPω)′=kIσω2(δt)2=Iσω2Tδt. After eachdtdtsimsimulation updates, a simulated measurement is generated in the same way it was done in the convergence step, and the algorithm is updated with it. The simulation will run for a timeTsim=k′Δtwherek′ is an integer number. This way we will perform the last algorithm update at the end of the simulation. The error (72) will be evaluated after each algorithm update, and it will be added up through the simulation to obtain the averaged error (73). After each simulation, we will obtain a sample for the computation ofe¯θandσe¯θ2. We will performNs of these simulations to obtain the confidence interval (74).
4.3. Results
In this section we present the results of the simulations. The algorithms are tested for update frequenciesfupdate=1/Δtin the interval[2,1000]Hz. This range has been chosen thinking about the possible limitations of a real system. For example, the maximum data rate of a low cost IMU is around1000Hz . On the other hand, the update frequency may be limited by processing. The computational cost of each estimator has been evaluated in two platforms: an Arduino MEGA 2560, and a Raspberry Pi 3 Model B. The code has been written in c++. The resulting maximum update frequencies are presented in Figure 4, which indicates that the MEKF can be executed approximately 3 times faster than the MUKF.
Although the algorithms have been developed allowing a differentΔtn for each update, the simulations are performed using a constant Δt, and the simulation parameters depicted in Table 5.
The parametersθe0 Tsim, dtdtsim, andNshave been chosen trying to reach a compromise between the precision of the results, and the execution time of the simulation. The values forQmaxωandQmaxvhave been chosen in such a way that the estimation algorithms face both normal situations (Qnω≈σω2IandQnv≈σv2I) and situations that were not foreseen (Qnω≠σω2IorQnv≠σv2I). A typical low cost IMU hasRω≈10−4rad2/s2andRv≈10−4g2. The values chosen for R represent an imprecise sensor (10−2), a normal sensor (10−4), and a precise sensor (10−6). The value ofW0has been chosen so that all sigma points have the same importance, but very similar results, if not identical, have been obtained for other selections ofW0.
4.3.1. Chart Choice
The results of the simulation are presented in Figure 5. The average of the performance metric is shown along with its confidence interval for each of the selected update frequencies. The results of the MEKF and the MUKF are shown in different graphs, but drawn in the same one are the results for each chart and for a given MKF. In this way we are able to distinguish if a chart has an advantage over the others.
We observe that there is no chart that is especially advantageous. All things being equal, we would opt for the RP chart. For this chart it is not necessary to worry about the domain since it mapsqand−qwith the same point ofR3and with the sameT-matrix; or of the image since it is allR3. In addition, the expressions ofφ−1and theT-matrix for the MEKF are simpler for the RP chart. These computational advantages make us prefer the RP chart over the others.
4.3.2. MEKF vs. MUKF
Figure 6 also presents the results of the simulations. This time, we display on the same graph the resulting performance metrics for the MUKF and the MEKF when the RP chart is used. In this way, we can distinguish if one MKF has an advantage over the other.
We note that the MEKF performs the same or better than the MUKF. This differs from the usual experience, in which the UKF outperforms the EKF in traditional non-linear estimation applications. The fact that the charts resemble the Euclidean space near the origin (see Section 2.3) might be favoring the MEKF, since the Jacobian matrices, used to approximate the non-linear functions, are defined at that point. However, the sigma points generated for the MUKF are sampled far from the origin of the chart, where the non-linearities become notorious. We are facing a very particular scenario in which the model is approximately linear for the MEKF, while for the MUKF it is not. In addition, due to the difference in computational cost (see Figure 4), the MUKF update frequencies will generally be lower than those of the MEKF, which will imply worse accuracy in its estimations. Then, the MEKF with the RP chart seems to be our best option.
4.3.3. Chart Update vs. No Chart Update
Figure 7 presents the results of each MKF with each chart in a different graph, but displayed in the same one are the results using the “chart update” and the results without using it.
We can observe that there is almost no difference between using the “chart update” and not using it. The concepts used in this paper have helped us to understand the mechanisms of the MKF, and ultimately to arrive to the concepts of “multiplicative update”, and of “covariance correction step” with theT-matrix definition. However, it is not necessary to apply the latest update (47b) in practice: we will obtain essentially the same accuracy in our estimations.
5. Conclusions
We have used concepts from manifold theory to define the expected value and the covariance matrix of a distribution in a manifold. In particular, we have defined the expected value and covariance matrix of a distribution of unit quaternions inS3, the unit sphere inR4, using the concept of chart. These definitions have helped us to develop Kalman filters for orientation estimation, where the attitude has been represented by a unit quaternion. They have also helped us solve the problem of the “covariance correction step”. Two estimators have been developed: one based on the EKF (the MEKF), and another based on the UKF (the MUKF). The MEKF and the MUKF have been tested in simulations, and some results have been obtained. The conclusions of the simulations are:
1. There is no chart that presents a clear advantage over the others, but the RP chart has some characteristics that motivate us to prefer it.
2. The MEKF is preferable to the MUKF due to its lower computational cost and its greater accuracy in orientation estimation.
3. The “chart update” is not necessary for the MKF in practice.
Then, the MEKF with the RP chart and without applying the “chart update” is our best attitude estimator according to the adopted performance metric. This algorithm resembles the conventional “Multiplicative Extended Kalman Filter”, but we have obtained the MEKF without having to redefine any aspect of the classic Kalman filter.
[Image omitted. See PDF.]
[Image omitted. See PDF.]
[Image omitted. See PDF.]
[Image omitted. See PDF.]
[Image omitted. See PDF.]
[Image omitted. See PDF.]
[Image omitted. See PDF.]
Representation | Parameters | Continuous | Non-Singular | Linear Evolution Equation |
---|---|---|---|---|
Euler angles | 3 | ✗ | ✗ | ✗ |
Axis-angle | 3–4 | ✗ | ✗ | ✗ |
Rotation matrix | 9 | ✓ | ✓ | ✓ |
Unit quaternion | 4 | ✓ | ✓ | ✓ |
Chart | Domain | Image | e=φ(q) | q=φ−1(e) |
---|---|---|---|---|
O | {q∈S3:q0≥0} | {e∈R3:∥e∥≤2} | 2q | 1−∥e∥24e/2 |
RP | {q∈S3:q0>0} | R3 | 2qq0 | 14+∥e∥22e |
MRP | {q∈S3:q0≥0} | {e∈R3:∥e∥≤4} | 4q1+q0 | 116+∥e∥216−∥e∥28e |
RV | {q∈S3:q0≥0} | {e∈R3:∥e∥≤π} | 2q^arcsin∥q∥ | cos∥e∥2e^sin∥e∥2 |
Chart | Transition Mapep¯eq¯ |
---|---|
O | δ¯0eq¯−4−∥eq¯ ∥2δ¯−δ¯×eq¯ |
RP | 2δ¯0eq¯−2δ¯−δ¯×eq¯2δ¯0+δ¯·eq¯ |
MRP | 48δ¯0eq¯−(16−∥eq¯∥2)δ¯−8δ¯×eq¯16+∥eq¯ ∥2+δ¯0(16−∥eq¯∥2)+8δ¯·eq¯ |
RV | 2δp¯∥δp¯∥arcsin∥δp¯∥, withδp¯=δ¯0e^q¯sin∥eq¯∥2−cos∥eq¯∥2δ¯−δ¯×e^q¯sin∥eq¯∥2 |
Chart | T(δ¯)Matrix | Domain |
---|---|---|
O | δ¯0I−δ¯×+δ¯δ¯Tδ¯0 | {δ¯∈S3:δ¯0>0} |
RP | δ¯0δ¯0I−δ¯× | {δ¯∈S3:δ¯0≠0} |
MRP | 121+δ¯0δ¯0I−δ¯×+δ¯δ¯T | {δ¯∈S3:δ¯0≥0} |
RV | δ¯0I−δ¯^δ¯^T−δ¯×∥δ¯∥arcsin∥δ¯∥+δ¯^δ¯^T | {δ¯∈S3:δ¯0≥0,∥δ¯∥≠0} |
Parameter | Value |
---|---|
θe0 | 1∘ |
Tsim | 10s |
dtdtsim | 100 |
Ns | 1000 |
Qmaxω | 102rads2/s3 |
Qmaxv | 1p.d.u. |
R | {10−2,10−4,10−6} |
Rω | Rrads2/s2 |
Rv | Rp.d.u. |
W0 | 1/25 |
Supplementary Materials
The following are available online at https://www.mdpi.com/1424-8220/19/1/149/s1: SupplementaryMaterials.zip.
Author Contributions
Conceptualization, P.B.-P.; methodology, P.B.-P.; software, P.B.-P.; validation, P.B.-P. and H.M.-B.; formal analysis, P.B.-P.; investigation, P.B.-P.; resources, H.M.-B.; data curation, P.B.-P.; writing–original draft preparation, P.B.-P.; writing–review and editing, P.B.-P. and H.M.-B.; visualization, P.B.-P.; supervision, H.M.-B.; project administration, P.B.-P. and H.M.-B.
Funding
This research received no external funding.
Conflicts of Interest
The authors declare no conflict of interest.
Abbreviations
The following abbreviations are used in this manuscript:
EKF Extended Kalman Filter
UKF Unscented Kalman Filter
MKF Manifold Kalman Filter
MEKF Manifold Extended Kalman Filter
MUKF Manifold Unscented Kalman Filter
O Orthographic
RP Rodrigues Parameters
MRP Modified Rodrigues Parameters
RV Rotation Vector
Appendix A. Derivation of Transition Maps
This appendix contains the derivation of the transition map for each chart.
Appendix A.1. Orthographic
Using the inverse of the transformation that defines the chart,φ−1,
δq¯=1−∥eq¯ ∥24eq¯/2.
Introducing (A1) into (19),
δp¯=δ¯∗∗δq¯=δ¯01−∥eq¯ ∥24+δ¯·eq¯2δ¯0eq¯2−1−∥eq¯ ∥24δ¯−δ¯×eq¯2.
Finally, applying the chart definition,
ep¯=2δp¯=δ¯0eq¯−4−∥eq¯ ∥2δ¯−δ¯×eq¯.
Appendix A.2. Rodrigues Parameters
Using the inverse of the transformation that defines the chart,φ−1,
δq¯=14+∥eq¯ ∥22eq¯.
Introducing (A4) into (19),
δp¯=δ¯∗∗δq¯=14+∥eq¯ ∥22δ¯0+δ¯·eq¯δ¯0eq¯−2δ¯−δ¯×eq¯.
Finally, applying the chart definition,
ep¯=2δp¯δ0p¯=2δ¯0eq¯−2δ¯−δ¯×eq¯2δ¯0+δ¯·eq¯.
Appendix A.3. Modified Rodrigues Parameters
Using the inverse of the transformation that defines the chart,φ−1,
δq¯=116+∥eq¯ ∥216−∥eq¯ ∥28eq¯.
Introducing (A7) into (19),
δp¯=δ¯∗∗δq¯=116+∥eq¯ ∥2δ¯016−∥eq¯ ∥2+8δ¯·eq¯8δ¯0eq¯−16−∥eq¯ ∥2δ¯−8δ¯×eq¯.
Finally, applying the chart definition,
ep¯=4δp¯1+δ0p¯=48δ¯0eq¯−16−∥eq¯ ∥2δ¯−8δ¯×eq¯16+∥eq¯ ∥2+δ¯016−∥eq¯ ∥2+8δ¯·eq¯.
Appendix A.4. Rotation Vector
Using the inverse of the transformation that defines the chart,φ−1,
δq¯=cos∥eq¯∥2e^q¯sin∥eq¯∥2.
Introducing (A10) into (19),
δp¯=δ¯∗∗δq¯=δ¯0cos∥eq¯∥2+δ¯·e^q¯sin∥eq¯∥2δ¯0e^q¯sin∥eq¯∥2−cos∥eq¯∥2δ¯−δ¯×e^q¯sin∥eq¯∥2.
Finally, applying the chart definition,
ep¯=2δp¯∥δp¯∥arcsin∥δp¯∥,
with
δp¯=δ¯0e^q¯sin∥eq¯∥2−cos∥eq¯∥2δ¯−δ¯×e^q¯sin∥eq¯∥2.
Note that all transition maps are expressed using theδ¯quaternion. Given thate¯=φδ¯we could also have expressed them usinge¯which is what we get after applying the Kalman update (41). However, our choice makes transition maps to take a simpler form. In addition, having to compute the quaternionδ¯to perform (43c), this choice does not imply a computational overhead.
Appendix B. Details in the Derivation of the MEKF
This appendix contains the details in the derivation of the Manifold Extended Kalman Filter used in this study.
Appendix B.1. State Prediction
This subsection contains the derivation of the equations for the state prediction.
Appendix B.1.1. Evolution of the Expected Value of the State
Taking expected values in Equation (21) we obtain
dω¯′dt=q¯ω⇒ω¯′(t)=ω¯0′+q¯tωt,
withq¯tωthe expected value of the random variableqωat time t. Doingω¯0′=ω¯n−1|n−1′we arrive at
ω¯t|n−1′=ω¯n−1|n−1′+q¯tωt.
On the other hand, approximating (22) with its Taylor series up to first order around the current state(q¯,ω¯′), and taking its expected value we obtain
Edq(t)dt≈12q¯(t)∗ω¯′(t).
This differential equation has no general closed solution. But if we assume that the expected value of the process noiseq¯ω(t)is zero whent∈(tn−1,tn), so thatω¯′(t)is constant in that interval, then we will have the matrix differential equation
dq¯(t)dt=Ωˇnq¯(t),
with
Ωˇn:=12(0−ω¯1′−ω¯2′−ω¯3′ω¯1′0ω¯3′−ω¯2′ω¯2′−ω¯3′0ω¯1′ω¯3′ω¯2′−ω¯1′0)n|n−1.
This differential equation has the solution
q¯(t)=eΩˇtq¯0,
whereq¯0represents the initial conditions. After takingq¯0=q¯n−1|n−1, we obtain the predictionq¯t|n−1, that can be expressed using the quaternion product as
q¯t|n−1=q¯n−1|n−1∗δtω=q¯n−1|n−1∗cos∥ω¯t|n−1′∥Δt2ω¯t|n−1′∥ω¯t|n−1′∥sin∥ω¯t|n−1′∥Δt2,
withΔt=t−tn−1.
Appendix B.1.2. Evolution of the State Covariance Matrix
For a continuous nonlinear system of the form
dxdt=f(x,t)+g(q),
we know [18] that the covariance matrix satisfies the following differential equation:
dPdt=FP+PFT+GQGT,
whereF=∂f∂x, andG=∂g∂q. This is so because the evolution equation forΔx=x−x¯is approximately given by:
dxdt≈dx¯dt+∂f∂xx=x¯x−x¯+∂g∂qq=q¯q−q¯,
andPis defined asP=EΔx(Δx)T. However, we have a different definition forP:
P=Eeq¯−e¯q¯ω′−ω¯′eq¯−e¯q¯ω′−ω¯′T.
Then we need to find the evolution equation foreq¯. Recall that we are assuminge¯q¯=0at the beginning of the iteration. Knowing that any quaternion in the unit sphere can be expressed as a deviation from a central quaternionq¯asq=q¯∗δ , and using the differential Equations (22) and (A16), we can find a differential equation for the quaternionδ:
q=q¯∗δ⇒
⇒q˙=q¯˙∗δ+q¯∗δ˙⇒
⇒12q∗ω′≈12q¯∗ω¯′∗δ+q¯∗δ˙,
where a dot over a symbol represents time derivative, and we have obviated the time dependence. Isolating the time derivativeδ˙,
δ˙≈12q¯∗∗q︷δ∗ω′−12q¯∗∗q¯︷1∗ω¯′∗δ=
=12δ∗ω′−ω¯′∗δ=
=12δ0δ∗0ω′−0ω¯′∗δ0δ=
=12−ω′−ω¯′·δδ0ω′−ω¯′−ω′+ω¯′×δ=
=12−Δω′·δδ0Δω′−2ω¯′+Δω′×δ.
Knowing that, for each of our charts, theδ quaternion can be approximated by (10) ase→0, then we can obtain an approximate differential equation for a pointeexpressed in theq¯-centered chart. Note that we have not explicitly denotedeq¯orδq¯. This will be assumed implicitly, since these quantities will always be expressed in theq¯-centered chart in this appendix. Using the chain rule for a time derivative and expression (A26e),
e˙i=∑j∂ei∂δj︷2δij≈2δij∂δj∂t︷δ˙j≡
≡e˙≈δ0Δω′−2ω¯′+Δω′×δ≈
≈1−∥e∥28Δω′−2ω¯′+Δω′×e2.
Then, the first order approximation to differential Equation (A27c) would be
e˙≈Δω′−ω¯′×e.
On the other hand, combining Equations (21) and (A14) we obtain
dΔω′dt=d(ω′−ω¯′)dt=qω−q¯ω=qω.
Summarizing,
ddteΔω′≈−ω¯′×I00eΔω′+0Δqω,
therefore matricesF,G, andQ in (A22) are in our case
F=−ω¯′×I00,
G=I,
Q=000E[Δqω(Δqω)T].
We are now in a position to solve the differential Equation (A22). Let us consider its homogeneous version first:
dPHdt=FPH+PHFT,
which has as solution
PH=eFtC0eFTt.
Taking into account the definition of matrix exponential, and after computing the powers ofFwe obtain
eFt=∑n=0∞(−Ω)ntnn!∑n=1∞(−Ω)n−1tnn!0I≈RT(δω)It0I,
where we have denotedΩ=ω¯′×, andδω=cos∥ω¯′∥t2,ω¯′∥ω¯′∥sin∥ω¯′∥t2. We also have assumed that t takes small values so we can approximate the infinite sums truncating in the first term. To find the solution of the non-homogeneous differential equation we use the variation of constants method:
P=eFtC(t)eFTt⇒
⇒dPdt=FeFtC(t)eFTt+eFtC(t)eFTtFT+eFtdC(t)dteFTt=
=FP+PFT+eFtdC(t)dteFTt.
Identifying terms with (A22) we obtain that
eFtdC(t)dteFTt=GQGT⇒
⇒dC(t)dt=e−FtQe−FTt=∑n=0∞∑m=0∞(−F)ntnn!Q(−FT)mtmm!⇒
⇒C(t)=C0+∑n=0∞∑m=0∞(−F)nn!Q(−FT)mm!tn+m+1n+m+1.
Finally, truncating the summation in (A42) at the first non-zero elements, and inserting the result into (A37), we obtain (32) where we have identifiedC0=P(0)through the initial conditions.
Appendix B.2. Measurement Prediction
This subsection contains the derivation of the equations for the measurement prediction.
Appendix B.2.1. Expected Value of the Measurement Prediction
Taking expected values on (24), and assumingr¯tω=0 we arrive at (35). On the other hand, approximating (23) with its Taylor series up to first order around the current estimation of the state(q¯,ω¯′), taking its expected value, and assumingr¯tv=0 we obtain (34).
Appendix B.2.2. Covariance Matrix of the Measurement Prediction
In order to find the covariance matrix of the measurement prediction we need the linear approximation of the vector measurement around the pointx0:=e=0,qv=q¯v,rv=r¯v:
vm≈v¯m+∂vm∂ex0 e+∂vm∂qvx0 qv−q¯v+∂vm∂rvx0 rv−r¯v.
It is direct to identify
∂vm∂qvx0 =RT(q¯),
∂vm∂rvx0 =I.
On the other hand, rewriting (23) as
vm=δ∗∗q¯∗∗qv+v∗q¯∗δ+rv≡
≡vm=RT(δ)RT(q¯)qv+v+rv,
and noting that settinge=0is equivalent to doδ=1,
∂vim∂ejx0 =∑k∂vim∂δkx0 ∂δk∂eje=0=∑kl∂RilT(δ)∂δkδ=1 RT(q¯)q¯v+vl ∂δk∂eje=0.
Now, recalling (5) we have
∂RT(δ)∂δkδ=1=20δ3k−δ2k−δ3k0δ1kδ2k−δ1k0≡−2∑nεinlδnk,
withεinlthe Levi-Civita symbol, andδnk the Kronecker delta. Recalling (10) we also have
∂δ∂ej=−ej/4δ1j/2δ2j/2δ3j/2e=0≡(1−δ0k)δkj/2.
Then, introducing in (A48) Equations (A49), (34), and (A50),
∂vim∂ejx0 ≈−∑klnεinlδnkv¯lm(1−δ0k)δkj=∑lεiljv¯lm≡v¯m×,
where we have usedεijl=−εilj. Finally, assuming the independence of the random variablesxt=(et,ωt′)T,qtv,rtv, andrtω, and computing the covariance matrixSt=E(zt−z¯t)(zt−z¯t)Twithzt=(vtm,ωtm)Tand (A43), we arrive at (37) and (38).
Appendix C. Derivation of the T-matrices
This appendix contains the derivation of theT-matrix for each chart.
Appendix C.1. Orthographic
Our transition map (A3) can be written as
eip¯(eq¯)=δ¯0eiq¯−4−∑k (ekq¯)2δ¯i−∑lmεilmδ¯lemq¯,
beingεilm the Levi-Civita symbol. Finding (45) for (A52) we obtain
(T)ij=δ¯0δij−−∑k ekq¯δkj4−∑k (ekq¯)2δ¯i−∑lmεilmδ¯lδmjeq¯=e¯q¯=
=δ¯0δij+e¯jq¯4−∑k (e¯kq¯)2δ¯i−∑lεiljδ¯l,
This expression can be rewritten in matrix form as
T=δ¯0I+δ¯(e¯q¯)T4−∥e¯q¯ ∥2−δ¯×.
Finally, recalling that for this chartδ¯0=1−∥e¯q¯ ∥2/4andδ¯=e¯q¯/2, we arrive at the final expression
T=δ¯0I+δ¯δ¯Tδ¯0−δ¯×.
Appendix C.2. Rodrigues Parameters
First, let us denote the numerator of (A6) asN(eq¯), and its denominator asD(eq¯):
Neq¯:=δ¯0eq¯−2δ¯−δ¯×eq¯,
Deq¯:=2δ¯0+δ¯·eq¯.
Now let us evaluate (A56) ate¯q¯:
Ne¯q¯=δ¯0e¯q¯︸2δ¯/δ¯0−2δ¯︷0−δ¯×e¯q¯︷=(δ¯∥e¯q¯)=0.
Then, the approximation ofNeq¯does not have terms of orderO(1). This means that we will only need to approximateDeq¯to the zeroth order. Any further approximation would produce, after multiplying by the linear approximation ofNeq¯, a higher order term. Let us then calculate each approximation.
We can rewrite (A56) as
Nieq¯=δ¯0eiq¯−2δ¯i−∑klεiklδ¯kelq¯,
withεikl the Levi-Civita symbol. Applying (44) to (A59),
Nieq¯≈∑jδ¯0δij−∑klεiklδ¯kδljeq¯=e¯q¯ejq¯−e¯jq¯=
=∑jδ¯0δij−∑kεikjδ¯kejq¯−e¯jq¯,
beingδijthe Kronecker delta. Returning to matrix notation, the linear approximation ofNeq¯is
Neq¯=δ¯0I−δ¯×eq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2.
On the other hand, evaluating (A57) ate¯q¯we obtain the zeroth order approximation:
De¯q¯=2δ¯0+δ¯·2δ¯δ¯0+O∥eq¯−e¯q¯∥=
=2δ¯0δ¯02+∥δ¯∥2︸1+O∥eq¯−e¯q¯∥=
=2δ¯0+O∥eq¯−e¯q¯∥.
Finally, combining (A61) and (A62c) we can compute the linear approximation of (A6):
ep¯eq¯=2δ¯0I−δ¯×eq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2δ¯02+O∥eq¯−e¯q¯∥=
=δ¯0δ¯0I−δ¯×eq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2.
Appendix C.3. Modified Rodrigues Parameters
First, let us denote the numerator of (A9) asN(eq¯), and its denominator asD(eq¯):
Neq¯=8δ¯0eq¯−16−∥eq¯ ∥2δ¯−8δ¯×eq¯,
Deq¯=16+∥eq¯ ∥2+δ¯016−∥eq¯ ∥2+8δ¯·eq¯.
Now let us evaluate (A64) ate¯q¯:
Ne¯q¯=8δ¯0e¯q¯︷4δ¯/(1+δ¯0)−16−∥e¯q¯ ∥2︷16∥δ¯∥2/(1+δ¯0)2δ¯−8δ¯×e¯q¯︷0(e¯q¯∥δ¯)=0(e¯q¯∥δ¯)=
=16δ¯1+δ¯02δ¯0−1+δ¯0−∥δ¯∥2︷1−δ¯021+δ¯0=0.
Then, as with the RP chart, the approximation ofNeq¯does not have terms of orderO(1), and we will only need to approximateDeq¯to the zeroth order.
We can write (A64) as
Nieq¯=8δ¯0eiq¯−16−∑k(ekq¯)2δ¯i−8∑lmεilmδ¯lemq¯,
withεilm the Levi-Civita symbol. Applying (44) to (A67),
Nieq¯≈∑j8δ¯0δij+∑k2ekq¯δkjδ¯i−8∑lmεilmδ¯lδmjeq¯=e¯q¯ejq¯−e¯jq¯=
=∑j8δ¯0δij+2e¯jq¯δ¯i−8∑lεiljδ¯lejq¯−e¯jq¯,
beingδijthe Kronecker delta. Returning to matrix notation, the linear approximation ofNeq¯is
Neq¯=8δ¯0I+2δ¯(e¯q¯)T−8δ¯×eq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2=
=8δ¯0I+δ¯δ¯T1+δ¯0−δ¯×eq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2.
On the other hand, evaluating (A65) ate¯q¯we obtain the zeroth order approximation:
De¯q¯≈16+16∥δ¯∥2(1+δ¯0)2+δ¯016−16∥δ¯∥2(1+δ¯0)2+8δ¯·4δ¯1+δ¯0=
=161+δ¯0(1+δ¯0)+∥δ¯∥21+δ¯0+δ¯0(1+δ¯0)−∥δ¯∥21+δ¯0+2∥δ¯∥2=
=161+δ¯02+δ¯02δ¯0+21−δ¯02=641+δ¯0,
where we have used the equality∥δ¯∥2=1−δ¯02 for unit quaternions. Finally, combining (A69b) and (A70c) we can compute the linear approximation of (A9):
ep¯eq¯=48δ¯0I+δ¯δ¯T1+δ¯0−δ¯×eq¯−e¯q¯+O∥eq¯−e¯q¯ ∥21+δ¯064+O∥eq¯−e¯q¯∥=
=1+δ¯02δ¯0I+δ¯δ¯T1+δ¯0−δ¯×eq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2=
=121+δ¯0δ¯0I−δ¯×+δ¯δ¯Teq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2.
Appendix C.4. Rotation Vector
Let us start evaluating the vectorδp¯ in (A12) and (A13) at the pointe¯q¯:
δp¯e¯q¯=δ¯0e¯^q¯sin∥e¯q¯∥2︸δ¯−cos∥e¯q¯∥2︸δ¯0δ¯︷0=0−δ¯×e¯^q¯sin∥e¯q¯∥2︸δ¯︷0=0=0.
Then, the first order approximation ofδp¯arounde¯q¯will have the form
δp¯=T˜eq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2,
and∥δp¯∥→0aseq¯→e¯q¯. Taking the Taylor series of thearcsinx,
arcsin∥δp¯∥∥δp¯∥=∥δp¯∥+O∥δp¯ ∥3∥δp¯∥=1+O∥δp¯ ∥2=1+O∥eq¯−e¯q¯ ∥2,
so that (A12) is linearized as
2δp¯∥δp¯∥arcsin∥δp¯∥=2T˜eq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2.
We only lack theT˜matrix. We will need the linear approximations ofcos∥eq¯∥/2ande^q¯sin∥eq¯∥/2arounde¯q¯. To this end we will first obtain the linear approximation of∥x∥:
∥x∥=∑k xk2=
=∥x¯∥+∑j∑k xkδkj∑k xk2x=x¯xj−x¯j+O∥x−x¯∥2=
=∥x¯∥+∑jx¯j∑k x¯k2xj−x¯j+O∥x−x¯∥2=
=∥x¯∥+x¯^Tx−x¯+O∥x−x¯∥2.
Noticing that
∂∥x∥∂x=x¯^T+O∥x−x¯∥,
our computations are straightforward:
cos∥x∥2=cos∥x¯∥2−sin∥x∥212x¯^T+O∥x−x¯∥x=x¯x−x¯+O∥x−x¯∥2=
=cos∥x¯∥2−12sin∥x¯∥2x¯^Tx−x¯+O∥x−x¯∥2.
For our particular case,
cos∥eq¯∥2=δ¯0−12δ¯Teq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2.
On the other hand,
sin∥x∥2∥x∥=
=sin∥x¯∥2∥x¯∥+cos∥x∥2∥x∥12−sin∥x∥2∥x∥2x¯^T+O∥x−x¯∥x=x¯x−x¯+O∥x−x¯∥2=
=sin∥x¯∥2∥x¯∥+cos∥x¯∥2∥x¯∥12−sin∥x¯∥2∥x¯∥2x¯^Tx−x¯+O∥x−x¯∥2.
Now, takingx=x¯+x−x¯we arrive at
x∥x∥sin∥x∥2=x¯+x−x¯sin∥x∥2∥x∥=
=x¯^sin∥x¯∥2+sin∥x¯∥2∥x¯∥+12cos∥x¯∥2x¯^x¯^T−sin∥x¯∥2∥x¯∥x¯^x¯^Tx−x¯+O∥x−x¯∥2.
For our particular case,
eq¯∥eq¯∥sin∥eq¯∥2=δ¯+∥δ¯∥2arcsin∥δ¯∥+δ¯02δ¯^δ¯^T−∥δ¯∥2arcsin∥δ¯∥δ¯^δ¯^Teq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2=
=δ¯+12I−δ¯^δ¯^T∥δ¯∥arcsin∥δ¯∥+δ¯0δ¯^δ¯^Teq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2.
Finally, we just have to replace (A79) and (A82b) in (A13) to obtain the required linear approximation. Returning to the original notation we have
2δp¯∥δp¯∥arcsin∥δp¯∥=2δp¯+O∥eq¯−e¯q¯ ∥2=
=2δ¯0e^q¯sin∥eq¯∥2−2cos∥eq¯∥2δ¯−2δ¯×e^q¯sin∥eq¯∥2+O∥eq¯−e¯q¯ ∥2==2δ¯0δ¯+δ¯0I−δ¯^δ¯^T∥δ¯∥arcsin∥δ¯∥+δ¯0δ¯^δ¯^Teq¯−e¯q¯−2δ¯0−δ¯Teq¯−e¯q¯δ¯+
−δ¯×2δ¯+I−δ¯^δ¯^T∥δ¯∥arcsin∥δ¯∥+δ¯0δ¯^δ¯^Teq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2=
=δ¯0I−δ¯^δ¯^T−δ¯×∥δ¯∥arcsin∥δ¯∥+δ¯02δ¯^δ¯^T+δ¯δ¯Teq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2=
=δ¯0I−δ¯^δ¯^T−δ¯×∥δ¯∥arcsin∥δ¯∥+δ¯^δ¯^Teq¯−e¯q¯+O∥eq¯−e¯q¯ ∥2.
Note that the linear approximations of our transition maps are valid foreq¯near ofe¯q¯. However, we have not made any assumption about theδ¯quaternion. This means that our linear approximations are exact for anyδ¯=φ−1(e¯q¯)in the domain of eachT-matrix, provided thateq¯is close enough toe¯q¯.
1. Crassidis, J.L.; Markley, F.L.; Cheng, Y. Survey of nonlinear attitude estimation methods. J. Guid. Control Dyn. 2007, 30, 12–28.
2. Kalman, R.E. A new approach to linear filtering and prediction problems. J. Basic Eng. 1960, 82, 35–45.
3. Julier, S.J.; Uhlmann, J.K. New Extension of the Kalman Filter to Nonlinear Systems; AeroSense’97; International Society for Optics and Photonics: Bellingham, WA, USA, 1997; pp. 182–193.
4. Shuster, M.D. A survey of attitude representations. Navigation 1993, 8, 439–517.
5. Stuelpnagel, J. On the parametrization of the three-dimensional rotation group. SIAM Rev. 1964, 6, 422–430.
6. Lefferts, E.J.; Markley, F.L.; Shuster, M.D. Kalman filtering for spacecraft attitude estimation. J. Guid. Control Dyn. 1982, 5, 417–429.
7. Crassidis, J.L.; Markley, F.L. Unscented filtering for spacecraft attitude estimation. J. Guid. Control Dyn. 2003, 26, 536–542.
8. Markley, F.L. Attitude error representations for Kalman filtering. J. Guid. Control Dyn. 2003, 26, 311–317.
9. Hall, J.K.; Knoebel, N.B.; McLain, T.W. Quaternion attitude estimation for miniature air vehicles using a multiplicative extended Kalman filter. In Proceedings of the 2008 IEEE/ION Position, Location and Navigation Symposium, Monterey, CA, USA, 5–8 May 2008; IEEE: Piscataway, NJ, USA; pp. 1230–1237.
10. VanDyke, M.C.; Schwartz, J.L.; Hall, C.D. Unscented Kalman filtering for spacecraft attitude state and parameter estimation. Adv. Astronaut. Sci. 2004, 118, 217–228.
11. Markley, F.L. Multiplicative vs. additive filtering for spacecraft attitude determination. Dyn. Control Syst. Struct. Space 2004, 6, 311–317.
12. Crassidis, J.L.; Markley, F.L. Attitude Estimation Using Modified Rodrigues Parameters. Available online: https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19960035754.pdf (accessed on 1 January 2019).
13. Bar-Itzhack, I.; Oshman, Y. Attitude determination from vector observations: Quaternion estimation. IEEE Trans. Aerosp. Electr. Syst. 1985, AES-21, 128–136.
14. Mueller, M.W.; Hehn, M.; D’Andrea, R. Covariance correction step for kalman filtering with an attitude. J. Guid. Control Dyn. 2016, 40, 2301–2306.
15. Julier, S.J.; Uhlmann, J.K. Unscented filtering and nonlinear estimation. Proc. IEEE 2004, 92, 401–422.
16. Gramkow, C. On averaging rotations. J. Math. Imag. Vision 2001, 15, 7–16.
17. LaViola, J.J. A comparison of unscented and extended Kalman filtering for estimating quaternion motion. In Proceedings of the American Control Conference, Denver, CO, USA, 4–6 June 2003; IEEE: Piscataway, NJ, USA, 2003; Volume 3, pp. 2435–2440.
18. Xie, L.; Popa, D.; Lewis, F.L. Optimal and Robust Estimation: With an Introduction to Stochastic Control Theory; CRC Press: Boca Raton, FL, USA, 2007.
Department of Information and Communication Engineering, University of Murcia, 30100 Murcia, Spain
*Author to whom correspondence should be addressed.
You have requested "on-the-fly" machine translation of selected content from our databases. This functionality is provided solely for your convenience and is in no way intended to replace human translation. Show full disclaimer
Neither ProQuest nor its licensors make any representations or warranties with respect to the translations. The translations are automatically generated "AS IS" and "AS AVAILABLE" and are not retained in our systems. PROQUEST AND ITS LICENSORS SPECIFICALLY DISCLAIM ANY AND ALL EXPRESS OR IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES FOR AVAILABILITY, ACCURACY, TIMELINESS, COMPLETENESS, NON-INFRINGMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Your use of the translations is subject to all use restrictions contained in your Electronic Products License Agreement and by using the translation functionality you agree to forgo any and all claims against ProQuest or its licensors for your use of the translation functionality and any output derived there from. Hide full disclaimer
© 2019. This work is licensed under https://creativecommons.org/licenses/by/4.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
Abstract
The problem of attitude estimation is broadly addressed using the Kalman filter formalism and unit quaternions to represent attitudes. This paper is also included in this framework, but introduces a new viewpoint from which the notions of “multiplicative update” and “covariance correction step” are conceived in a natural way. Concepts from manifold theory are used to define the moments of a distribution in a manifold. In particular, the mean and the covariance matrix of a distribution of unit quaternions are defined. Non-linear versions of the Kalman filter are developed applying these definitions. A simulation is designed to test the accuracy of the developed algorithms. The results of the simulation are analyzed and the best attitude estimator is selected according to the adopted performance metric.
You have requested "on-the-fly" machine translation of selected content from our databases. This functionality is provided solely for your convenience and is in no way intended to replace human translation. Show full disclaimer
Neither ProQuest nor its licensors make any representations or warranties with respect to the translations. The translations are automatically generated "AS IS" and "AS AVAILABLE" and are not retained in our systems. PROQUEST AND ITS LICENSORS SPECIFICALLY DISCLAIM ANY AND ALL EXPRESS OR IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES FOR AVAILABILITY, ACCURACY, TIMELINESS, COMPLETENESS, NON-INFRINGMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Your use of the translations is subject to all use restrictions contained in your Electronic Products License Agreement and by using the translation functionality you agree to forgo any and all claims against ProQuest or its licensors for your use of the translation functionality and any output derived there from. Hide full disclaimer