A Robust and Adaptive Complementary Kalman Filter Based on Mahalanobis Distance for Ultra Wideband/Inertial Measurement Unit Fusion Positioning

Ultra wideband (UWB) has been a popular technology for indoor positioning due to its high accuracy. However, in many indoor application scenarios UWB measurements are influenced by outliers under non-line of sight (NLOS) conditions. To detect and eliminate outlying UWB observations, we propose a UWB/Inertial Measurement Unit (UWB/IMU) fusion filter based on a Complementary Kalman Filter to track the errors of position, velocity and direction. By using the least squares method, the positioning residual of the UWB observation is calculated, the robustness factor of the observation is determined, and an observation weight is dynamically set. When the robustness factor does not exceed a pre-defined threshold, the observed value is considered trusted, and adaptive filtering is used to track the system state, while the abnormity of system state, which might be caused by IMU data exceptions or unreasonable noise settings, is detected by using Mahalanobis distance from the observation to the prior distribution. When the robustness factor exceeds the threshold, the observed value is considered abnormal, and robust filtering is used, whereby the impact of UWB data exceptions on the positioning results is reduced by exploiting Mahalanobis distance. Experimental results show that the observation error can be effectively estimated, and the proposed algorithm can achieve an improved positioning accuracy when affected by outlying system states of different quantity as well as outlying observations of different proportion.


Introduction
Indoor positioning technology is important in a variety of applications, ranging from supermarket shopping to drone positioning and hospital patient tracking [1][2][3]. The ultra wideband (UWB) positioning technology has been particularly popular since it can achieve decimeter-level positioning accuracy under line of sight (LOS) conditions. However, in many practical scenarios such as warehouse robot positioning and emergency response, UWB signal attenuation and even signal loss occurs due to obstruction by personnel and cargo and multi-path effects, resulting in a sharp drop in UWB positioning accuracy [4,5]. The UWB/IMU fusion is an effective way to achieve high-precision positioning under non-line of sight (NLOS) conditions. However, long time positioning cannot be maintained due to the susceptibility of IMU data to integral accumulation errors. In addition, when the motion state of the Adaptive-Robust filtering algorithm is executed; when the observations are abnormal, only the robust part of the Adaptive-Robust filtering algorithm is executed.
The remainder of the paper is organized as follows: in Section 2, the UWB/IMU fusion algorithm based on CKF is discussed, and the motion model and observation model of the algorithm are introduced. The principle of the Adaptive-Robust algorithm based on Mahalanobis distance is presented in Section 3, including a description of the calculation of the robustness factor of the observation. Several experiments are conducted and the results are analyzed in Section 4. Finally, conclusions are drawn in Section 5.

The UWB/IMU Fusion Filter
An overview of the proposed UWB/IMU fusion method is shown in Figure 1. As illustrated, the method is based on the CKF algorithm, and the Adaptive-Robust filtering is conducted on the abnormal system state or abnormal observations according to the robustness factor of the observations. Then, the state error obtained by filtering is fed back to the Navigation Equations to calculate the position, velocity and direction. The core of the algorithm is divided into four parts and discussed in this section.

IMU Navigation Equations
Following the method in [21], the state in the CKF algorithm is defined as: is the position error, is the velocity error, is direction error, is the gyroscope bias, and is the acceleration bias. is a 15-dimensional vector. The first three navigation state vectors are defined in navigation frame (n-frame), and the last two bias vectors are in body frame (b-frame).
By integrating the gyroscope and acceleration data, the position, velocity and direction data in n-frame can be obtained. The IMU navigation equation in continuous-time state is defined as: represents the transformation from b-frame to n-frame. , , represent the first derivative of position, velocity and attitude, respectively.
is the gravity vector under n-frame, is the acceleration vector under b-frame, and = [ , , ] is the angular velocity in b-frame.
[ ×] is the skew-symmetric matrix of angular velocity, defined as follows:

IMU Navigation Equations
Following the method in [21], the state in the CKF algorithm is defined as: X = [δp n δv n ε b g b a ], where δp n is the position error, δv n is the velocity error, ε is direction error, b g is the gyroscope bias, and b a is the acceleration bias. X is a 15-dimensional vector. The first three navigation state vectors are defined in navigation frame (n-frame), and the last two bias vectors are in body frame (b-frame).
By integrating the gyroscope and acceleration data, the position, velocity and direction data in n-frame can be obtained. The IMU navigation equation in continuous-time state is defined as: . v n = C n b f b + g n (2) .
C n b represents the transformation from b-frame to n-frame. x , ω b y , ω b z is the angular velocity in b-frame.
[ω b ×] is the skew-symmetric matrix of angular velocity, defined as follows: For the acceleration and the gyroscope observations at moment k, their biases b a and b g , which are estimated as the state parameters of the CKF algorithm, must be firstly removed as follows: f b k and ω b k represent the observations of the original acceleration and angular velocity, respectively, andf b k andω b k are the values after the biases are compensated. The acceleration transformation from moment k to moment (k + 1) is:f denotes vector cross product, representing the rotation correction on the acceleration by the angular velocity change.
The velocity transformation from moment k to moment (k + 1) is: δv n k represents the velocity error at moment k, which is estimated as the state parameter of the CKF algorithm.
The position transformation from moment k to moment (k + 1) is: δp n k represents the position error at moment k, which is estimated as the state parameter of the CKF algorithm.
The attitude transformation from moment k to moment (k + 1) is: Firstly, the correction of direction error is conducted on the attitude change matrix C n b,k at moment k, and C n b,k+1 is obtained, wherein the direction error ε is cyclically calculated by the CKF algorithm. Then, the compensated rotation from moment k to moment (k + 1) is conducted on C n b,k+1 , and C n b,k+1 , the rotation matrix at moment (k + 1) is obtained. In order to improve the system stability, the value of C n b,k+1 should be periodically normalized, otherwise the matrix C n b,k+1 might become singular.

