2.1. NLOS Effect Analysis of UWB Ranging
The ranging accuracy of UWB depends mainly on the accuracy of the signal time of flight (TOF). In an LOS environment, since there is no occlusion between the transceiver devices, the direct signal has the shortest distance and requires the least energy attenuation compared to the multipath signal, and the UWB has high ranging accuracy due to its own nanosecond narrow pulse characteristics. In an NLOS situation, the signal propagation path is more complex, as shown in
Figure 1 for the anchor (Anc 1), and the direct path is blocked by spatial obstacles; the signal propagation path changes to transmission, reflection and diffraction, and the change of propagation medium or path causes the TOF ranging values to generate different degrees of positive errors [
16].
The numerous NLOS situations that affect UWB ranging signals can be divided into two main categories based on their characteristics: one is the effect of complex indoor building structures and the other is the effect of dynamic random occlusion. Common building structures in general include concrete walls, columns, doors and glass. Similar to walls, wooden doors and glass, which have limited thickness, UWB is relatively easy to transmit and the ranging error is relatively stable, and in this case, the method of modeling the propagation error is generally used to optimize the ranging error [
17]. However, the columns, which play a load-bearing role in the building structure, are generally made of steel and concrete and are large in size. The NLOS propagation signal caused by this scenario is very complex and affects UWB ranging not only in a wide range but also with unstable error variations [
12]. Therefore, error modeling with fixed features is no longer an effective solution and eliminating affected ranging information in the case of redundant ranging anchors will help improve localization accuracy. The most common dynamic random NLOS is human occlusion; for example, pedestrians passing through places such as stations and shopping malls can occlude the ranging signal. This NLOS has random, short times and low impact characteristics [
2], so the targeted design of an adaptive robust filtering algorithm will be an effective solution.
2.2. Indoor UWB Anchor LOS/NLOS Information Map Establishment
It is well known that indoor areas comprise complex spatial structures, but in this work, by examining these structural relationships deeply and using the information of the various features, the extreme helpfulness of carrying out positioning in the unique complexity of an indoor environment will be demonstrated. The spatial geometry, semantics, feature points and other information contained in the spatial model can be used to guide and modify the positioning effect in the indoor positioning process [
18,
19,
20]; therefore, the use of this method has also become an effective method to improve positioning results. Currently, the most common ways of using spatial information are map matching (MM) algorithms and map aiding (MA) algorithms. Map matching algorithms project the user’s location onto a map and match the movement trajectory to the features on the map, thus reducing the error in location estimation [
21]. The map-aiding algorithm uses the structural information in the map as constraints—for example, users cannot pass through walls, partitions, obstacles, etc.—and then it corrects the loss in the navigation results and improves the accuracy of the navigation solution [
22]. Attia Mohanmed and Adel Moussa et al. used the map structure to correct the heading information of a gyroscope and improved its accuracy [
23]. Klepal and Beauregard proposed the “through-the-wall” method to assist in localization solutions, which takes advantage of the specific constraint that pedestrians cannot pass through obstacles, such as walls and partitions, while walking, and thus corrected the localization information [
24]. Zhu researched an adaptive UWB positioning error map construction method, using the idea of fingerprint positioning to range UWB on spatial grid points, classifying the size of spatial grid points in a hierarchical manner according to the distribution of error values and further establishing an error model of a non-uniform positioning error grid to correct the positioning effect [
25]. Wang used a map line segment-matching algorithm for the NLOS identification of UWB signals based on the spatial relationship between the anchor and the tag, observed the change in the range value and adjusted the observed value by setting a threshold. The method uses the idea of an antidifference algorithm to improve the localization effect, but the construction of spatial information is more cumbersome and not fully utilized [
26]. Based on the literature [
25], Liu proposed and implemented an indoor positioning system (IPS) based on a digital twin with UWB signals. Based on the constructed digital twin, the optimal anchor layout, adaptive error map construction, and positioning error mitigation are achieved [
27]. Though the study does not take into account the instability of NLOS errors, the strategy in using the new technology for building a map quickly is worth studying. Obviously, a priori information can be obtained by creating a map with appropriate guidance information and helps to achieve project objectives.
Obtaining a priori information, such as an LOS/NLOS information map of UWB anchors, in positioning scenarios with good redundancy in the deployment of anchors in the positioning environment allows the NLOS ranging errors due to the fixed spatial structure in the room to be effectively excluded.
This paper makes full use of the a priori information of indoor spatial structure features and anchor deployment locations. The ray-tracing method is used to quickly and conveniently distinguish the NLOS areas of UWB anchors and further establish the LOS/NLOS information map of anchors. The LOS/NLOS information map is used in the localization solution to accurately select all LOS anchors at the tag location and eliminate the ranging information of NLOS anchors, thus improving the localization accuracy.
Today, with the promotion and application of LiDAR equipment, the collection and map building of indoor environments have become fast and accurate. In this paper, as shown in
Figure 2a, in a typical indoor office scene of 812 m
2 with a complex spatial structure, a LiDAR backpack device fusing a 16-line velodyne LiDAR and panoramic camera, as shown in
Figure 2b, was selected for fast information collection, with the collection process taking about 1 min. Excluding the movable objects in the scene, such as chairs and cartons, the modeling software was able to quickly generate a simple two-dimensional plan of the fixed structure of the experimental site. As shown in
Figure 2d, the black rectangle is the load-bearing column of the building with a minimum side length of 76 cm. The modeling error is between 3–5 cm when using a laser rangefinder with a ranging accuracy of ±2 mm for calibration.
The LOS/NLOS of the anchor is determined by whether the line connecting the positioning tag to the anchor intersects with the spatial structure of the obstacle. If there is an intersection, the tag is blocked during the ranging process and the location of the tag relative to the anchor is NLOS; otherwise, it is LOS.
Taking a small square grid with a side length of 0.5 m in the scene area as an example, with each vertex of the square used as the location where the positioning tag is located (hereafter referred to as grid points), then the LOS/NLOS situation of the anchors must be analyzed. As shown in
Figure 3, the grey squares are 0.5 × 0.5 m grids, A0 is where the anchor is located and the black squares Z
0 and Z
1 are the square columns at the site. Taking
Z1 as an example,
Z00,
Z01,
Z02 and
Z03 are the corner angles of the square column. The two-dimensional equations of the four edges of the columns, i.e.,
Z00Z01,
Z01Z02,
Z02Z03 and
Z03Z00, can be calculated by bringing in the coordinates of the angles of the column. Taking edge
Z00Z01 as an example, the equation of the line for this edge is expressed as:
In the expression, is the two-dimensional coordinate of point Z00 and is the two-dimensional coordinate of point Z01.
Figure 3.
Determined schematic diagram of LOS/NLOS of anchor.
Figure 3.
Determined schematic diagram of LOS/NLOS of anchor.
D
1–D
13 in
Figure 3 are example grid points, and the equation for the line from the anchor to the grid point is expressed as:
where
is the two-dimensional coordinate of point
A0 and
is the two-dimensional coordinate of point
Di.
This paper can determine whether the grid point is an LOS point of anchor by calculating whether Equations (1) and (2) intersect. It can be seen clearly from
Figure 3 that the line from D
1–D
9 to the anchor A0 does not intersect the column boundary, so D
1–D
9 is the LOS point for anchor A0, and the description value of the LOS of anchor is defined as “1”. Whereas the line between D
10–D
13 and the anchor A0 intersects the column boundary, D
10–D
13 are NLOS points for anchor A0, defining the description value of the NLOS of anchor as “0”. In the same way, the other anchor in the space is traversed to obtain information on the situation of the anchors deployed at the spatial grid points. Each grid point contains information in the form of a matrix of 1 row and n columns with the value “0” or “1”, n being the number of anchors deployed in the environment. Finally, the map information database of LOS/NLOS of anchor will be generated.
2.3. UWB Positioning Solution Algorithm
2.3.1. Extended Kalman Filter
The Kalman filter (KF) uses the minimum mean square error as the best criterion for estimation, provided that the system is considered linear and that the system and the measurement noise are assumed to obey a Gaussian distribution in the filtering process [
28,
29]. In practice, almost all systems are nonlinear, and the best approach to this problem is to linearize the nonlinear function around the mean value of the current estimated state. The extended Kalman filter (EKF) linearizes the nonlinear system locally and is suitable for weakly nonlinear systems. The core idea is to perform a first-order Taylor expansion of the nonlinear function at the filter value and then apply the KF to complete the solution on this basis. EKF is widely used because of its simplicity, speed and robustness [
30]. The localization solution for the EKF can be found in the literature [
31].
2.3.2. Adaptive Robust Kalman Filter
In indoor space activities, the trajectories of pedestrians will inevitably intersect. When pedestrians approach, the body obscuring the RF range will cause sudden transient changes in the measured value, which is generally random and of short duration. To address this problem, an adaptive robust extended Kalman filter (AREKF) algorithm is proposed in this paper to design a robust factor to identify and weaken the effects of range anomalies, while estimating and correcting the system noise in real time, which can effectively attenuate the effects of errors caused by random NLOS and improve the positioning accuracy and the robustness of the positioning effect.
The key technique of AREKF is to construct the observation weight matrix and reasonable adaptive factors so that the observation information, state information and their components can be effectively balanced for the optimization of state parameter valuation.
The expression for the innovation
in the EKF is shown in Equation (3):
Starting from the definition of the estimation error covariance, the theoretical expression of the innovation covariance matrix is:
is the calculation of the current measured value and state estimation value, which reflects the real situation of the current measured value.
Meanwhile, the innovation covariance obtained from the algorithm recursive calculation can be expressed as:
The adaptive factor
, according to the difference between
and
, is defined as:
Using the adaptive factor
to adjust the measurement noise of the system, the adjusted expression for
is:
where
and
are robust parameters. We choose students of different heights and genders to conduct random occlusion tests on the ranging signals, and the optimization is best when
is taken as 2.5–3.5 and
is taken as 3.5–4.5 by the solution.
The filtering gain
of AREKF is thus expressed as:
Bringing (8) into the EKF state update estimation and posterior estimation covariance matrix equations to perform state estimation and error covariance matrix updates. Thus, the robust estimation effect of the UWB distance model is achieved in order to further realize the robust performance of the filtering and improve the accuracy of the filtering solution.
2.3.3. Positioning Algorithm Based on Anchor LOS/NLOS Information Map
The obstruction of ranging signals by indoor spatial structures can seriously affect the accuracy of ranging, and if the NLOS ranging values are brought into the positioning algorithm, the solution can seriously deviate from the true values. The anchor LOS/NLOS information map is constructed to describe the LOS relationship between the location of the positioning tag and the positioning anchor in the region, from which it is possible to visualize which anchors are not affected by the spatial structure. Therefore, under the premise that the number of anchors can complete the localization solution, the accuracy of the localization solution is effectively improved by excluding the NLOS anchor range values and using only the LOS range values for the solution.
The process of the EKF algorithm based on the anchor LOS/NLOS information map (Map-EKF) is as follows: Firstly, obtain the initial position point or the estimated position for the current moment from the previous moment in the positioning process (hereafter referred to as the estimated point). Next, set the radius value, using the estimated point as the center of the circle, and circle the area adjacent to the estimated point. Then, extract grid point information in the LOS/NLOS information map for the adjacent area. Then, aggregate the LOS/NLOS of the anchors corresponding to the grid points in the region. The anchors are then selected based on the aggregation, and the range values of the LOS anchors are brought into the observation equation in the EKF, while the filter gain is constrained using the LOS/NLOS aggregation of the anchors. The EKF update process is used to correct the estimated values and obtain the final filtering results. The block diagram of the algorithm is shown in
Figure 4.
Taking the 0.5 × 0.5 m grid map building as an example, since the results of indoor positioning do not coincide with the collection point on the map every time, the nearest neighbor method is used. The anchor LOS/NLOS of the grid points within a certain range of the initial positioning point or the filtered estimated position point are then found. Based on the calculation results, the LOS anchors are selected and then the localization solution is performed to correct the previously estimated positions.
The grid on the anchor LOS/NLOS information map is a square with side length of 0.5 m and its diagonal length is about 0.707 m. Therefore, in the nearest neighbor fusion scheme, a circle is drawn with a radius of 0.71 m with the estimated point as the center, and the grid points contained in the circle are selected as the nearest neighbor points of the estimated point. As shown in
Figure 5, the blue points are map grid points and the red points are localization position estimation points when the estimation points overlap with any grid point, as shown in
Figure 5a, containing nine nearest neighbor points at this time, which is the situation that covers the maximum number of nearest neighbors. When the estimated point is located at the center point of the square grid, as shown in
Figure 5b, it contains four nearest neighbors at this time, which is the situation that covers the least number of nearest neighbors. It can be seen that when using a circle with a radius of 0.71 m to set the nearest neighbor region, the interval of the number of nearest neighbor points n can be obtained as
.
Since the maximum number of nearest neighbor points is nine, A is set as a matrix with
m rows and nine columns, where the number of rows
m indicates the number of anchors built in the positioning space and the elements of the matrix consist of two values of “0” or “1”. For example, if a total of 8 anchors are built in space, the value of
m is taken as “8” and, assuming that the proximity of the estimated location contains 4 grid points, the grid points in the anchor LOS/NLOS information map are taken as shown in
Table 1 and the value of A is taken as shown in Equation (9), in which the columns with 1–4 points are the LOS and NLOS values of the 8 anchors corresponding to the 4 grid points, because there are not enough columns, so the columns with 5–9 points are all supplemented with “1” values. Similarly, when
m < 9, all 9-
m columns in A are supplemented with “1” values. Assuming that the proximity range of the location estimation position contains nine grid points, the grid points are shown in the anchor LOS/NLOS information map as demonstrated in
Table 2 and the value of A is taken as shown in Equation (10). It can be seen that the actual number of LOS anchors obtained should be less than or equal to that in real-world conditions because the LOS/NLOS situation of the anchors in a certain range around the estimated point is found and the solution achieved.
Let NL be a matrix of m rows and one column, indicating the LOS/NLOS of the anchor obtained based on the grid point information of the nearest neighbor area of the estimated location point. The value of each row in NL is the result and operation of the row elements in A matrix; taking Equation (10) as an example, the value of NL is:
According to the Equation (11), the anchor correlation indicates that the location estimation point is the LOS anchor for anchors A0, A2, A3, A5 and A6, while A1, A4 and A7 are NLOS anchors.
In the EKF process, the NL value is used to modify the filter gain K value to select the positioning anchors. Taking Equation (11) as an example, the ranging information of three anchors A1, A4 and A7, is discarded and the ranging values of anchors A0, A2, A3, A5 and A6 are selected to solve the positioning algorithm, so that the interference of NLOS can be excluded to improve the positioning solution accuracy.
2.3.4. Robust Adaptive EKF Algorithm Based on Anchor LOS/NLOS Information Maps
The algorithm based on the anchor LOS/NLOS information map can effectively eliminate the impact of the errors of the NLOS measurements of the anchor caused by the indoor spatial structure. The use of the robust adaptive algorithm can effectively solve the problem of random NLOS errors caused by the blocking of RF signals by pedestrians in the surrounding environment. Therefore, these two methods are combined to design the robust adaptive EKF algorithm based on the anchor LOS/NLOS information map (Map-AREKF), which makes full use of the a priori information of the physical space and the idea of robust filtering, so that the effects of fixed NLOS spatial errors and dynamic random NLOS human errors in the positioning process can be attenuated. The software flow of the algorithm is shown in Algorithm 1.
Algorithm 1. Adaptive EKF Algorithm Code Based on Anc LOS/NLOS Information Map |
1 | Initialization parameters (T,M,Q,R,F,P0) |
2 | Acquire starting position or initial positioning |
3 | Import anchor LOS/NLOS information map |
4 | for t = 1:M |
5 | for k = 1:len |
6 | Set the radius of adjacent area r = 0.71 |
7 | Get the grid points contained in the adjacent area |
8 | Import the anchor LOS/NLOS data near the initial positioning point NL |
9 | end for |
10 | |
11 | |
12 | |
13 | ; |
14 | |
15 | Use self-adaption factor to adjust the measurement noise of the system |
16 | |
17 | Modify according to MI to obtain |
18 | |
19 | |
20 | end for |