Abstract
This paper presents the Quaternion-based Robust Adaptive Unscented Kalman Filter (QRAUKF) for attitude estimation. The proposed methodology modifies and extends the standard UKF equations to consistently accommodate the non-Euclidean algebra of unit quaternions and to add robustness to fast and slow variations in the measurement uncertainty. To deal with slow time-varying perturbations in the sensors, an adaptive strategy based on covariance matching that tunes the measurement covariance matrix online is used. Additionally, an outlier detector algorithm is adopted to identify abrupt changes in the UKF innovation, thus rejecting fast perturbations. Adaptation and outlier detection make the proposed algorithm robust to fast and slow perturbations such as external magnetic field interference and linear accelerations. Comparative experimental results that use an industrial manipulator robot as ground truth suggest that our method overcomes a trusted commercial solution and other widely used open source algorithms found in the literature.
Keywords: unit quaternion, unscented Kalman filter, MARG sensor, adaptive filtering
1. Introduction
With the rise of small flying vehicles, also known as drones, small and inexpensive attitude and heading reference systems (AHRS) have populated the market. For such systems, it is common to estimate the orientation by combining information from magnetic, rate and gravity (MARG) sensors, also known as inertial measurement unit (IMU), usually composed of micromechanical (MEMS) three-axis gyroscope and accelerometer and a three-axis magnetometer [1]. The standard approach for attitude estimation is to compute the three components of inertial orientation by integrating the gyroscope measurements, and use the gravity projection and heading angle estimated by the accelerometers and magnetometers to correct the angles computed with the gyro. Although theoretically simple, naive implementations of this approach may not be precise because magnetometer measurements are easily influenced by ferrous material in the vicinity, and accelerometers measure not only the gravitational direction but also its linear acceleration. In these cases, it is difficult to dissociate magnetic field perturbation and linear acceleration from both the magnetic field of the earth and gravity to compute the attitude accurately, which can lead to poor estimates [2,3]. Since accurate attitude estimation is a crucial task for a variety of applications, such as human motion tracking [4,5], augmented reality [6], satellite control [7] and navigation and control of aerial [8], and sub-aquatic vehicles [9], the main objective of this paper is to present a solution that deals with external in internal sensor disturbance and interference. This paper extends the results of our conference paper [10]. We provide a more detailed mathematical description of our method and provide a whole new set of experiments. We also added several new figures that illustrate the ability of our method to estimate attitude and also some characteristics of the sensors, such as bias.
It is usually very common and useful to represent attitude by a combination of three successive rotations, such as Euler angles. Although intuitive, Euler angles exhibit singularity in their kinematic description, a situation known as gimbal lock. Alternatively, unit quaternion and direct cosine representations avoid such singularities. Between the two, unit quaternion is preferred due to its minimal representation and computational efficiency [11]. However, the unit quaternion representation does not pertain to the Euclidean space, meaning that weighted sum and subtraction operations, common to most sensor fusion methodologies, may violate the unit norm constraint of the quaternion. This paper proposes a solution to this problem in situations where the uncertainty of the measurements may change over time.
There are many approaches to estimate attitude using the quaternion representation. Among the stochastic approaches, techniques based on the Kalman filter (KF) and its variations for non-linear systems are the most common [12,13]. To overcome the Euclidean systematization using the original KF, an indirect form of the KF, called multiplicative extended Kalman filter (MEKF) [14], was proposed. This approach is valid only for small estimation errors. For large errors, algorithms based on the unscented Kalman filter (UKF) as the unscented quaternion estimator (USQUE) [15] may yield better results. Since unit quaternions are constrained to the nonlinear Riemannian manifold, using its logarithm and exponential maps, as in Refs. [11,16], can better handle its properties. A more general formulation of UKF for unit quaternion can be found in Ref. [17]. However, these algorithms do not explore the time-varying measurement uncertainty. If, for example, external disturbance affects the measurement of the magnetic field, the filter estimate will be severely damaged.
The classical way of handling the temporal variation of uncertainty is through adaptive filters, in which the statistical parameters that characterize the uncertainty are jointly estimated with the system states. In this context, approaches based on the techniques referred to as covariance matching (CM) [18], interacting multiple models (IMM) [19] and covariance scaling (CS) [20], were investigated. Among these methods, the covariance matching approaches yield improved results in the estimation of the covariance matrix for Gaussian distribution, if compared to the CS approach. CM also presents a greater simplicity if compared to approaches based on multiple models. However, in the presence of outliers, its performance can be damaged. In this context, median-based approaches can be combined to mitigate the outlier influence [21,22]. It is important to point out that, like the KF, these adaptive approaches also belong to Euclidean systematization, thus requiring modifications to be used with unitary quaternions.
In Ref. [23], the authors present an adaptive UKF for attitude estimation. The adaptive part of the algorithm is based on a covariance scaling approach, which adapts the covariance matrix if a fault is detected by a chi-square test. The main shortcoming of this approach is that the chi-square test may fail for slow varying faults, keeping the covariance matrix unchanged. In addition, the attitude is parameterized by Euler angles, being vulnerable to gimbal-lock. Based on the algorithms shown in Refs. [15,23], an adaptive UKF for attitude represented in quaternions is presented in Ref. [24]. In Ref. [25], a inflated covariance method based on multiplicative EKF (MEKF) is proposed to compensate the undesired effects of magnetic distortion and body acceleration. In Ref. [26], the Hidden Markov Model (HMM) is combined with MEKF to estimate the observation covariance matrix, thus compensating the undesired effects of magnetic distortion and linear acceleration. In spite of demonstrated good performance with numerically simulated cases [25] and actual data [26], these algorithms suffer the same limitation of MEKF, which is restricted to small estimate errors.
In contrast to KF-based approaches, which adopt a probabilistic determination of the modeled state, complementary filters (CF) are based on frequency analysis, being simplistic and usually computationally more efficient. In Ref. [27], the authors proposed an explicit complementary filter (ECF) for orientation estimation. Such a filter uses a proportional-integral (PI) controller to estimate the bias of the gyro. In Ref. [28], the authors present a computationally efficient gradient descent algorithm given measurements from a MARG sensor. The proposed algorithm has low computational cost and is able to reduce the effect of the magnetic disturbance. The problem of this algorithm is that the orientation estimated using accelerometers suffers the influence of magnetic disturbances due to the coupling in the gradient descent algorithm used. In Ref. [29], quaternion measurement is computed as the composition of two algebraic quaternions, mitigating the influence of magnetic distortion. Adaptive gains are used to reduce the estimation error during high dynamic motion. Instead of using adaptive factors, in Ref. [30], an air data sensor (ADS) is used to compensate for the linear acceleration disturbance in the MARG sensor. Although interesting, this solution requires a minimum system velocity, making its application limited.
In this scenario, we propose an adaptive algorithm based on UKF for attitude estimation using quaternion representation. In contrast to EKF, UKF-based approaches can better handle the high order nonlinear terms that can appear when the attitude error is large. The unit norm constraint of the quaternion is ensured by the use of a rotation vector parameterization. Differently from quaternion error approximation used on USQUE, this parameterization better handles the unit quaternion properties, such as the Riemannian metric [31]. The main difference between our work and classical approaches, such as MEKF and USQUE, is that it handles online the time-varying measurement uncertainty. For this, the covariance matching approach is used to update the observation covariance matrix online. Although CM can usually estimate well the measurement covariance matrix, the presence of outliers can damage the estimation. To minimize the effect of measurement outliers, we propose to combine the adaptive filter with a Hampel identifier, which compares the median deviation and the median absolute deviation (MAD) to identify an outlier. Our approach only uses the MARG sensor as an information source, and does not need extra information, such as ADS. Thus, the main contribution of this paper is the Quaternion-based Robust Adaptive Unscented Kalman Filter (QRAUKF) algorithm for attitude estimation. This algorithm is robust to fast and slow perturbations on both accelerometers and magnetometers and, to the best of authors’ knowledge, is the first one with such characteristics that precisely and consistently represent the attitude using quaternions. The proposed algorithm is tested with real experimental data collected from a MARG sensor. The performance of the proposed algorithm is confronted against the non-adaptive UKF, the open source algorithm based on complementary filter proposed in Ref. [32] and the commercial algorithm embedded in the MARG device used in our experiments, which was executed using a manipulator robot for validation purposes. A Matlab implementation of the algorithm is freely provided by the authors.
The rest of this paper is organized as follows. A problem formulation is presented in the next section. The theoretical basis for our contribution is in Section 3 and Section 4. The proposed algorithm is presented in Section 5 and is experimentally evaluated in Section 6. Finally, conclusions are presented in Section 7.
2. Problem Statement
This paper addresses the problem of attitude estimation of a rigid body moving in a three dimensional space. This problem basically consists in determining the three degrees-of-freedom orientation information of the body, independently of its current velocity and/or acceleration. Among the common representations for attitude, we chose to use unit quaternions, since it is a free-of-singularities and compact representation. To estimate the attitude, we assume that rigid body is attached to inertial and magnetic sensors, namely 3-axis accelerometer measuring acceleration in the three main body axis, , , and ; 3-axis magnetometer measuring the magnetic fields , , and ; and 3-axis gyroscope measuring the angular velocities , , and . The accelerometers measure the gravity acceleration, which is indeed the part used for attitude estimation, along with all other accelerations to which the body is subjected, which act as perturbations for the movement. On the other hand, magnetometers measure the magnetic field of the earth, useful in the estimation process, and other unknown fields around the body. Measured accelerations and magnetic fields are contaminated with zero mean random noise. Angular velocity information, besides random noise, is also subjected to a time varying bias. Thus, our problem is to estimate the unit quaternion , given the vector of measurements , which is corrupted with noise and external disturbances, as mentioned before.
We solve the previous problem using a modified version of the Uncented Kalman Filter (UKF). A block diagram of our solution is shown in Figure 1. All blocks of this figure will be discussed in the following sections. We start by addressing attitude representation using unit quaternions and by presenting a new Unscented Transform (UT) for quaternions in the next section.
3. Unit Quaternion Operations
Unit quaternions form a four-dimensional algebra over the real numbers and can be used to parametrize the rotation group SO(3). The set of unit quaternions, denoted by , form a group under multiplication operation but not under addition operation [17]. This group is topologically a 3-sphere, denoted by , embedded in the .
The unit quaternion can be represented as , in which . Here is the real part and is the imaginary part. Given a rotation and the unit vector w, the corresponding unit quaternion is . The inversion unit quaternion operation is equal to its conjugate, given by . The product ⊗ between quaternions is defined as , in which × denotes the cross product [33]. A vector can be rotated by a unit quaternion e, which is given by , where is the rotated vector [11].
3.1. Euclidean Tangent Space and Rotation Vector Parametrization
The group is a Riemannian manifold, whose elements can be represented in a three-dimensional Euclidean tangent space . Many operations are defined in the Euclidean tangent space, such as the empirical mean and covariance. Furthermore, there are direct and inverse mappings between the manifold and its tangent space, , with exponential and logarithm functions, respectively.
Let be a unit quaternion and be a rotation vector representing a rotation about the unit axis w. The unit quaternion to rotation vector mapping, called logarithm mapping, is given by [17]:
(1) |
where the quaternion antipodal ambiguity is treated by checking the signal of v.
The inverse mapping, called exponential mapping, is [17]:
(2) |
For brevity, logarithm (1) and exponential (2) mappings are written as and , respectively.
3.2. Sum, Subtraction, and Weighted Mean Operations
We define now the operations of sum, subtraction, and weighted mean for unit quaternion states. The difference between and is defined as
(3) |
Similarly, for the Euclidean vectors and , this operation is giving by .
The sum of a unit quaternion and a rotation vector , is defined as
(4) |
In Euclidean space, this operation is .
Lastly, the weighted mean operation for a set of unit quaternions , , is defined as
(5) |
where is a set of corresponding weights. The quaternion mean can be computed in a closed form by [34]
(6) |
where , and the quaternion mean is the eigenvector of M corresponding to the maximum eigenvalue. Iterative algorithms can also be used, as the gradient descent algorithm presented in Refs. [10,11].
3.3. Quaternion Unscented Transform
The unscented transform (UT) is the main core of UKF. The UT approximates the mean and its covariance of a random variable y obtained from the nonlinear transformation , where and are random variables with mean e and covariance matrices and , respectively, and c a known deterministic variable. In addition, the random variable is composed by a unit quaternion part and a unconstrained Euclidean part ; thus .
Now, we define the augmented state vector as
(7) |
where , as well as the augmented covariance matrix
(8) |
The UT is based on a set of deterministically chosen samples known as sigma points (SP). The sigma points and the associated weights , can be chosen asx
(9) |
(10) |
where is the jth column of matrix , is the Cholesky square root operation, and is a row vector with elements equal to one. Notice that the columns of the covariance matrix can be seen as a perturbation variable, where the unit quaternion part is parameterized as a rotation vector, which means that the covariance matrix is defined in the tangent space, hence the dimension. The SP (9) can be partitioned as
(11) |
where and .
Then each sigma point is propagated through h:
(12) |
where is the jth column of the matrix .
From (12), we obtain , and as
(13) |
(14) |
(15) |
At this point it is important to mention that Equations (9) and (13)–(15) differ from the one in the standard UT transform because they consider the quaternion operations previously defined in this section.
From now on, for notation simplicity, we define the quaternion unscented transformation as the function UT(·) comprising the set of Equations (9)–(15) as:
(16) |
4. Mathematic Modeling
This section describes the discrete time dynamic model used by the filtering algorithm presented in this paper.
4.1. Kinematic Model of Attitude
Assuming that angular rates , measured by a 3-axis gyros from the input vector of the dynamic system, the discrete-time attitude model is given by [15]
(17) |
where is an operator that takes the four coefficients of the unit quaternion and stacks them in a 4-vector, k denotes the discrete time, and
We assume that is corrupted with random noise and bias terms, modeled as , in which “” denotes a measured variable, are angular rates measured by a 3-axis gyros, are bias terms, and is the input random noise. To directly use the measured inputs in (17), bias terms and random noise are estimated and subtracted from the measurement. Then,
(18) |
A more general model for gyrometers is , where denotes the matrix of scale factors and misalignment. This model is more appropriate for in-lab calibration [2]. Thus, in this paper, we assume that scale factors and misalignment have already been determined and compensated, and only the biases are estimated [35].
Due to bias, which may vary in time, the attitude estimated based on gyros measurements may suffer a temporal drift. To minimize this problem, bias terms are modeled as a random walk process,
(19) |
where and are jointly estimated with the other system states, yielding a joint state vector .
Equations (17) and (19) compose the process model, which can be compactly presented as
(20) |
where f denotes a nonlinear function of previous state , with input , and process noise .
4.2. Observation Model
The observation model relates the components of state vector with the output measurement vector , defined as . Measurements are corrupted by random errors and modeled as , where is the measurement noise parameterized as a rotation vector. Therefore, the observation model may be written as
(21) |
In this paper, the measured acceleration and magnetic field are used to compute the unit quaternion . Assuming normalized measurements such that and , the unit quaternion representing the body attitude can be computed as [13,29]:
(22) |
where is the conjugate of and
(23) |
(24) |
where , , , , and such that .
Because these equations are nonlinear, the unscented transform, given in Equation (16), is used to propagate the measured acceleration error and magnetic field error through Equations (22)–(24). Then,
(25) |
where forms a block diagonal matrix with matrices A and B, and is given by Equation (22).
5. State Estimators
We assume that our dynamic system is modeled by the nonlinear Equations (20) and (21) in which, , the known data are the measured output and input . It is also assumed that process noise and measurement noise are mutually independent with covariance matrices and , respectively. The state estimation problem aims at providing approximations for the mean and covariance that characterize the a posteriori probability density function (PDF) .
Due to the nonlinear characteristics of the model, our proposition is to use as the basis to our approach the unscented Kalman filter (UKF) [36]. In the standard form of the UKF, two problems arise when it is used to estimate attitude: (i) the UKF pertains to Euclidean systematization, therefore containing sum and weighting operations, which are not defined for unit quaternions; (ii) the output measured noise can have time-varying statistical properties, which can, in the worst case, lead to diverging estimates. Regarding (i), most of the issues are solved if the modified unscented transform presented in Section 3.3 is applied in the place of the standard one, as shown in Section 5.1. The solution of (ii) is our core contribution. We consider two events that may change the statistical properties of measured noise: a dynamic event, such as linear accelerations that mask the gravity vector projection measured by accelerometers; and a external influence, such as a ferromagnetic element that disturbs the Earth’s magnetic field measured by the magnetometers. The rejection of these perturbations is addressed in Section 5.2 and Section 5.3.
5.1. Quaternion-Based UKF
The UKF algorithm presented in this section is based on the ones shown in Refs. [11,17], which are slightly modified to encompass direct unit quaternion measurements and multiplicative noise in the process. Henceforth, the notation indicates an estimate of at time k based on information available up to and including time . Likewise, indicates an estimate of at time k based on information available up to and including time k. Let the process noise be partitioned as with covariance matrix , where is the noise nonlinearly related to the state vector and is the linear partition of noise. To improve the numerical stability of the filter, additive noise is considered for all states [37].
Given these definitions, the modified quaternion-based unscented Kalman filter (QUKF) forecast step is given by
(26) |
(27) |
(28) |
(29) |
(30) |
where is the innovation. The augmented state vector and the corresponding covariance matrix are respectively given by
with .
The state estimate and error covariance matrix are updated using information from in the data-assimilation step, given by:
(31) |
(32) |
(33) |
5.2. Adaptive Covariance Matrix
The uncertainty of measurements in the UKF is represented by covariance matrix , which is usually constant. However, the measurement uncertainties can be time-varying. We then propose the use of innovation to adjust the measurement covariance matrix online through the covariance matching (CM) approach [18].
Based on the assumption that the observation covariance matrix is constant during a sliding sampling window with finite length N, the basic idea of CM is to make the innovation consistent with its covariance . Notice that the innovation pertains to the three-dimensional Euclidean tangent space. Thus, the covariance of is estimated as based on the last N innovation samples as
(34) |
Notice that, the UKF (see Equation (29)) approximates the covariance by , where . Then, can be estimated by
(35) |
To avoid negative values due the subtraction operation in Equation (35), negative values in are replaced by their correspondent value in the nominal covariance matrix .
5.3. Outlier Rejection
Outliers are spurious data that contaminate the statistical distribution. The contaminated measurements deviate significantly from the normal observations, which directly reflects in the innovation value , and, consequently, in the covariance estimated by CM.
The Hampel identifier [38] is an outlier identification method that is reported as extremely effective in practice [39]. Based on this approach, our contribution is to compute a gain to be used as a multiplier that reduces the outlier influence in the estimation of the covariance matrix and also on the Kalman gain. This gain is a diagonal matrix, wherein each the diagonal is defined as
(36) |
where is the median absolute deviation (MAD), is the number of standard deviations (confidence region) by which the innovation sample must differ from the local median, is the median operator, is a moving window with size N, is an index for each element of the moving window, and i is the index of each element of the innovation vector.
5.4. Quaternion-Based Robust Adaptive Unscented Kalman Filter
By combining Equations (35) and (36) with the QUKF Equations (26)–(33), we then obtain a three step algorithm that we call quaternion-based robust adaptive unscented Kalman filter (QRAUKF). The first step is the forecast step, which is given by Equations (26)–(28) and (30). The second step is the robust noise estimation given by Equation (36), the estimate covariance
(37) |
and (29). The third and last step is the data-assimilation step, which is given by Equations (31) and (33), and
(38) |
6. Experimental Results and Discussion
In this section we compare the performance of the proposed QRAUKF algorithm to the QUKF, the complementary filter (CF) proposed in Ref. [32], and the commercial algorithm embedded in the MicroStrain 3DM-GX1 IMU. We implemented QRAUKF using Matlab (Our code is available at https://bitbucket.org/coroufmg/raukf_cm).
Actual data was collected at 40 Hz from the IMU, which was mounted on the end effector of a Comau Smart Six manipulator, used to perform controlled movements and to provide accurate orientation information. Figure 2 illustrates our setup.
To set QUKF and QRAUKF, we have assumed that the covariance matrix is diagonal with elements related to the angular rates measured by the gyros. This matrix was estimated as deg/s. The additive noise of process was represented by the diagonal matrix . This matrix is related to the attitude, parametrized as a rotation vector, and the bias terms of the gyros. The standard deviations were empirically set as deg and deg/s, for attitude and bias terms, respectively. The measured acceleration and magnetic field are propagated through the nonlinear function represented by Equations (22)–(24). Standard deviations of accelerometer and magnetometer are m/s and Gauss [G], respectively. The nominal covariance matrix of measurements is computed by the UT. The sliding window size of RAUKF was empirically set to be samples, which represents a period of s during which the noise covariance is assumed to be constant, and the confidence region standard deviations. CF has two parameters, the gain that quantifies the gyro measurement noise, set as , and the gain that quantifies the bias terms, set as . These values follows the authors recommendations [32]. The standard deviations , , and were estimated from experimental data. For this, we have used a window of approximately s. During this calibration process, the MARG sensor was kept stationary (steady-state behavior). The tuning parameters were estimated before performing the main state estimation experiments, during which they remain unaltered. Observe that the measurement covariance matrix is updated online, in contrast with the process covariance matrices and , that also remain unaltered. Although we used a simplistic parameter estimation approach, the parameterization seems to be appropriate, even for different experiments.
Five disturbance scenarios were evaluated: (i) abrupt and (ii) slow varying magnetic disturbances; (iii) linear accelerations; (iv) individual axis rotation about the origin; and (v) simultaneous axes rotations about the origin. The last two experiments, scenarios (iv)–(v), suffer linear accelerations due to the lever arm between the end effector of robot and IMU (Videos showing the experiments are found at: https://goo.gl/mtFSqG).
6.1. Magnetic Field Distortion
Heading estimation is performed by monitoring the Earth’s magnetic field with the magnetometer. Due to the proximity of ferrous or magnetic materials, the magnetic field can be locally distorted, which causes inaccurate estimates of heading angle. In our first experiment, the magnetic brakes of the robot manipulator are turned on and off a few times, thus causing an abrupt variation in the magnetic field that is perceived by the magnetometers. Due to the shaking caused by the release of the brakes, some spikes of acceleration also appear. Figure 3 shows the acceleration and magnetic field measurements, and the attitude estimation error for each axis. The disturbance periods are highlighted. Observe that the QUKF is more sensitive to outliers in the acceleration and magnetic field measurements, converging quickly to wrong estimates induced by inaccurate measurements. This behavior is expected, once QUKF does not have any treatment for abnormal measurements. In contrast, QRAUKF, CF, and 3DM-GX1 algorithms reject the outliers. Table 1 shows the Root Mean Square Error (RMSE) for this experiment in the column called “Abrupt magnetic”. Observe that QRAUKF performs better than other algorithms, with the smaller RMSE. In contrast, QUKF yields the largest RMSE indices.
Table 1.
Abrupt Magnetic | Slow Magnetic 1 | Slow Magnetic 2 | |||||||
---|---|---|---|---|---|---|---|---|---|
Algorithm | |||||||||
QRAUKF | 0.05 | 0.04 | 0.07 | 0.07 | 0.09 | 1.84 | 0.40 | 0.19 | 3.11 |
QUKF | 0.05 | 0.05 | 0.20 | 0.98 | 0.51 | 13.0 | 1.66 | 0.27 | 12.52 |
CF | 0.07 | 0.06 | 0.14 | 9.22 | 11.00 | 28.90 | 3.20 | 0.86 | 8.97 |
3DM-GX1 | 0.16 | 0.18 | 0.09 | 0.12 | 0.09 | 11.28 | 0.35 | 0.27 | 9.8 |
In a second experiment, the magnetic field was artificially and slowly disturbed with a magnetic material. Figure 4 shows the acceleration and magnetic field measurements, and the attitude error for each axis. This kind of perturbation is usually difficult to detect and can damage the estimation. Notice that QRAUKF is less sensitive to the slow varying abnormal measurement. CF yields the worst results as shown by RMSE in Table 1, in the column called “Slow magnetic 1”. Figure 5 shows the bias estimation in y and z-directions. Observe that the abnormal behavior of the magnetic field affects the bias estimates of angular rate in all directions for QUKF and CF, which in turns does not happen with QRAUKF.
In a third experiment, the magnetic field was also artificially and slowly disturbed with magnetic material. Although similar to the previous experiment, in this one the magnetic field is continually disturbed during 30 s. Figure 6 shows the measurements and attitude estimation error for each axis. In addition to magnetic disturbance, during the experiment we accidentally touched the manipulator with the magnet and observed that the accelerometers and gyros also measure abrupt changes just before 10 s and 20 s. Figure 7 shows angular rate measurements for this experiment. All algorithms, except QUKF, are robust to outliers in acceleration and magnetic field measurements, however, as can be seen by the error results, all algorithms have large peak errors and . These large errors are caused by the outliers in the angular rate measurements, that are not handled by the algorithms. In spite of these outliers, notice that QRAUKF shows the best result, as can be seen in Table 1, column “Slow magnetic 2”.
6.2. Linear Acceleration Disturbance
Roll and pitch angles are computed by the projection of the gravity vector, which is measured by the accelerometer. However, the accelerometer measures the linear body acceleration together with the gravity vector, which masks the gravity vector observation. Thus, the linear acceleration disturbs the observation of , , and consequently the heading angle .
To test the behavior of the algorithms against the perturbation of linear velocities, the manipulator executed independent translational movements in each axis. Figure 8a shows the accelerometer measurements. We observed that even when the movements are being executed separately in each axis, linear accelerations appear in all axes. This is probably due to a small angle in the link joining the IMU and the robot end effector. Figure 8b–d shows the attitude error. Table 2 shows the values of RMS for this and other experiments. Notice that the QUKF provides the worst results. In contrast, QRAUKF yields the best RMSE indexes and the smallest peak-error for heading angle. We also observe that after 30 s, the attitude error for QRAUKF grows due to the longer time exposed to linear acceleration perturbation. In fact, the QRAUKF estimates tend to converge to the value induced by the perturbed measurement after a period of time.
Table 2.
Linear Acceleration | Individual Rotations | Simultaneous Rotations | |||||||
---|---|---|---|---|---|---|---|---|---|
Algorithm | |||||||||
QRAUKF | 0.28 | 0.87 | 0.16 | 1.08 | 1.31 | 0.91 | 2.88 | 1.94 | 1.37 |
QUKF | 4.0 | 3.78 | 2.36 | 1.97 | 1.73 | 2.23 | 2.76 | 2.08 | 4.20 |
CF | 1.87 | 1.60 | 0.53 | 1.17 | 1.61 | 1.17 | 2.97 | 2.54 | 2.03 |
3DM-GX1 | 0.37 | 0.99 | 0.39 | 1.08 | 1.34 | 1.37 | 2.88 | 2.17 | 2.06 |
6.3. Rotations about the Origin
In our last two experiments, presented in Figure 9 and Figure 10, rotations about the origin in each axis separately and simultaneously were performed. In these cases, estimates are influenced by linear accelerations that appear due to a lever arm between the IMU and the robot end effector. Figure 9a and Figure 10a show the actual movement performed by the manipulator. Again, the proposed algorithm yields the best results, as shown by Table 2. Notice by Figure 9 that QRAUKF and 3DM-GX1 algorithm have similar errors, however, QRUKF converges faster to measurement after the perturbation finishes. The poor performance of KF and CF is due to bias estimates that are influenced by linear acceleration.
7. Conclusions
In this paper, a quaternion-based robust adaptive unscented Kalman filter for orientation estimation was presented. The algorithm ensures the unit norm of quaternion in all algorithm steps without forcing a normalization. The logarithmic map of unit quaternions is used to parametrize the error quaternion. This parameterization allows us to perform operations in Euclidean space and then use existing approaches to adapt the measurement covariance matrix and detect outliers. Due to the nonlinear nature of this transformation, unscented transform is used to compute the measured quaternion.
The proposed algorithm was compared to a nonadaptive version of UKF, a complementary filter, and commercial algorithm embedded in the IMU. Some experiments were performed to verify the performance of the algorithms in situations where distorted magnetic field and linear accelerations exist. The proposed algorithm shows the best RMSE results in all situations tested, and the smallest peak-error for linear acceleration disturbance. In addition, the proposed algorithm accurately estimates the gyros bias terms. Although in this paper we only show attitude estimation, the proposed methodology can be used along the standard UKF equations to estimate the full state vector of vehicles. The same ideas for disturbance rejection can also be extended for other vehicle states, once the sum and subtraction operations defined in Section 3.2 are the usual operations for Euclidean states.
Author Contributions
A.C.B.C. was the main developer of the proposed methodology. He also performed experiments, analyzed the results and wrote most of this manuscript. B.O.S.T. and G.A.S.P. co-supervised the entire work. They directly contributed with the methodology, planning of experiments, analysis of results and writing of the manuscript.
Funding
This work was partially supported by FAPEMIG/Brazil, grant TEC-APQ-00850-15 and CNPq/Brazil, grant 465755/2014-3 (National Institute of Science and Technology). A. Chiella holds a scholarship from CAPES/Brazil. B. Teixeira and G. Pereira hold research fellowships from CNPq/Brazil.
Conflicts of Interest
The authors declare no conflict of interest.
References
- 1.Jang J.S., Liccardo D. Small UAV automation using MEMS. IEEE Aerosp. Electron. Syst. Mag. 2007;22:30–34. doi: 10.1109/MAES.2007.365332. [DOI] [Google Scholar]
- 2.Groves P.D. Principles of GNSS, Inertial, and Multisensor Integrated Navigation Systems. Artech House; Norwood, MA, USA: 2013. [Google Scholar]
- 3.Yadav N., Bleakley C. Accurate orientation estimation using AHRS under conditions of magnetic distortion. Sensors. 2014;14:20008–20024. doi: 10.3390/s141120008. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Vartiainen P., Bragge T., Arokoski J.P., Karjalainen P.A. Nonlinear State-Space Modeling of Human Motion Using 2-D Marker Observations. IEEE Trans. Biomed. Eng. 2014;61:2167–2178. doi: 10.1109/TBME.2014.2318354. [DOI] [PubMed] [Google Scholar]
- 5.Ding Y., Gao T., Wu Y., Zhu S. The research of a new data glove based on MARG sensor and magnetic localization technology; Proceedings of the AIP Conference Proceedings; Xi’an, China. 20–21 January 2018; p. 040098. [Google Scholar]
- 6.Michel T., Genevès P., Fourati H., Layaïda N. On attitude estimation with smartphones; Proceedings of the IEEE International Conference on Pervasive Computing and Communications; Kona, HI, USA. 13–17 March 2017; pp. 267–275. [DOI] [Google Scholar]
- 7.Gui H., de Ruiter A.H. Quaternion Invariant Extended Kalman Filtering for Spacecraft Attitude Estimation. J. Guid. Control Dyn. 2017;41:863–878. doi: 10.2514/1.G003177. [DOI] [Google Scholar]
- 8.Pereira G.A.S., Iscold P., Torres L.A.B. Airplane attitude estimation using computer vision: Simple method and actual experiments. Electron. Lett. 2008;44:1303–1304. doi: 10.1049/el:20081184. [DOI] [Google Scholar]
- 9.Costanzi R., Fanelli F., Monni N., Ridolfi A., Allotta B. An Attitude Estimation Algorithm for Mobile Robots Under Unknown Magnetic Disturbances. IEEE/ASME Trans. Mechatron. 2016;21:1900–1911. doi: 10.1109/TMECH.2016.2559941. [DOI] [Google Scholar]
- 10.Chiella A.C.B., Teixeira B.O.S., Pereira G.A.S. Robust attitude estimation using an adaptive unscented Kalman filter (forthcoming); Proceedings of the 2019 IEEE International Conference on Robotics and Automation (ICRA); Montreal, QC, Canada. 20–24 May 2019; pp. 7748–7754. [Google Scholar]
- 11.Sipos B.J. Application of the manifold-constrained unscented Kalman filter; Proceedings of the 2008 IEEE/ION Position, Location and Navigation Symposium; Monterey, CA, USA. 5–8 May 2008; pp. 30–43. [DOI] [Google Scholar]
- 12.Yuan X., Yu S., Zhang S., Wang G., Liu S. Quaternion-based unscented Kalman filter for accurate indoor heading estimation using wearable multi-sensor system. Sensors. 2015;15:10872–10890. doi: 10.3390/s150510872. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Valenti R.G., Dryanovski I., Xiao J. A linear Kalman filter for MARG orientation estimation using the algebraic quaternion algorithm. IEEE Trans. Instrum. Meas. 2016;65:467–481. doi: 10.1109/TIM.2015.2498998. [DOI] [Google Scholar]
- 14.Lefferts E.J., Markley F.L., Shuster M.D. Kalman filtering for spacecraft attitude estimation. J. Guid. Control Dyn. 1982;5:417–429. doi: 10.2514/3.56190. [DOI] [Google Scholar]
- 15.Crassidis J.L., Markley F.L. Unscented filtering for spacecraft attitude estimation. J. Guidance Control Dyn. 2003;26:536–542. doi: 10.2514/2.5102. [DOI] [Google Scholar]
- 16.Hertzberg C., Wagner R., Frese U., Schröder L. Integrating generic sensor fusion algorithms with sound state representations through encapsulation of manifolds. Inf. Fusion. 2013;14:57–77. doi: 10.1016/j.inffus.2011.08.003. [DOI] [Google Scholar]
- 17.Menegaz H.T., Ishihara J.Y. Unscented and square-root unscented Kalman filters for quaternionic systems. Int. J. Robust Nonlinear Control. 2018:1–28. doi: 10.1002/rnc.4249. [DOI] [Google Scholar]
- 18.Mehra R. Approaches to adaptive filtering. IEEE Trans. Autom. Control. 1972;17:693–698. doi: 10.1109/TAC.1972.1100100. [DOI] [Google Scholar]
- 19.Li X.R., Bar-Shalom Y. A recursive multiple model approach to noise identification. IEEE Trans. Aerosp. Electron. Syst. 1994;30:671–684. doi: 10.1109/7.303738. [DOI] [Google Scholar]
- 20.Hide C., Moore T., Smith M. Adaptive Kalman filtering algorithms for integrating GPS and low cost INS; Proceedings of the Position Location and Navigation Symposium; Monterey, CA, USA. 26–29 April 2004; pp. 227–233. [Google Scholar]
- 21.Moghaddamjoo A., Kirlin R.L. Robust adaptive Kalman filtering with unknown inputs. IEEE Trans. Acoust. Speech Signal Process. 1989;37:1166–1175. doi: 10.1109/29.31265. [DOI] [Google Scholar]
- 22.Pearson R.K., Neuvo Y., Astola J., Gabbouj M. Generalized Hampel Filters. EURASIP J. Adv. Signal Process. 2016;2016:87. doi: 10.1186/s13634-016-0383-6. [DOI] [Google Scholar]
- 23.Soken H.E., Hajiyev C. Pico satellite attitude estimation via robust unscented Kalman filter in the presence of measurement faults. ISA Trans. 2010;49:249–256. doi: 10.1016/j.isatra.2010.04.001. [DOI] [PubMed] [Google Scholar]
- 24.Lee D., Vukovich G., Lee R. Robust Adaptive Unscented Kalman Filter for Spacecraft Attitude Estimation Using Quaternion Measurements. J. Aerosp. Eng. 2017;30:04017009. doi: 10.1061/(ASCE)AS.1943-5525.0000718. [DOI] [Google Scholar]
- 25.Ghobadi M., Singla P., Esfahani E.T. Robust Attitude Estimation from Uncertain Observations of Inertial Sensors Using Covariance Inflated Multiplicative Extended Kalman Filter. IEEE Trans. Instrum. Meas. 2018;67:209–217. doi: 10.1109/TIM.2017.2761230. [DOI] [Google Scholar]
- 26.Tong X., Li Z., Han G., Liu N., Su Y., Ning J., Yang F. Adaptive EKF Based on HMM Recognizer for Attitude Estimation Using MEMS MARG Sensors. IEEE Sens. J. 2018;18:3299–3310. doi: 10.1109/JSEN.2017.2787578. [DOI] [Google Scholar]
- 27.Euston M., Coote P., Mahony R., Kim J., Hamel T. A complementary filter for attitude estimation of a fixed-wing UAV; Proceedings of the 2008 IEEE/RSJ International Conference on Intelligent Robots and Systems; Nice, France. 22–26 September 2008; pp. 340–345. [DOI] [Google Scholar]
- 28.Madgwick S.O.H., Harrison A.J.L., Vaidyanathan R. Estimation of IMU and MARG orientation using a gradient descent algorithm; Proceedings of the IEEE International Conference on Rehabilitation Robotics; Zurich, Switzerland. 27 June–1 July 2011; pp. 1–7. [DOI] [PubMed] [Google Scholar]
- 29.Valenti R.G., Dryanovski I., Xiao J. Keeping a good attitude: A quaternion-based orientation filter for IMUs and MARGs. Sensors. 2015;15:19302–19330. doi: 10.3390/s150819302. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 30.Wang L., Fu L., Hu X. A nonlinear complementary filter approach for MAV 3D-attitude estimation with low-cost MARG/ADS; Proceedings of the 2016 IEEE/ION Position, Location and Navigation Symposium (PLANS); Savannah, GA, USA. 11–14 April 2016; pp. 42–47. [DOI] [Google Scholar]
- 31.Menegaz H.M.T., Ishihara J.Y., Kussaba H.T.M. Unscented Kalman Filters for Riemannian State-Space Systems. IEEE Trans. Autom. Control. 2019;64:1487–1502. doi: 10.1109/TAC.2018.2846684. [DOI] [Google Scholar]
- 32.Madgwick S.O. An Efficient Orientation Filter for Inertial and Inertial/Magnetic Sensor Arrays. University of Bristol; Bristol, UK: 2010. Technical Report. [Google Scholar]
- 33.Kim S., Haschke R., Ritter H. Gaussian mixture model for 3-Dof orientations. Robot. Auton. Syst. 2017;87:28–37. doi: 10.1016/j.robot.2016.10.002. [DOI] [Google Scholar]
- 34.Markley F.L., Cheng Y., Crassidis J.L., Oshman Y. Averaging quaternions. J. Guid. Control Dyn. 2007;30:1193–1197. doi: 10.2514/1.28949. [DOI] [Google Scholar]
- 35.Markley F.L., Crassidis J.L. Fundamentals of Spacecraft Attitude Determination and Control. Volume 33 Springer; New York, NY, USA: 2014. [Google Scholar]
- 36.Julier S.J., Uhlmann J.K. Unscented filtering and nonlinear estimation. Proc. IEEE. 2004;92:401–422. doi: 10.1109/JPROC.2003.823141. [DOI] [Google Scholar]
- 37.Xiong K., Zhang H., Chan C. Performance evaluation of UKF-based nonlinear filtering. Automatica. 2006;42:261–270. doi: 10.1016/j.automatica.2005.10.004. [DOI] [Google Scholar]
- 38.Davies L., Gather U. The Identification of Multiple Outliers. J. Am. Stat. Assoc. 1993;88:782–792. doi: 10.1080/01621459.1993.10476339. [DOI] [Google Scholar]
- 39.Pearson R.K. Outliers in process modeling and identification. IEEE Trans. Control Syst. Technol. 2002;10:55–63. doi: 10.1109/87.974338. [DOI] [Google Scholar]