State Transformation Model
In order to track the five state parameters in the state model of the CKF algorithm, the state transformation model must be derived. The differential equation of the system dynamic model under continuous-time is defined as follows: where F is the state transformation matrix of the system, and W is the system noise. Since the inputs of the IMU and UWB are discretized data, Equation (12) is discretized as: In order to determine F k , the transformation formula of state X = [δp n δv n ε b g b a ] must be derived, which consists of the following steps.
(1) Equation of acceleration bias and gyroscope bias The measurement equations for acceleration and gyroscope are as follows: where f b and ω b are the measurements of the acceleration and the angular velocity respectively; f b and ω b are the true values of the acceleration and the angular velocity respectively. n is the measurement noise which obeys the Gaussian distribution, and its covariance is defined as N a and N g , respectively for acceleration and angular velocity. b is the drift bias, which is a time-dependent first-order Markov process, defined for acceleration and angular velocity as: µ is the offset noise which obeys the Gaussian distribution. The covariance of the acceleration and the gyroscope is defined as U a and U g , respectively.
(2) Equation of direction error The direction error ε is caused by the gyroscope bias and is defined as: It indicates the transformation of δω b , the measured gyroscope bias, from b-frame to n-frame. δω b is caused by the drift bias and noise of the gyroscope. (

3) Equation of velocity error and position error
The velocity error is caused by the acceleration error. Since the direction error can result in acceleration error, which will further result in velocity error, the velocity error is defined as: where [ f n ×]ε represents the influence of the direction error on the acceleration, and δ f b is the measurement error caused by the drift bias and noise of the acceleration, defined as: The position error is defined as: Based on the state transformation equation of the five parameters in X = [δp n δv n ε b g b a ], the state transformation matrix F of the system is derived as: where 0 and I represent a 3 × 3 null matrix and a 3 × 3 identity matrix, respectively. The system noise W is: The covariance matrix Q of the system noise W is: where N and U represent 3 × 3 diagonal matrices, and the noise transformation matrix is defined as: We discretize the noise covariance matrix Q to get Q k as follows: By now, ∅ k and Q k in the CKF algorithm has been defined. Z k ,H k , R k and other matrices will be defined in Section 2.3.

Observation Model
Given the known coordinates of n beacons denoted as S i = S x,i , S y,i , S z,i , i ∈ (1, n), the observation function is defined as: wherep ins,k = (x k ,ŷ k ,ẑ k ) is the position coordinate calculated by the IMU; δp n k = (δx k , δŷ k , δẑ k ) is the priori position error calculated by the state transformation equation; . represents the Euclidean distance. Equation (29) represents the difference between two ranging values: the first ranging value is from the beacon to the IMU integration position including the position error; the second ranging value The observation is defined as: where r k is the ranging data of UWB. Equation (31) represents the difference between the UWB ranging and the distance from the beacon to the position obtained by IMU integration.
The observation equation is defined as: where V k is the measurement noise matrix, and V k ∼ N(0, R k ). R k is the covariance matrix.

Adaptive-Robust Filtering Strategy
The accuracy of UWB sensor observations is affected by ambient temperature, power supply stability, fixed obstacles, and even people or objects moving in the environment. Therefore, the confidence of UWB observations must be estimated. A calculation method based on robustness factor is designed in this paper. The robustness factor is used to adjust the effect of the observation error on the system. The observation error here refers to the error within a certain range, and the observation with particularly large error is defined as abnormal value (outliers) which is processed by the method based on Mahalanobis distance.

Calculation of Robustness Factor
To simplify the description, assume that three beacons are adopted. In the planar positioning, the ith UWB beacon is denoted as Beacon i , and the corresponding coordinates are (x i , y i ). The UWB tag used for positioning is denoted as Tag, and its coordinates are (x, y). The true distance between the Tag and Beacon i is denoted as r i , and its corresponding measurement is denoted as r i . As shown in Figure 2, ideally, r i = r i , the three circles will intersect at a unique point, and its coordinates indicate the position of the tag under the current observation data. To solve this intersection point, an error function is defined and the coordinate of Tag is obtained by minimizing the error function. A feasible error function is: In Equation (33), |.| represents absolute value function. The estimated coordinates of the tag (x , y ), can be obtained by minimizing E(x, y): x , y = argmin (x,y) E(x, y) Ideally, the minimum value of E(x, y) is zero. However, in practice, the measurements contain error. Assume that r i still represents the true distance, and its corresponding error is denoted as ∆r i . At this time, the measurement of the corresponding Beacon i is r i = r i + ∆r i .
( ′, ′), can be obtained by minimizing ( , ): Ideally, the minimum value of ( , ) is zero. However, in practice, the measurements contain error. Assume that still represents the true distance, and its corresponding error is denoted as Δ . At this time, the measurement of the corresponding Beacon is = + Δ . The partial trilateration diagram is shown in Figure 3, showing the intersection of the circles corresponding to the measurements of the three Beacons around the Tag. Obviously, when the measurements contain error, the three circles will intersect each other rather than intersect at one The partial trilateration diagram is shown in Figure 3, showing the intersection of the circles corresponding to the measurements of the three Beacons around the Tag. Obviously, when the measurements contain error, the three circles will intersect each other rather than intersect at one point. In this case, (x , y ), the estimated value of the Tag coordinate, is still obtained by minimizing E(x, y).  The robustness factor of the UWB data is defined as: The larger |Δ | is, the less trustworthy the data is. _ has two functions: firstly, the value of must be limited within a certain range, otherwise it will lead to matrix singularity when is used to modify R ; secondly, it is used as the threshold of the observation error, and the observation error larger than it is treated as outliers and processed by the method based on the Mahalanobis distance. The value of _ is determined by the UWB ranging error within the environment. Generally, the ranging error will increase with increasing distance. Following [9], the UWB ranging error is defined as: where ( ) represents the ranging error at range . Figure 4 shows the error distribution when is within 20 m. Assume that the ranging error obeys the Gaussian distribution, that is, 97% of the ranging errors are within ( ) 3 , and the value of the ranging error greater than ( ) + 3 is regarded as an outlier. Thus, _ is defined as: Figure 5 shows the _ for distance within 20 m. In the experiment environment described The robustness factor of the UWB data is defined as: The larger |∆r i | is, the less trustworthy the data is. C u_max has two functions: firstly, the value of C ui must be limited within a certain range, otherwise it will lead to matrix singularity when C ui is used to modify R k ; secondly, it is used as the threshold of the observation error, and the observation error larger than it is treated as outliers and processed by the method based on the Mahalanobis distance. The value of C u_max is determined by the UWB ranging error within the environment. Generally, the ranging error will increase with increasing distance. Following [9], the UWB ranging error is defined as: where f (d) represents the ranging error at range d. Figure 4 shows the error distribution when d is within 20 m. Assume that the ranging error obeys the Gaussian distribution, that is, 97% of the ranging errors are within f (d) ± 3σ, and the value of the ranging error greater than f (d) + 3σ is regarded as an outlier. Thus, C u_max is defined as: error within the environment. Generally, the ranging error will increase with increasing distance. Following [9], the UWB ranging error is defined as: where ( ) represents the ranging error at range . Figure 4 shows the error distribution when is within 20 m. Assume that the ranging error obeys the Gaussian distribution, that is, 97% of the ranging errors are within ( ) 3 , and the value of the ranging error greater than ( ) + 3 is regarded as an outlier. Thus, _ is defined as: Figure 5 shows the _ for distance within 20 m. In the experiment environment described in Section 4, σ is set to 0.1 m according to UWB positioning tests.   Finally, R is defined as: represents the covariance of the ranging from the ith UWB beacon to the tag. If the number of range measurements is less than 3, e.g., due to occlusion, an effective residual value cannot be obtained, in which case we set to 1.

Adaptive-Robust Filtering Based on Mahalanobis Distance
In general, the noise of the UWB measurement under LOS (Line of Sight) condition obeys the Gaussian distribution, and the observation covariance can be well adjusted by the robustness factor mentioned above, so that the quality of the ranging value can be quantitatively evaluated. However, in the NLOS environment, due to the influence of refraction, obstacles and other factors, the noise model is often difficult to estimate and abnormal observations might appear. To solve this problem, the Mahalanobis distance is used to determine the observation covariance.
Suppose that the noise of the system observation Z , obeys the Gaussian distribution, that is, the observation Z , obeys the Gaussian distribution with the mean of H , X and the variance of Finally, R k is defined as: si represents the covariance of the ranging from the ith UWB beacon to the tag. If the number of range measurements is less than 3, e.g., due to occlusion, an effective residual value cannot be obtained, in which case we set C u to 1.

Adaptive-Robust Filtering Based on Mahalanobis Distance
In general, the noise of the UWB measurement under LOS (Line of Sight) condition obeys the Gaussian distribution, and the observation covariance can be well adjusted by the robustness factor mentioned above, so that the quality of the ranging value can be quantitatively evaluated. However, in the NLOS environment, due to the influence of refraction, obstacles and other factors, the noise model is often difficult to estimate and abnormal observations might appear. To solve this problem, the Mahalanobis distance is used to determine the observation covariance.
Suppose that the noise of the system observation Z k,i obeys the Gaussian distribution, that is, the observation Z k,i obeys the Gaussian distribution with the mean of H k,i X k and the variance of The subscript i here is associated with the specific beacon, and P − k is the a priori covariance of the system. γ k,i , the square of the Mahalanobis Distance from Z k,i to H k,i X k obeys the χ 2 distribution [22]: where χ 2 1 represents a χ 2 distribution with the degree of freedom of 1. For the significance level α, we have: where Pr() is the probability of a random event, and χ 2 1,α is the α-quantile of the χ 2 distribution with the degree of freedom of 1. An observation that does not pass this test is considered outlier and its covariance is increased to weaken its effect on the posteriori estimation. The new matrix of the observation covariance can be updated according to the following equation: represents the ratio of the Mahalanobis distance to the threshold at the current observation.
In this paper, the significance level α is set to 0.001, and the corresponding value of χ 2 1,α is 6.2 according to the Chi-Square Distribution Table. On the other hand, if the observations are correct while the system state is abnormal, the method based on the Mahalanobis distance can also be used to correct the state. An abnormal system state is caused by two reasons: one is the error introduced to the system model due to sudden variation of the state or some unknown biases; the other is the error caused by the incorrect knowledge of the statistics of the process or measurement noises, such as the introduction of unreasonable covariance matrix or an assumed Gaussian distribution perturbed by other distributions. Once an abnormal system state is detected, a fading factor is introduced to inflate the covariance matrix of the state prediction so as to make the filter adaptive. Updating can be conducted according to the following equation: It should be noted that when the correct observation is used to correct the system error, a certain time delay will be introduced, that is, since the occurrence of the abnormal system state, the state error cannot be corrected until the next correct observation comes in. This is slightly different from the abnormal observations that can be corrected in real time. To suppress the effects of the delayed correction, Rauch-Tung-Striebel (RTS) smoothing can be adopted to reverse-process the data from the occurrence of the abnormal system state to the next time the correct observation is received. The algorithm of the proposed Adaptive-Robust CKF is as follows Algorithm 1.
For each measurement 3. if end 11. State update Line 1 is the state prediction stage of the standard CKF algorithm. From Line 2 to Line 10, the robustness factor is calculated for each received observation. The robustness factor, not only adjusts the UWB ranging error, but also distinguishes whether the positioning error is caused by the abnormal system state or the abnormal observation, so as to make a targeted adjustment. If the system state error and the observation error occur at the same time, the latter will be prioritized by the proposed algorithm and the system state error can only be corrected when a reliable observation is received. Line 11 is the state update of the standard CKF algorithm.

Experiments
For the evaluation of the proposed UWB/IMU fusion positioning method a test site was established in the underground garage of the University of Melbourne as shown in Figure 6. Four selected UWB beacons were placed on four brackets, forming a rectangular area of approximately 10 m × 5 m. The DWM1000 of Decawave Company (Burlingame, CA, USA) was adopted as the UWB tag/beacon, and was attached to a trolley. The X-IMU of the British company X-IO (London, UK) was selected as the IMU device, and was fixed 5 cm below the UWB tag, as shown in Figure 7. It is 55 × 35 × 18 mm (L × W × H) in size and almost 50 g in weight. Its host of on-board sensors, algorithms and configurable 8-channel auxiliary port make the x-IMU both a powerful sensor and controller. Communication is enabled via USB or Bluetooth for wireless applications. Its key technical specifications are shown in Table 1. The notebook on the trolley received the ranging data from the IMU and UWB at the same time, marking the same timestamp for the IMU data and UWB data. The trolley maintained a constant speed during its movement. 10 m × 5 m. The DWM1000 of Decawave Company (Burlingame, CA, USA) was adopted as the UWB tag/beacon, and was attached to a trolley. The X-IMU of the British company X-IO (London, UK) was selected as the IMU device, and was fixed 5 cm below the UWB tag, as shown in Figure 7. It is 55 × 35 × 18 mm (L × W × H) in size and almost 50 g in weight. Its host of on-board sensors, algorithms and configurable 8-channel auxiliary port make the x-IMU both a powerful sensor and controller. Communication is enabled via USB or Bluetooth for wireless applications. Its key technical specifications are shown in Table 1. The notebook on the trolley received the ranging data from the IMU and UWB at the same time, marking the same timestamp for the IMU data and UWB data. The trolley maintained a constant speed during its movement.     For IMU, the acceleration bias and the gyroscope bias were both dynamically estimated by CKF algorithm, and were used to correct observed values in real time. Axis misalignments error and scale factor error had already been corrected in the IMU calibration process. The other covariance parameters related to noise were set as follows in Table 2:  For IMU, the acceleration bias and the gyroscope bias were both dynamically estimated by CKF algorithm, and were used to correct observed values in real time. Axis misalignments error and scale factor error had already been corrected in the IMU calibration process. The other covariance parameters related to noise were set as follows in Table 2. Two routes were established for the experiments: Route 1 is a rectangular route with fewer turns and Route 2 is an 8-shaped route with more turns, as shown in Figure 8. Each route includes two laps, with both the starting point and the end point located in the lower left corner of the routes. The two red circles in the figure represent two large stone columns in the underground garage, and the rectangular red dots indicate the four beacons. The beacon coordinates and the ground truth trajectories were measured by a laser range finder. In the following, Route 1 is used for adaptivity analysis, and Route 2 is used for robustness analysis.  Two routes were established for the experiments: Route 1 is a rectangular route with fewer turns and Route 2 is an 8-shaped route with more turns, as shown in Figure 8. Each route includes two laps, with both the starting point and the end point located in the lower left corner of the routes. The two red circles in the figure represent two large stone columns in the underground garage, and the rectangular red dots indicate the four beacons. The beacon coordinates and the ground truth trajectories were measured by a laser range finder. In the following, Route 1 is used for adaptivity analysis, and Route 2 is used for robustness analysis. In the experimental analysis, the positioning result of the UWB, the UWB/IMU fusion algorithm based on standard CKF, and the proposed Adaptive-Robust CKF algorithm are denoted as UWB, CKF, and ARCKF, respectively. In the experimental analysis, the positioning result of the UWB, the UWB/IMU fusion algorithm based on standard CKF, and the proposed Adaptive-Robust CKF algorithm are denoted as UWB, CKF, and ARCKF, respectively.

Adaptivity Analysis
To simulate the effect of abnormal observations, the acceleration data recorded along Route 1 was contaminated with white Gaussian noise with an intensity of 50 dBW at three points, resulting in sudden changes of velocity. The comparison of velocity with and without the introduced abnormity is shown in Figures 9 and 10, respectively. It can be seen that the sudden change of acceleration gives rise to the sudden change of velocity, further resulting in the abnormity of the estimated trajectory.   Figure 11 shows the positioning result for Route 1. The red trajectory is the positioning result using the UWB data without any abnormity, and the blue trajectory is the positioning result of the UWB/IMU fusion with abnormal acceleration at 3 points. Figure 11a shows the positioning result of the standard CKF algorithm, in which large deviations can be seen in the overall trajectory. Figure 11b shows the positioning result of the ARCKF algorithm. Although the trajectory estimated by the ARCKF contains some fluctuations, it is significantly improved as compared with the standard CKF.
In Figure 11b, the ARCKF algorithm can identify whether the positioning error is caused by the outlying system state or the outlying observation. Compared with the outlying observation, the system error caused by the outlying acceleration is more difficult to correct, because once the outlying system state occurs, the state error can be corrected only after the next observation is received. Thus, the accumulation of system errors during this period is inevitable. Furthermore, if the subsequent observation is still outlier, its suppression capability on system error is very limited, resulting in a    Figure 11 shows the positioning result for Route 1. The red trajectory is the positioning result using the UWB data without any abnormity, and the blue trajectory is the positioning result of the UWB/IMU fusion with abnormal acceleration at 3 points. Figure 11a shows the positioning result of the standard CKF algorithm, in which large deviations can be seen in the overall trajectory. Figure 11b shows the positioning result of the ARCKF algorithm. Although the trajectory estimated by the ARCKF contains some fluctuations, it is significantly improved as compared with the standard CKF.
In Figure 11b, the ARCKF algorithm can identify whether the positioning error is caused by the outlying system state or the outlying observation. Compared with the outlying observation, the system error caused by the outlying acceleration is more difficult to correct, because once the outlying system state occurs, the state error can be corrected only after the next observation is received. Thus, the accumulation of system errors during this period is inevitable. Furthermore, if the subsequent observation is still outlier, its suppression capability on system error is very limited, resulting in a continuously expanding error. This also explains the phenomenon seen in Figure 11b, that is, the  Figure 11 shows the positioning result for Route 1. The red trajectory is the positioning result using the UWB data without any abnormity, and the blue trajectory is the positioning result of the UWB/IMU fusion with abnormal acceleration at 3 points. Figure 11a shows the positioning result of the standard CKF algorithm, in which large deviations can be seen in the overall trajectory. Figure 11b shows the positioning result of the ARCKF algorithm. Although the trajectory estimated by the ARCKF contains some fluctuations, it is significantly improved as compared with the standard CKF. result is closer to the observation result. Additionally, after receiving the correct observations, the backward RTS smoothing can be applied until the data point which makes the system state abnormal, smoothing the system cumulative error during this period.
(a) (b)   Figure 13 shows the residual values Δ corresponding to the four UWB beacons for Route 1. The optimized residual values are unevenly distributed, but on the whole they have a relatively small range, with a maximum optimized residual of about 0.6 m. There are two reasons for the uneven distribution of residuals: first, the values at some time points jump when the ranging value is blocked by the column or interfered by the pedestrian; second, with the increase of the distance, the UWB ranging error will also increase relatively, and the corresponding residuals will increase accordingly. By analyzing the proportion of the optimized residuals, the robustness factor is dynamically determined to obtain the weight of the observation covariance for all beacons. Figure 14 shows the distribution of robustness factors calculated from residuals Δ . Table 3 lists the number of times the robustness factor reaches the thresholds for each beacon. It can be seen that most data are below _ , with only one time reaching the threshold at Beacon 1 and 2, respectively, indicating that the data are basically reliable. The larger the Δ , the larger the corresponding robustness factor is, so that the observation covariance can be dynamically increased to reduce the influence of the ranging error on the fusion algorithm, improving the accuracy and robustness of the fusion algorithm. In Figure 11b, the ARCKF algorithm can identify whether the positioning error is caused by the outlying system state or the outlying observation. Compared with the outlying observation, the system error caused by the outlying acceleration is more difficult to correct, because once the outlying system state occurs, the state error can be corrected only after the next observation is received. Thus, the accumulation of system errors during this period is inevitable. Furthermore, if the subsequent observation is still outlier, its suppression capability on system error is very limited, resulting in a continuously expanding error. This also explains the phenomenon seen in Figure 11b, that is, the influence of the outlying system state on the positioning result can only be suppressed to a certain extent, but cannot be completely eliminated. Figure 12 shows the values of γ k for the four beacons computed along Route 1. As it can be seen, values that are greater than the threshold are present in the γ k corresponding to the four beacons, indicating an abnormal system state. The covariance of the system state is adjusted by γ k , and the influence of the abnormal system state on the positioning result is reduced, so that the positioning result is closer to the observation result. Additionally, after receiving the correct observations, the backward RTS smoothing can be applied until the data point which makes the system state abnormal, smoothing the system cumulative error during this period.   Figure 13 shows the residual values Δ corresponding to the four UWB beacons for Route 1. The optimized residual values are unevenly distributed, but on the whole they have a relatively small range, with a maximum optimized residual of about 0.6 m. There are two reasons for the uneven distribution of residuals: first, the values at some time points jump when the ranging value is blocked by the column or interfered by the pedestrian; second, with the increase of the distance, the UWB ranging error will also increase relatively, and the corresponding residuals will increase accordingly. By analyzing the proportion of the optimized residuals, the robustness factor is dynamically  Figure 13 shows the residual values ∆r i corresponding to the four UWB beacons for Route 1. The optimized residual values are unevenly distributed, but on the whole they have a relatively small range, with a maximum optimized residual of about 0.6 m. There are two reasons for the uneven distribution of residuals: first, the values at some time points jump when the ranging value is blocked by the column or interfered by the pedestrian; second, with the increase of the distance, the UWB ranging error will also increase relatively, and the corresponding residuals will increase accordingly. By analyzing the proportion of the optimized residuals, the robustness factor is dynamically determined to obtain the weight of the observation covariance for all beacons.

Route 1 RMSE (m)
Beacon 1 2 3 4 times 1 1 0 0 Table 4 illustrates the root mean square (RMS) positioning error of the proposed ARCKF algorithm compared to the standard CKF when artificial outliers are introduced in the acceleration data. The positioning accuracy of the CKF algorithm decreases rapidly with the increase of the number of outliers; the ARCKF algorithm is also affected by the outliers, however its error is only about half of the error of the CKF algorithm, demonstrating good adaptability to outlying measurements.   Figure 14 shows the distribution of robustness factors calculated from residuals ∆r i . Table 3 lists the number of times the robustness factor reaches the thresholds for each beacon. It can be seen that most data are below C u_max , with only one time reaching the threshold at Beacon 1 and 2, respectively, indicating that the data are basically reliable. The larger the ∆r i , the larger the corresponding robustness factor is, so that the observation covariance can be dynamically increased to reduce the influence of the ranging error on the fusion algorithm, improving the accuracy and robustness of the fusion algorithm.   Table 3. The number of times the robustness factor reaches the threshold _ .

Route 1 RMSE (m)
Beacon 1 2 3 4 times 1 1 0 0 Table 4 illustrates the root mean square (RMS) positioning error of the proposed ARCKF algorithm compared to the standard CKF when artificial outliers are introduced in the acceleration data. The positioning accuracy of the CKF algorithm decreases rapidly with the increase of the number of outliers; the ARCKF algorithm is also affected by the outliers, however its error is only about half of the error of the CKF algorithm, demonstrating good adaptability to outlying measurements.   Table 4 illustrates the root mean square (RMS) positioning error of the proposed ARCKF algorithm compared to the standard CKF when artificial outliers are introduced in the acceleration data. The positioning accuracy of the CKF algorithm decreases rapidly with the increase of the number of outliers; the ARCKF algorithm is also affected by the outliers, however its error is only about half of the error of the CKF algorithm, demonstrating good adaptability to outlying measurements.

Robustness Analysis
To evaluate robustness, the UWB data recorded along Route 2 were contaminated with white Gaussian noise with an intensity of 20 dBW for Beacon 2 and Beacon 4. The noisy data account for 10% of the total distance measurements. Figure 15 shows the distance measurements for the four UWB beacons without noise. To evaluate robustness, the UWB data recorded along Route 2 were contaminated with white Gaussian noise with an intensity of 20 dBW for Beacon 2 and Beacon 4. The noisy data account for 10% of the total distance measurements. Figure 15 shows the distance measurements for the four UWB beacons without noise.  Figure 16 shows the distance measurements for the four UWB beacons with noise. The positioning results for Route 2 are shown in Figure 17. The red trajectory is the positioning result of the UWB, where 10% of data from Beacon 2 and Beacon 4 contain white Gaussian noise randomly added. The blue trajectory is the positioning result of fusing original acceleration data and UWB data. As shown in Figure 17a, the positioning accuracy of standard CKF is severely disturbed by the observation noise, and many points with large deviations from the reference trajectory can be seen. This is because the CKF algorithm sets a fixed covariance for the measurements, which is used to estimate the maximum posterior distribution of the system state. Thus, abnormal UWB measurements have a serious impact to the estimation of the posterior distribution.   Figure 16 shows the distance measurements for the four UWB beacons with noise. The positioning results for Route 2 are shown in Figure 17. The red trajectory is the positioning result of the UWB, where 10% of data from Beacon 2 and Beacon 4 contain white Gaussian noise randomly added. The blue trajectory is the positioning result of fusing original acceleration data and UWB data. As shown in Figure 17a, the positioning accuracy of standard CKF is severely disturbed by the observation noise, and many points with large deviations from the reference trajectory can be seen. This is because the CKF algorithm sets a fixed covariance for the measurements, which is used to estimate the maximum posterior distribution of the system state. Thus, abnormal UWB measurements have a serious impact to the estimation of the posterior distribution.
In comparison, the accuracy of the ARCKF algorithm shown in Figure 17b is much higher. Most of the deviations caused by abnormal UWB observations are eliminated, presenting a smoother trajectory. This is because when the residual of an observation is very large, that is, C ui ≥ C u_max , the covariance of this observation is amplified by the method based on Mahalanobis distance, thereby reducing its effect on the system state. When C ui < C u_max , the observation error is adjusted by the robustness factor to improve the overall positioning accuracy.
added. The blue trajectory is the positioning result of fusing original acceleration data and UWB data. As shown in Figure 17a, the positioning accuracy of standard CKF is severely disturbed by the observation noise, and many points with large deviations from the reference trajectory can be seen. This is because the CKF algorithm sets a fixed covariance for the measurements, which is used to estimate the maximum posterior distribution of the system state. Thus, abnormal UWB measurements have a serious impact to the estimation of the posterior distribution. In comparison, the accuracy of the ARCKF algorithm shown in Figure 17b is much higher. Most of the deviations caused by abnormal UWB observations are eliminated, presenting a smoother trajectory. This is because when the residual of an observation is very large, that is, ≥ _ , the covariance of this observation is amplified by the method based on Mahalanobis distance, thereby reducing its effect on the system state. When < _ , the observation error is adjusted by the robustness factor to improve the overall positioning accuracy. Figure 18 shows the values of for the four beacons computed along Route 2. As it can be seen, for Beacon 2 and Beacon 4, there are multiple values that are much larger than the threshold of 6.2, indicating that there are abnormal observations; whereas the for Beacon 1 and Beacon 3 are all less     Figure 18 shows the values of γ k for the four beacons computed along Route 2. As it can be seen, for Beacon 2 and Beacon 4, there are multiple values that are much larger than the threshold of 6.2, indicating that there are abnormal observations; whereas the γ k for Beacon 1 and Beacon 3 are all less than 6.2, which is consistent with the experiment as these two beacons did not contain any abnormal values.       Figure 19 shows the residual values Δ corresponding to the four UWB beacons for Route 2. Since the data of Beacon 2 and Beacon 4 contain outliers, the optimized residuals are significantly larger with a maximum optimized residual of about 8 m. Although the data of Beacon 1 and Beacon 3 are not contaminated with noise, their optimized residuals are correspondingly increased due to the influence of the data of Beacon 2 and Beacon 4.  As shown in Figure 20 and Table 5, the robustness factor of the four beacons reaches the threshold C u_max multiple times, indicating the presence of abnormal ranging data. The proposed method based on Mahalanobis distance can dynamically increase the observation covariance, reducing the impact of these abnormal ranging data on the fusion algorithm. As shown in Figure 20 and Table 5, the robustness factor of the four beacons reaches the threshold _ multiple times, indicating the presence of abnormal ranging data. The proposed method based on Mahalanobis distance can dynamically increase the observation covariance, reducing the impact of these abnormal ranging data on the fusion algorithm.   Table 6 illustrates the root mean square (RMS) positioning error of the proposed ARCKF as compared to standard CKF when artificial outliers are introduced in the UWB range measurements. With the increasing percentage of added noise, the positioning accuracy of the CKF algorithm decreases rapidly, whereas the accuracy of the ARCKF algorithm is relatively stable. When 10% of ranging data is noisy, the ARCKF algorithm still maintains a positioning accuracy of 0.59 m, demonstrating robustness to the added noise.    Table 6 illustrates the root mean square (RMS) positioning error of the proposed ARCKF as compared to standard CKF when artificial outliers are introduced in the UWB range measurements. With the increasing percentage of added noise, the positioning accuracy of the CKF algorithm decreases rapidly, whereas the accuracy of the ARCKF algorithm is relatively stable. When 10% of ranging data is noisy, the ARCKF algorithm still maintains a positioning accuracy of 0.59 m, demonstrating robustness to the added noise. The lower bounds of positioning error is estimated by CRLB (Cramer-Rao Lower Bounds). In the application of Bayesian filter, the method based on iteration is usually adopted to estimate the posterior CRLB, so as to update the CRLB in each step. The CRLB at Moment k could be defined as: where, J k represented the Fisher information matrix of system state X k .According to [23], the Fisher information matrix J k+1 could be calculated based on the Fisher information Matrix at Moment k, the system transform matrix F k+1 and the measurement matrix H k+1 .
It can be shown that: where Q k and R k+1 are represented the covariance matrix of state transaction function at Moment k and the covariance matrix of measurements at Moment k + 1. For Route 2, when injected with 10% UWB ranging noise, the calculated CRLB is shown in Figure 21.

Positioning Result of Different Number of Beacons
In order to verify the positioning accuracy of the fusion algorithm under different numbers of beacons, the positioning trajectories of 2, 3 and 4 beacons were given, as shown in Figure 22a-c, respectively. Figure 22a shows that the trajectory was seriously distorted. Since the accumulative error of IMU integral increased rapidly along with the time, the distance measurement value from only 2 beacons at the left diagonal line could not restrain the whole trajectory effectively. Figure 22b shows that under the restraint of 3 beacons, the positioning accuracy was better than that of 2 beacons, but there were still some deviations in the trajectory of Y-axis. Figure 22c shows that under the restraint of 4 beacons, the trajectory was roughly the same to the reference trajectory. Theoretically, the more the beacons, the stronger the restraint of IMU integral results would be. However, in actual application, the positioning area covered by four beacons could satisfy the requirement of positioning accuracy to some extent.

Positioning Result of Different Number of Beacons
In order to verify the positioning accuracy of the fusion algorithm under different numbers of beacons, the positioning trajectories of 2, 3 and 4 beacons were given, as shown in Figure 22a-c, respectively. Figure 22a shows that the trajectory was seriously distorted. Since the accumulative error of IMU integral increased rapidly along with the time, the distance measurement value from only 2 beacons at the left diagonal line could not restrain the whole trajectory effectively. Figure 22b shows that under the restraint of 3 beacons, the positioning accuracy was better than that of 2 beacons, but there were still some deviations in the trajectory of Y-axis. Figure 22c shows that under the restraint of 4 beacons, the trajectory was roughly the same to the reference trajectory. Theoretically, the more the beacons, the stronger the restraint of IMU integral results would be. However, in actual application, the positioning area covered by four beacons could satisfy the requirement of positioning accuracy to some extent.
shows that under the restraint of 3 beacons, the positioning accuracy was better than that of 2 beacons, but there were still some deviations in the trajectory of Y-axis. Figure 22c shows that under the restraint of 4 beacons, the trajectory was roughly the same to the reference trajectory. Theoretically, the more the beacons, the stronger the restraint of IMU integral results would be. However, in actual application, the positioning area covered by four beacons could satisfy the requirement of positioning accuracy to some extent.

Conclusions
In this paper, a UWB/IMU fusion method for indoor positioning based on Adaptive-Robust CKF is presented. The Mahalanobis distance between the observation and the system state is calculated in the algorithm to update the covariance of the observation or system state, thereby reducing the effect of the abnormal observations or system state on the positioning result. In addition, a method for calculating the robustness factor when the observation error is smaller than a threshold is proposed in this paper, which guides the algorithm to appropriately apply robust filtering or adaptive-robust filtering. The experimental results show that the proposed method presents a strong error recovery capability. When affected by abnormal data, it can achieve a positioning accuracy much higher than that of the standard CKF algorithm. Future improvements could include the following: the trolley used in our experiments moved relatively stably. For more complex movement patterns, such as rapid acceleration and emergency stop, a better motion state model is required to fit the tested

Conclusions
In this paper, a UWB/IMU fusion method for indoor positioning based on Adaptive-Robust CKF is presented. The Mahalanobis distance between the observation and the system state is calculated in the algorithm to update the covariance of the observation or system state, thereby reducing the effect of the abnormal observations or system state on the positioning result. In addition, a method for calculating the robustness factor when the observation error is smaller than a threshold is proposed in this paper, which guides the algorithm to appropriately apply robust filtering or adaptive-robust filtering. The experimental results show that the proposed method presents a strong error recovery capability. When affected by abnormal data, it can achieve a positioning accuracy much higher than that of the standard CKF algorithm. Future improvements could include the following: the trolley used in our experiments moved relatively stably. For more complex movement patterns, such as rapid acceleration and emergency stop, a better motion state model is required to fit the tested movement pattern. In addition, fusion with other types of data such as geomagnetic data could further improve the positioning accuracy and deserves further investigation.