An IMU-Aided Body-Shadowing Error Compensation Method for Indoor Bluetooth Positioning

Research on indoor positioning technologies has recently become a hotspot because of the huge social and economic potential of indoor location-based services (ILBS). Wireless positioning signals have a considerable attenuation in received signal strength (RSS) when transmitting through human bodies, which would cause significant ranging and positioning errors in RSS-based systems. This paper mainly focuses on the body-shadowing impairment of RSS-based ranging and positioning, and derives a mathematical expression of the relation between the body-shadowing effect and the positioning error. In addition, an inertial measurement unit-aided (IMU-aided) body-shadowing detection strategy is designed, and an error compensation model is established to mitigate the effect of body-shadowing. A Bluetooth positioning algorithm with body-shadowing error compensation (BP-BEC) is then proposed to improve both the positioning accuracy and the robustness in indoor body-shadowing environments. Experiments are conducted in two indoor test beds, and the performance of both the BP-BEC algorithm and the algorithms without body-shadowing error compensation (named no-BEC) is evaluated. The results show that the BP-BEC outperforms the no-BEC by about 60.1% and 73.6% in terms of positioning accuracy and robustness, respectively. Moreover, the execution time of the BP-BEC algorithm is also evaluated, and results show that the convergence speed of the proposed algorithm has an insignificant effect on real-time localization.


Introduction
The indoor location-based service (ILBS) has recently gained considerable attention due to its social and commercial values, and its market value is predicted to be worth $10 billion by 2020 [1]. Meanwhile, the demands for accurate localization in indoor environments have increased dramatically [2,3]. Various positioning technologies, including Infrared [4], Ultrasonic [5], Ultra-Wideband (UWB) [6], Pseudolite [7], Wireless Local Area Network (WLAN) [8], and Bluetooth Low Energy (BLE) [9], have been proposed, aiming to improve the localization performance indoors. BLE positioning has aroused great research attention recently because of its stable signal with low fluctuation, easy implementation with low energy cost, low computational complexity, and high mobility [9]. Meanwhile, an ABI research report on Bluetooth has shown that Bluetooth devices will break 5 billion shipments by 2021 [10], promoting BLE positioning to one of the most promising solutions for indoor accurate and robust localization.
BLE indoor positioning can be divided into two different schemes: fingerprint-based and range-based. Both schemes rely on the Received Signal Strength (RSS) of the Bluetooth signals. The fingerprint-based scheme consists of two stages: the off-line stage and the on-line stage. In the off-line stage, the RSS from the anchor points (APs) at test points are collected (also named fingerprints) compensation method with shadowing autonomous detection for indoor range-based BLE positioning and to improve both the positioning accuracy and the robustness of the system. This paper firstly analyzes the body-shadowing influence on RSS-based ranging and derives a mathematical expression of the relation between the body-shadowing effect and the positioning error. Then, a body-shadowing situation detection strategy based on the heading information obtained from Inertial Measurement Units (IMU) is designed and evaluated. Meanwhile, an error compensation model together with a novel Bluetooth positioning algorithm with body-shadowing error compensation (BP-BEC) is established and proposed in this paper to mitigate the positioning error. The experiments were conducted in indoor body-shadowing environments, and the results demonstrated the improvements of the proposed method. The remainder of this paper is arranged as follows: Section 2 describes the system model of BLE positioning and analyzes the bodyshadowing influence on both RSS-based ranging and positioning; Section 3 designs the bodyshadowing detection strategy, establishes the error compensation model, and studies the BP-BEC algorithm; the experiments and results are presented in Section 4 followed by a related discussion; finally, the conclusions are addressed in Section 5.

System Model and Body-Shadowing Influence Analysis
This paper mainly focuses on the range-based BLE positioning, and the system model is presented in this section, together with the body-shadowing influence analysis on RSS-based ranging and positioning. It should be noted that the shadowing error in RSS measurements is named Body-Shadowing Influence Error (BSIE) in this paper.

System Model
The system model of the range-based indoor BLE positioning system utilized in this paper is shown in Figure 1. This positioning system consists of three main modules: RSS collection, RSS-based ranging, and range-based positioning. The RSS collection module collects the RSSs from hearable APs at a UP, and stores the RSS data for position estimation. The RSS-based ranging module calculates the distance between one AP and a UP (AP-UP distance) based on the PLM with environmentdependent parameters, and the range-based positioning module utilizes localization algorithms, like the Least-Square (LS) method and the WKNN, to obtain the final estimation of the positioning system. The BSIE in measured RSS could impair both the RSS-based ranging and the range-based positioning, as will be analyzed in detail in following sections. where APk (k = 1,2,3) is the k-th Bluetooth anchor point and ( , ) ( = 1,2,3) is the coordinate of it. ( 0 , 0 ) is the coordinate of the unknown point (UP). IDk and RSSk are the identification and received signal strength of the k-th AP, respectively. PL0 is the transmitting power of Bluetooth AP, and n is an environment-depended parameter. dk is the calculated distance between the k-th AP and the UP.

Path-loss Model Positioning Algorithm
Database RSS Collection RSS-based ranging range-based positioning where AP k (k = 1,2,3) is the k-th Bluetooth anchor point and (x k , y k ) (k = 1, 2, 3) is the coordinate of it. (x 0 , y 0 ) is the coordinate of the unknown point (UP). ID k and RSS k are the identification and received signal strength of the k-th AP, respectively. PL 0 is the transmitting power of Bluetooth AP, and n is an environment-depended parameter. d k is the calculated distance between the k-th AP and the UP.

Body-Shadowing Influence on Ranging
The RSS-based ranging algorithm calculates the AP-UP distance based on PLM, which is a theoretical mathematical model representing the relationship between the transmission loss and the distance of wireless signals. The widely used PLM in the literature is shown in Equation (1).
where PL d is the path-loss in dBm of the wireless signals after transmitting to a distance of d, PL 0 is the path-loss after transmitting to a distance of d 0 , d 0 is the reference distance, usually set to one meter, n is an environment-depended parameter representing the loss coefficient, and X σ represents the shadowing error and is generally considered as a normally distributed variable. In general, the RSS collected at the UP from one AP is the difference between the transmitted power of AP and the corresponding path-loss, as shown in Equation (2): where P is the transmitted power of AP, and PL d is the path-loss. According to Equations (1) and (2), the relationship between RSS and the corresponding AP-UP distance can be derived as follows: According to Equation (3), the RSS-based ranging can be obtained, and the AP-UP distance can be calculated.
RSS-based ranging needs neither synchronization between an AP and a UP, which is necessary in Time-of-Arrival (TOA) measurement, nor Round-Trip Time (RTT) measurements to implement ranging. Meanwhile, this ranging method has low computational complexity and could achieve an accurate ranging performance when the parameters in PLM are selected or modified appropriately according to the environment. However, RSS measurements in indoor environments would have a BSIE because of the presence of human bodies. In order to make the following analysis comprehensive but not complicated, this paper makes the assumptions that the BSIE is an added noise in RSS, and the X σ without body-shadowing error is stable in the same point. Without loss of generality, the reference distance d 0 is set to 1 m. The mathematical relationship between BSIE and ranging error can be derived as follows: where RSS M is the measured RSS with BSIE, BSIE is the body-shadowing error in dB, d M is the AP-UP distance calculated on the basis of RSS M , d is the AP-UP distance without body-shadowing influence, and ∆d stands for the ranging error caused by body-shadowing. According to Equation (6), the ranging error is directly proportional both to the exponent of the BSIE and to the AP-UP distance. In general, the BSIE in indoor environments could be regarded as a constant about 6-8 dB [25], and the loss coefficient n could be set to 3.07 in indoor office environments [26]. The range of the AP-UP distance is decided by the deployment of APs and could be set within 5 m. According to these assumptions and Equation (6), the ranging error lying in body-shadowing could reach 1.8 m, which is a large bias in indoor localization. Figure 2 also shows the relationship between the ranging error and the BSIE when the loss coefficient is set to 3.07.

Body-Shadowing Influence on Positioning
According to the analysis in Section 2.2, the body-shadowing influence on RSS measurements could bring ranging errors, which, as a result, would cause large positioning errors. Meanwhile, the RSS attenuation caused by body-shadowing could also affect the construction of the fingerprint database and the matching in fingerprint-based positioning. This paper focuses on the analysis of range-based positioning and takes trilateration and the WKNN algorithm as examples for the following derivation.

Influence on Positioning Using Trilateration
Positioning based on trilateration can be simplified as a problem which calculates the solution of the equations shown in Equation (7): where ( , , ) represent the coordinates of UP, ( , , ), = 1,2,3,4 are the coordinates of APk, and , = 1,2,3,4 stands for the ranging results based on RSS and PLM mentioned in Section 2.2. This paper utilizes the LS method to derive the localization results based on trilateration as follows in Equations (8)-(10): where the vector = ( , , ) represents the localization results, and the definitions of matrix A and C are shown in the following Equations (11) and (12). The parameter k in Equations (8) and (9) equals to 2,3,4.

Body-Shadowing Influence on Positioning
According to the analysis in Section 2.2, the body-shadowing influence on RSS measurements could bring ranging errors, which, as a result, would cause large positioning errors. Meanwhile, the RSS attenuation caused by body-shadowing could also affect the construction of the fingerprint database and the matching in fingerprint-based positioning. This paper focuses on the analysis of range-based positioning and takes trilateration and the WKNN algorithm as examples for the following derivation.

Influence on Positioning Using Trilateration
Positioning based on trilateration can be simplified as a problem which calculates the solution of the equations shown in Equation (7): where (x, y, z) represent the coordinates of UP, (x k , y k , z k ), k = 1, 2, 3, 4 are the coordinates of AP k , and d k , k = 1, 2, 3, 4 stands for the ranging results based on RSS and PLM mentioned in Section 2.2. This paper utilizes the LS method to derive the localization results based on trilateration as follows in Equations (8)- (10): where the vector L = (x, y, z) T represents the localization results, and the definitions of matrix A and C are shown in the following Equations (11) and (12). The parameter k in Equations (8) and (9) equals to 2,3,4.
Sensors 2018, 18, 304 According to Equations (10)- (12), A is a constant matrix when the deployment of APs is fixed. The localization error lies in the measurements of the AP-UP distance, and the BSIE will occur when the signal's transmission path is blocked by human bodies. In order to evaluate the body-shadowing influence on positioning, we introduce the ranging error analyzed in Section 2.2 into Equation (12). Without loss of generality, we assume that the AP 1 is under a body-shadowing situation, which in other words means that there is a ranging error ∆d 1 in the measured distance d 1 . The positioning results under this situation can be derived as follows in Equations (13)- (15). Body-shadowing situations on other APs could be evaluated similarly to this situation.
where C M is the matrix C under a body-shadowing situation, ∆C is an error matrix caused by body-shadowing, L M = (x M , y M , z M ) T is the positioning result corresponding to C M , ∆d 1 is the ranging error in AP 1 -UP distance calculation, and BSIE 1 is the corresponding body-shadowing influence error. According to Equations (10) and (15), the localization error caused by body-shadowing in range-based positioning systems can be represented as follows: where Error stands for the localization error in meters and || || 2 is the 2-norm operation of the matrix. In order to represent the relationship between localization error and BSIE, this paper makes the assumptions that all the distances between APs are 5 m and the coefficient n is 3.07. According to Equation (16), the relationship between the localization error and the BSIE under the situation that only one AP is shadowed can be represented as in Figure 3.
According to Equations (10)- (12), A is a constant matrix when the deployment of APs is fixed. The localization error lies in the measurements of the AP-UP distance, and the BSIE will occur when the signal's transmission path is blocked by human bodies. In order to evaluate the body-shadowing influence on positioning, we introduce the ranging error analyzed in Section 2.2 into Equation (12). Without loss of generality, we assume that the AP1 is under a body-shadowing situation, which in other words means that there is a ranging error ∆ 1 in the measured distance d1. The positioning results under this situation can be derived as follows in Equations (13)- (15). Body-shadowing situations on other APs could be evaluated similarly to this situation.
= ( where is the matrix C under a body-shadowing situation, ∆ is an error matrix caused by bodyshadowing, = ( , , ) is the positioning result corresponding to , ∆ 1 is the ranging error in AP1-UP distance calculation, and BSIE1 is the corresponding body-shadowing influence error. According to Equations (10) and (15), the localization error caused by body-shadowing in range-based positioning systems can be represented as follows: where Error stands for the localization error in meters and ‖⋇‖ 2 is the 2-norm operation of the matrix. In order to represent the relationship between localization error and BSIE, this paper makes the assumptions that all the distances between APs are 5 m and the coefficient n is 3.07. According to Equation (16), the relationship between the localization error and the BSIE under the situation that only one AP is shadowed can be represented as in Figure 3.

Influence on Positioning Using WKNN
Range-based positioning utilizing WKNN can be considered as a geometry method to estimate the position of a UP. The WKNN algorithm selects the k nearest APs of a UP based on the measured RSS, and calculates the weighted geometric center of the selected APs for localization estimation. The estimated coordinates of a UP using WKNN can be described by Equations (17)- (19). Considering that the APs are usually deployed on the ceilings, this section only evaluates the BSIE influence in the X-Y plane.
where d i is the calculated distance between a UP and the i-th selected neighboring AP, K is the number of selected APs for WKNN positioning, w i stands for non-normalized weight of the i-th neighboring AP, w i is the corresponding normalized weight, and (x i , y i ) and (x 0 , y 0 ) are the coordinates of i-th AP and the localization estimation using WKNN, respectively. In order to make the following derivations simple but comprehensible, we set the parameter K in Equation (17) as 2, and make the assumption that the BSIE in measured RSS does not affect the AP selection results. It should be noted that in some real indoor environments, the BSIE could probability affect the AP selection in WKNN, which can bring a large positioning error for positioning using WKNN. With the assumptions above, the position estimation results can be derived as follows: In order to evaluate the BSIE influence on positioning using WKNN, we also introduce the ranging error analyzed in Section 2.2 into Equation (20). Without loss of generality, we assume that the measured RSS from AP 1 exists the BSIE. Then, the estimated position of a UP under body-shadowing can be derived as follows: where (x M , y M ) is the positioning results using WKNN under a body-shadowing situation and ∆d 1 is the ranging error caused by BSIE. The positioning error using WKNN can be shown as follows: where error w is the positioning error using WKNN and d 12 is the distance between AP 1 and AP 2 .
Considering that the deployment of APs is usually not very high up on the ceilings, this section assumes that the approximately equals to d 1 + d 2 , and the relationship between the positioning error and the BSIE can be derived by Equation (23), according to Equations (14) and (22): The relationship between the positioning error and the BSIE can also be shown as in Figure 4, with the parameters d 12 and n set as 5 m and 3.07, respectively.

Factors that May Affect Body-Shadowing Influence Error
Body-shadowing could considerable impair both ranging and positioning based on RSS, according to the analyses in Sections 2.1 and 2.2. Meanwhile, there are still some factors that may affect the value of the BSIE when considering body-shadowing error compensation. The shadowing angle from AP to UP, the distance between shadowed AP and UP, the features of the human bodies that cause body-shadowing are some of the factors that can cause different BSIEs. The shadowing angle from AP to UP corresponds to the relative position of AP and UP in this research and can be divided into three states: back, front, and side. The distance factor indicates how far is AP from UP in the X-Y plane, given that the APs are generally deployed on the ceilings. The features of the human bodies mainly consist of the human's gender, height, and weight. This paper mainly focuses on the shadowing angle and the distance factors in the following analyses on BSIE compensation. Moreover, the shadowing angles are decided on the basis of the relative position of AP and UP, and the descriptions of these three shadowing states, namely, front, side, and back, used in this paper are shown in Figure 5.

Factors that May Affect Body-Shadowing Influence Error
Body-shadowing could considerable impair both ranging and positioning based on RSS, according to the analyses in Sections 2.1 and 2.2. Meanwhile, there are still some factors that may affect the value of the BSIE when considering body-shadowing error compensation. The shadowing angle from AP to UP, the distance between shadowed AP and UP, the features of the human bodies that cause body-shadowing are some of the factors that can cause different BSIEs. The shadowing angle from AP to UP corresponds to the relative position of AP and UP in this research and can be divided into three states: back, front, and side. The distance factor indicates how far is AP from UP in the X-Y plane, given that the APs are generally deployed on the ceilings. The features of the human bodies mainly consist of the human's gender, height, and weight. This paper mainly focuses on the shadowing angle and the distance factors in the following analyses on BSIE compensation. Moreover, the shadowing angles are decided on the basis of the relative position of AP and UP, and the descriptions of these three shadowing states, namely, front, side, and back, used in this paper are shown in Figure 5.

Factors that May Affect Body-Shadowing Influence Error
Body-shadowing could considerable impair both ranging and positioning based on RSS, according to the analyses in Sections 2.1 and 2.2. Meanwhile, there are still some factors that may affect the value of the BSIE when considering body-shadowing error compensation. The shadowing angle from AP to UP, the distance between shadowed AP and UP, the features of the human bodies that cause body-shadowing are some of the factors that can cause different BSIEs. The shadowing angle from AP to UP corresponds to the relative position of AP and UP in this research and can be divided into three states: back, front, and side. The distance factor indicates how far is AP from UP in the X-Y plane, given that the APs are generally deployed on the ceilings. The features of the human bodies mainly consist of the human's gender, height, and weight. This paper mainly focuses on the shadowing angle and the distance factors in the following analyses on BSIE compensation. Moreover, the shadowing angles are decided on the basis of the relative position of AP and UP, and the descriptions of these three shadowing states, namely, front, side, and back, used in this paper are shown in Figure 5.  The "front-state" is the situation in which the AP is in front of the UP, corresponding to the green point in Figure 5. The "back-state" is the situation in which the AP is behind the UP, as indicated by the blue point. The "side-state" is the situation in which the AP is behind and on the side of the UP, as indicated by the purple point. In other words, the "side-state" means that the Bluetooth signal is partly shadowed by the human body. The range of coordinates for these three shadowing states can be represented by Equation (24) according to the description in Figure 5: when : y a ≥ y k and x a ∈ R back, when : y c < y k and x c = x k side, when : y b < y k and

BLE Positioning with Body-Shadowing Error Compensation
Since body-shadowing, which could bring large localization errors, is an unavoidable problem for indoor positioning systems, an error compensation should be conducted when implementing RSS-based positioning. This section designs an IMU-aided body-shadowing detection strategy based on the coarse positioning results and establishes the BSIE compensation model based on the empirical data. The BP-BEC algorithm is then proposed to mitigate the BSIE for indoor BLE positioning.

Body-Shadowing Detection Strategy
In order to compensate the BSIE in the measured RSS, the APs which are shadowed by human bodies should be detected firstly. Cully et al. [20] utilized a manual differentiation of body-shadowing situations based on the time information and location information. Other statistical methods to detect body-shadowing conditions have also been shown in [27]. The detection strategies mentioned above might not be intelligent or flexible enough to detect the body-shadowing situation in real-time localization. This paper utilizes the coarse BLE positioning results and the heading information obtained from IMU to detect the body-shadowing conditions. IMU can measure one's attitude and acceleration using accelerometers and gyroscopes and has been generally integrated in off-the-shelf smartphones. The heading information could be derived according to ones' angular velocity and acceleration based on the iteration of quaternion [28]. This paper makes the assumption that the smartphone is carried in front of the human body when is located, and the heading information could be used to represent the orientation of the human body. In addition, the body-shadowing detection strategy in this paper utilizes the projections of AP and UP in the X-Y plane and the heading information to distinguish the shadowing states mentioned in Figure 5. The diagram of the proposed strategy is shown in Figure 6, and the definitions of the symbols in Figure 6 are given in Table 1. The "front-state" is the situation in which the AP is in front of the UP, corresponding to the green point in Figure 5. The "back-state" is the situation in which the AP is behind the UP, as indicated by the blue point. The "side-state" is the situation in which the AP is behind and on the side of the UP, as indicated by the purple point. In other words, the "side-state" means that the Bluetooth signal is partly shadowed by the human body. The range of coordinates for these three shadowing states can be represented by Equation (24) according to the description in Figure 5:

BLE Positioning with Body-Shadowing Error Compensation
Since body-shadowing, which could bring large localization errors, is an unavoidable problem for indoor positioning systems, an error compensation should be conducted when implementing RSS-based positioning. This section designs an IMU-aided body-shadowing detection strategy based on the coarse positioning results and establishes the BSIE compensation model based on the empirical data. The BP-BEC algorithm is then proposed to mitigate the BSIE for indoor BLE positioning.

Body-Shadowing Detection Strategy
In order to compensate the BSIE in the measured RSS, the APs which are shadowed by human bodies should be detected firstly. Cully et al. [20] utilized a manual differentiation of bodyshadowing situations based on the time information and location information. Other statistical methods to detect body-shadowing conditions have also been shown in [27]. The detection strategies mentioned above might not be intelligent or flexible enough to detect the body-shadowing situation in real-time localization. This paper utilizes the coarse BLE positioning results and the heading information obtained from IMU to detect the body-shadowing conditions. IMU can measure one's attitude and acceleration using accelerometers and gyroscopes and has been generally integrated in off-the-shelf smartphones. The heading information could be derived according to ones' angular velocity and acceleration based on the iteration of quaternion [28]. This paper makes the assumption that the smartphone is carried in front of the human body when is located, and the heading information could be used to represent the orientation of the human body. In addition, the body-shadowing detection strategy in this paper utilizes the projections of AP and UP in the X-Y plane and the heading information to distinguish the shadowing states mentioned in Figure 5. The diagram of the proposed strategy is shown in Figure 6, and the definitions of the symbols in Figure 6 are given in Table 1.

AP k
The projection of the k-th anchor point, represents the shadowed Bluetooth beacon UP The projection of the unknown point, represents the point being located The coordinates of the k-th AP which is shadowed by a human body The coordinates of coarse positioning resulting from BLE positioning d The distance between the projections of shadowed AP and UP ϕ The heading information obtained from IMU, indicating the clockwise angle between the North and the body's orientation, ranging from 0 • to 360 • θ The angle information utilized to detect the shadowing state, ranging from 0 • to 180 • As shown in Figure 6, the proposed body-shadowing detection strategy could detect three shadowing conditions in the shadowing angle factor mentioned in Section 2.4. This strategy utilizes the cosine of shadowing angle θ to distinguish these three states, and the mathematical description of the body-shadowing detection strategy can be represented by the following Equations (25) and (26). Given that there may be noise in measurements and calculations, the boundaries of the "front-side" state and "side-back" state are both set to a range of 15 • , around 0 • and 180 • . As a result, the thresholds are set to −0.2588 and −0.9659 for the "front-side" and "side-back" states, respectively.

BSIE Compensation Model
Considering that both the shadowing angle and the distance between shadowed AP and UP can affect the value of the BSIE, the BSIE compensation model should consist of these two parameters and have the general expression shown in Equation (27): where BSIE compensate is the BSIE value in dB, which should be compensated in the measured RSS to obtain an accurate ranging result, and f (d, θ) is an abstract function of the shadowing angle θ and the distance d between shadowed AP and UP. This paper conducts experiments on the relationship among the BSIE, the shadowing angle, and the distance, and specifies the function in the BSIE compensation model on the basis of the analyses mentioned in Section 2 and the empirical data obtained. The BSIE compensation model used in this paper is represented as follows by Equation (28), and the experimental results corresponding to this model are shown in Section 4.2.

BP-BEC Algorithm
Based on the body-shadowing detection strategy and the BSIE compensation model, the BP-BEC algorithm is proposed to mitigate the effect of body-shadowing and improve the performance of positioning systems in terms of accuracy and robustness. The flow chart of the BP-BEC algorithm is shown in Figure 7. The BP-BEC algorithm performs positioning process in two stages: coarse positioning and fine positioning. In the coarse-positioning stage, the RSS measurements from different APs are collected at a UP, and a Kalman filter is utilized to filter the measurement noise and to smooth the measurements. Then, the LS method or WKNN algorithm is implemented to obtain the coarse positioning results. It should be noted that these positioning results are called coarse results because of the existence of the body-shadowing error.
In the fine-positioning stage of the BP-BEC algorithm, the heading information from IMU and the coarse-positioning results are integrated to distinguish the shadowed APs from all hearable APs on the basis of the detection strategy proposed in Section 3.1. Then, the BSIE compensation model in Section 3.2 is applied to compensate the measured RSSs of shadowed APs. After the error compensation process, the positioning process is conducted again using the compensated RSS, and a new location result is obtained. The processes of compensation and positioning are iterated until the distance between two positioning results is smaller than the given threshold, or the iteration number is larger than the given number. A fine-positioning result could be obtained after the iteration, and this is the final output result of the BP-BEC. In this paper, the distance threshold is set as 0.1 m through measurements and empirical data, and the iteration number is set to 50 with the consideration of real-time localization. shown in Figure 7. The BP-BEC algorithm performs positioning process in two stages: coarse positioning and fine positioning. In the coarse-positioning stage, the RSS measurements from different APs are collected at a UP, and a Kalman filter is utilized to filter the measurement noise and to smooth the measurements. Then, the LS method or WKNN algorithm is implemented to obtain the coarse positioning results. It should be noted that these positioning results are called coarse results because of the existence of the body-shadowing error.
In the fine-positioning stage of the BP-BEC algorithm, the heading information from IMU and the coarse-positioning results are integrated to distinguish the shadowed APs from all hearable APs on the basis of the detection strategy proposed in Section 3.1. Then, the BSIE compensation model in Section 3.2 is applied to compensate the measured RSSs of shadowed APs. After the error compensation process, the positioning process is conducted again using the compensated RSS, and a new location result is obtained. The processes of compensation and positioning are iterated until the distance between two positioning results is smaller than the given threshold, or the iteration number is larger than the given number. A fine-positioning result could be obtained after the iteration, and this is the final output result of the BP-BEC. In this paper, the distance threshold is set as 0.1 m through measurements and empirical data, and the iteration number is set to 50 with the consideration of real-time localization.

Experimental Scenario and Implementation
We conducted our experiments in two indoor body-shadowing environments in order to evaluate the body-shadowing effect and the performance of the proposed BP-BEC algorithm. One of the experimental environments consisted of two indoor rooms in our office (indicated as Test bed 1), and the other was a space at the ninth floor of the Scientific Research Building in our university (indicated as Test bed 2). All the RSSs were collected using a smartphone with Bluetooth module (named terminal), which was held in front of the body by the testers. The BLE beacons and the terminal used in this work are shown in Figure 8.

Experimental Scenario and Implementation
We conducted our experiments in two indoor body-shadowing environments in order to evaluate the body-shadowing effect and the performance of the proposed BP-BEC algorithm. One of the experimental environments consisted of two indoor rooms in our office (indicated as Test bed 1), and the other was a space at the ninth floor of the Scientific Research Building in our university (indicated as Test bed 2). All the RSSs were collected using a smartphone with Bluetooth module (named terminal), which was held in front of the body by the testers. The BLE beacons and the terminal used in this work are shown in Figure 8.  Figure 9 shows the planer graph and the deployment of the BLE beacons (also named APs) in the Test bed 1. This test bed, with an area of 8 m by 16.46 m, consists of two office rooms, which are separated by a glass wall in the middle. The whole area in Test bed 1 was covered with Bluetooth signals from four beacons with different Universally Unique Identifiers (UUIDs), and the beacons were deployed around the room corners up on the ceilings, as shown in Figure 9. The test points are indicated by black crosses. The operating frequency of the BLE beacons was 2.4 GHz, and the signal transmitting frequency was about 2 Hz, which, in other words, means that we could collect two RSSs in one second. We conducted experiments to evaluate the body-shadowing influence on RSS in Test bed 1. The planer graph of Test bed 2 and the deployment of APs are shown in Figure 10, along with the implementation of the test points. This area is 25.86 m wide and 59.05 m long, and was covered with Bluetooth signals from 30 BLE beacons with unique UUIDs. The deployment of the beacons was ordered as T-shape lines with an interval of about 5 m, indicated by the red dots in Figure 10. Experiments on positioning performance evaluation were conducted in Test bed 2, and the locations of the test points are shown as black crosses in Figure 10.  Figure 9 shows the planer graph and the deployment of the BLE beacons (also named APs) in the Test bed 1. This test bed, with an area of 8 m by 16.46 m, consists of two office rooms, which are separated by a glass wall in the middle. The whole area in Test bed 1 was covered with Bluetooth signals from four beacons with different Universally Unique Identifiers (UUIDs), and the beacons were deployed around the room corners up on the ceilings, as shown in Figure 9. The test points are indicated by black crosses. The operating frequency of the BLE beacons was 2.4 GHz, and the signal transmitting frequency was about 2 Hz, which, in other words, means that we could collect two RSSs in one second. We conducted experiments to evaluate the body-shadowing influence on RSS in Test bed 1.  Figure 9 shows the planer graph and the deployment of the BLE beacons (also named APs) in the Test bed 1. This test bed, with an area of 8 m by 16.46 m, consists of two office rooms, which are separated by a glass wall in the middle. The whole area in Test bed 1 was covered with Bluetooth signals from four beacons with different Universally Unique Identifiers (UUIDs), and the beacons were deployed around the room corners up on the ceilings, as shown in Figure 9. The test points are indicated by black crosses. The operating frequency of the BLE beacons was 2.4 GHz, and the signal transmitting frequency was about 2 Hz, which, in other words, means that we could collect two RSSs in one second. We conducted experiments to evaluate the body-shadowing influence on RSS in Test bed 1. The planer graph of Test bed 2 and the deployment of APs are shown in Figure 10, along with the implementation of the test points. This area is 25.86 m wide and 59.05 m long, and was covered with Bluetooth signals from 30 BLE beacons with unique UUIDs. The deployment of the beacons was ordered as T-shape lines with an interval of about 5 m, indicated by the red dots in Figure 10. Experiments on positioning performance evaluation were conducted in Test bed 2, and the locations of the test points are shown as black crosses in Figure 10. The planer graph of Test bed 2 and the deployment of APs are shown in Figure 10, along with the implementation of the test points. This area is 25.86 m wide and 59.05 m long, and was covered with Bluetooth signals from 30 BLE beacons with unique UUIDs. The deployment of the beacons was ordered as T-shape lines with an interval of about 5 m, indicated by the red dots in Figure 10. Experiments on positioning performance evaluation were conducted in Test bed 2, and the locations of the test points are shown as black crosses in Figure 10.

BSIE Evaluation and Analysis
Experiments were conducted in Test bed 1 to evaluate the influence of body-shadowing on RSS and the factors that affect the body-shadowing error. We measured RSSs from one AP with an AP-UP distance ranging from 1m to 10m and with different shadowing angles, namely, "front", "side", and "back". We collected 240 pieces of RSS data at each AP-UP distance with each shadowing angle for one pair of AP-UP, and four pairs of AP-UP (AP9-UP, AP11-UP, AP21-UP, and AP25-UP) were evaluated, so that, totally, 28,800 pieces of RSS data were collected for BSIE evaluation. Without loss of generality, this section chooses the AP9-UP pair to verify and to represent the body-shadowing influence on RSS. The mean values of BSIE at the same test point for the same shadowing angle of all the test points were calculated for the analyses. This paper considered the RSS of the "front" state as a reference; the measured BSIE can be derived as follows by Equations (29) where , and , are the BSIE in the "side" shadowing angle and the "back" shadowing angle at the distance , respectively, and , , , , , , and , , are the mean values of filtered RSS data in these three shadowing angles at the distance for the k-th AP-UP pair.
The original RSS data and the filtered RSS data at a distance of 3 m for three shadowing angles of AP9-UP pair are shown in Figure 11a. The Cumulative Distribution Function (CDF) of the measured RSS is also shown in Figure 11b in order to give a better demonstration of the bodyshadowing influence.

BSIE Evaluation and Analysis
Experiments were conducted in Test bed 1 to evaluate the influence of body-shadowing on RSS and the factors that affect the body-shadowing error. We measured RSSs from one AP with an AP-UP distance ranging from 1m to 10m and with different shadowing angles, namely, "front", "side", and "back". We collected 240 pieces of RSS data at each AP-UP distance with each shadowing angle for one pair of AP-UP, and four pairs of AP-UP (AP9-UP, AP11-UP, AP21-UP, and AP25-UP) were evaluated, so that, totally, 28,800 pieces of RSS data were collected for BSIE evaluation. Without loss of generality, this section chooses the AP9-UP pair to verify and to represent the body-shadowing influence on RSS. The mean values of BSIE at the same test point for the same shadowing angle of all the test points were calculated for the analyses. This paper considered the RSS of the "front" state as a reference; the measured BSIE can be derived as follows by Equations (29) and (30).
where BSIE side,d and BSIE back,d are the BSIE in the "side" shadowing angle and the "back" shadowing angle at the distance d, respectively, and RSS f ront,d,k , RSS side,d,k , and RSS back,d,k are the mean values of filtered RSS data in these three shadowing angles at the distance d for the k-th AP-UP pair. The original RSS data and the filtered RSS data at a distance of 3 m for three shadowing angles of AP9-UP pair are shown in Figure 11a. The Cumulative Distribution Function (CDF) of the measured RSS is also shown in Figure 11b in order to give a better demonstration of the body-shadowing influence. As shown in Figure 11, the body-shadowing influence on RSS is obvious and could cause a considerable attenuation in the RSS. The RSS attenuation for the AP9-UP pair under body-shadowing is 10 dB for the "back" state and 3dB for the "side" state. It can also be concluded that different shadowing angles can influence differently the RSS measurements.
The relations between the measured BSIE and the AP-UP distance for both the "back" and the "side" shadowing angles were evaluated and represented in Figure 12. Meanwhile, the curve fitting was done based on the BSIE compensation model proposed in Section 3.2 utilizing the measured data. The fitting results are also shown in Figure 12, and the comparison of fitting curves for different shadowing angles together with the curve parameters are shown in Figure 13 and Table 2. Curve fitting was also done to estimate the parameters of PLM in our experimental environments; the PL0 was −50.06 and n was 2.33.  Distance between AP and UP [m]

Relation of BSIE and Distance in Side Shadowing State
Mean Value of BSIE Curve Fitting Results Figure 11. The RSS data for AP9-UP pair at a distance of 3 m for three shadowing angles: (a) the original measured RSS data and the filtered data through Kalman filter for the three angle states; (b) the Cumulative Distribution Function (CDF) of the measured RSS data for the three angle states.
As shown in Figure 11, the body-shadowing influence on RSS is obvious and could cause a considerable attenuation in the RSS. The RSS attenuation for the AP9-UP pair under body-shadowing is 10 dB for the "back" state and 3dB for the "side" state. It can also be concluded that different shadowing angles can influence differently the RSS measurements.
The relations between the measured BSIE and the AP-UP distance for both the "back" and the "side" shadowing angles were evaluated and represented in Figure 12. Meanwhile, the curve fitting was done based on the BSIE compensation model proposed in Section 3.2 utilizing the measured data. The fitting results are also shown in Figure 12, and the comparison of fitting curves for different shadowing angles together with the curve parameters are shown in Figure 13 and Table 2. Curve fitting was also done to estimate the parameters of PLM in our experimental environments; the PL 0 was −50.06 and n was 2.33. As shown in Figure 11, the body-shadowing influence on RSS is obvious and could cause a considerable attenuation in the RSS. The RSS attenuation for the AP9-UP pair under body-shadowing is 10 dB for the "back" state and 3dB for the "side" state. It can also be concluded that different shadowing angles can influence differently the RSS measurements.
The relations between the measured BSIE and the AP-UP distance for both the "back" and the "side" shadowing angles were evaluated and represented in Figure 12. Meanwhile, the curve fitting was done based on the BSIE compensation model proposed in Section 3.2 utilizing the measured data. The fitting results are also shown in Figure 12, and the comparison of fitting curves for different shadowing angles together with the curve parameters are shown in Figure 13 and Table 2. Curve fitting was also done to estimate the parameters of PLM in our experimental environments; the PL0 was −50.06 and n was 2.33.
(a) (b) Figure 12. The relation between the BSIE and the AP-UP distance for different shadowing angles: (a) the relation between the BSIE and the distance in the "back" state and the curve fitting results; (b) the relation between the BSIE and the distance in the "side" state and the curve fitting results. Distance between AP and UP [m]

Relation of BSIE and Distance in Side Shadowing State
Mean Value of BSIE Curve Fitting Results Figure 12. The relation between the BSIE and the AP-UP distance for different shadowing angles: (a) the relation between the BSIE and the distance in the "back" state and the curve fitting results; (b) the relation between the BSIE and the distance in the "side" state and the curve fitting results.

Positioning Performance Evaluation and Analysis
In order to evaluate the positioning performance of the BP-BEC algorithm proposed in this paper, experiments were conducted in Test bed 2, and both the positioning accuracy and the robustness of the positioning system were presented. Two evaluation indicators, namely, positioning error and robustness error, were utilized in this paper to represent the system's performance in terms of positioning accuracy and positioning robustness, respectively. This section firstly gives the descriptions of the evaluation indicators, and then the experimental results in a static scenario are shown and discussed. Moreover, the convergence time of the BP-BEC algorithm was evaluated, and continuous positioning results using the proposed algorithm are also presented.

Performance Evaluation Indicators
The performance evaluation indicators in this paper consist of the positioning error and the robustness error. The positioning error refers to the relative position of the real position and calculated position using the positioning algorithms of a UP, which in other words means the distance between the real position and the calculated position. The mathematical expression of the positioning error is as follows: where , stands for the positioning error at the m-th test point, ( , ) is the true coordinates of the m-th test point, and ( ′ , ′ ) is the localization result of the m-th test point.
The robustness error used in this paper represents the stability performance of the system when the body-shadowing state at a UP changes, for example from "front" to "back". The works in [16] demonstrated that different human body's directions can cause different attenuations in the RSS of

Positioning Performance Evaluation and Analysis
In order to evaluate the positioning performance of the BP-BEC algorithm proposed in this paper, experiments were conducted in Test bed 2, and both the positioning accuracy and the robustness of the positioning system were presented. Two evaluation indicators, namely, positioning error and robustness error, were utilized in this paper to represent the system's performance in terms of positioning accuracy and positioning robustness, respectively. This section firstly gives the descriptions of the evaluation indicators, and then the experimental results in a static scenario are shown and discussed. Moreover, the convergence time of the BP-BEC algorithm was evaluated, and continuous positioning results using the proposed algorithm are also presented.

Performance Evaluation Indicators
The performance evaluation indicators in this paper consist of the positioning error and the robustness error. The positioning error refers to the relative position of the real position and calculated position using the positioning algorithms of a UP, which in other words means the distance between the real position and the calculated position. The mathematical expression of the positioning error is as follows: where error a,m stands for the positioning error at the m-th test point, (x m , y m ) is the true coordinates of the m-th test point, and x m , y m is the localization result of the m-th test point. The robustness error used in this paper represents the stability performance of the system when the body-shadowing state at a UP changes, for example from "front" to "back". The works in [16] demonstrated that different human body's directions can cause different attenuations in the RSS of WLAN signals, which has also been shown in Section 4.2 for Bluetooth signals. According to the characteristics of Test bed 2 in Figure 10, we selected two directions, i.e., North-facing and South-facing, in each test point for robustness evaluation. The robustness error in this paper is the difference of the positioning results under different facing directions; the corresponding mathematical expression is shown in Equation (32): where error r,m stands for the robustness error at the m-th test point, and (x m,N , y m,N ) and (x m,S , y m,S ) are the localization results when the human with a smartphone is facing North and South, respectively. Considering the deployment of APs and the Geometric Dilution of Precision (GDOP) when performing positioning algorithms, this paper used both the LS method and the WKNN algorithm in the BP-BEC algorithm. The LS method was applied in four rooms with good GDOP (Room 905, Room 906, Room 907, and Room 908), and the WKNN algorithm was applied in the corridor of Test bed 2. As a control, algorithms without body-shadowing error compensation (called no-BEC) were also be implemented in Test bed 2. This paper selected 17 test points, and both North-facing and South-facing RSS were collected for robustness evaluation. We collected 60 pieces of RSS data that were averaged at each point for each facing direction, providing 34 results for accuracy evaluation and 17 results for robustness evaluation.

Positioning Accuracy Measurements and Analysis
Experiments on positioning accuracy for both the BP-BEC algorithm and the no-BEC algorithm were designed and conducted in Test bed 2, and all the positioning errors at the test points were calculated according to Equation (30). The comparisons of positioning are shown in Figure 14 and Table 3. It can be concluded that the BP-BEC algorithm outperforms the no-BEC algorithm in positioning accuracy because of the compensation of the body-shadowing error. The mean positioning accuracy was improved by about 60.1% using BP-BEC compared to no-BEC. Considering the deployment of APs and the Geometric Dilution of Precision (GDOP) when performing positioning algorithms, this paper used both the LS method and the WKNN algorithm in the BP-BEC algorithm. The LS method was applied in four rooms with good GDOP (Room 905, Room 906, Room 907, and Room 908), and the WKNN algorithm was applied in the corridor of Test bed 2. As a control, algorithms without body-shadowing error compensation (called no-BEC) were also be implemented in Test bed 2. This paper selected 17 test points, and both North-facing and South-facing RSS were collected for robustness evaluation. We collected 60 pieces of RSS data that were averaged at each point for each facing direction, providing 34 results for accuracy evaluation and 17 results for robustness evaluation.

Positioning Accuracy Measurements and Analysis
Experiments on positioning accuracy for both the BP-BEC algorithm and the no-BEC algorithm were designed and conducted in Test bed 2, and all the positioning errors at the test points were calculated according to Equation (30). The comparisons of positioning are shown in Figure 14 and Table 3. It can be concluded that the BP-BEC algorithm outperforms the no-BEC algorithm in positioning accuracy because of the compensation of the body-shadowing error. The mean positioning accuracy was improved by about 60.1% using BP-BEC compared to no-BEC.

Positioning Robustness Evaluation and Analysis
The robustness error for all test points was calculated according to Equation (31), and the comparison in terms of positioning robustness for these two algorithms are presented in Figure 15 and Table 4. It can be concluded that the BP-BEC algorithm could improve the positioning robustness by about 73.6% compared to the no-BEC algorithm, and the mean error with different heading directions in the BP-BEC algorithm was 0.92m, compared to 3.49m in the no-BEC algorithm.

Positioning Robustness Evaluation and Analysis
The robustness error for all test points was calculated according to Equation (31), and the comparison in terms of positioning robustness for these two algorithms are presented in Figure 15 and Table 4. It can be concluded that the BP-BEC algorithm could improve the positioning robustness by about 73.6% compared to the no-BEC algorithm, and the mean error with different heading directions in the BP-BEC algorithm was 0.92m, compared to 3.49m in the no-BEC algorithm.

. Positioning Evaluation under a Dynamic Situation
Positioning algorithms should meet the demands of localization in dynamic environments, which, in other words, means that the speed of providing positioning results should also be considered when evaluating a positioning system. In this section, the speed of convergence for the BP-BEC algorithm and the time of providing results for the no-BEC algorithm are shown and discussed. Moreover, continuous localization trajectories in Test bed 2 for the BP-BEC and the no-BEC algorithms are also shown and analyzed.
For the purpose of convergence speed evaluation, both the BP-BEC and the no-BEC algorithms were used in the same computer on the collected RSS data for all the 17 test points. The execution times of these two algorithms for each test point were recorded and are shown in Figure 16.
As shown in Figure 16, the mean execution time of the BP-BEC algorithm was 18.5 ms, whereas that of the no-BEC algorithm was 9.1 ms. It can be concluded that the execution time of the BP-BEC algorithm is longer than that of the no-BEC algorithm, because there are iterative processes in the BP-BEC in order to compensate the body-shadowing error. However, the execution time of the BP-BEC algorithm is still at a millisecond level, while the walking speed of humans is usually about 0.8~1.3 m/s [29], and an amount of some tens of milliseconds is much lower than the reaction time of the human body, which means that the convergence speed would not affect the localization of a real-case walking situation.

Positioning Evaluation under a Dynamic Situation
Positioning algorithms should meet the demands of localization in dynamic environments, which, in other words, means that the speed of providing positioning results should also be considered when evaluating a positioning system. In this section, the speed of convergence for the BP-BEC algorithm and the time of providing results for the no-BEC algorithm are shown and discussed. Moreover, continuous localization trajectories in Test bed 2 for the BP-BEC and the no-BEC algorithms are also shown and analyzed.
For the purpose of convergence speed evaluation, both the BP-BEC and the no-BEC algorithms were used in the same computer on the collected RSS data for all the 17 test points. The execution times of these two algorithms for each test point were recorded and are shown in Figure 16.
As shown in Figure 16, the mean execution time of the BP-BEC algorithm was 18.5 ms, whereas that of the no-BEC algorithm was 9.1 ms. It can be concluded that the execution time of the BP-BEC algorithm is longer than that of the no-BEC algorithm, because there are iterative processes in the BP-BEC in order to compensate the body-shadowing error. However, the execution time of the BP-BEC algorithm is still at a millisecond level, while the walking speed of humans is usually about 0.8~1.3 m/s [29], and an amount of some tens of milliseconds is much lower than the reaction time of the human body, which means that the convergence speed would not affect the localization of a real-case walking situation. In order to evaluate the performance of the proposed algorithm under a dynamic situation, experiments were conducted in Test bed 2, and two trajectories were selected. The device was held by the tester in front of the body while the tester moved at a walking speed. The real trajectories in Test bed 2 are shown in Figure 17a,b. With an IMU-aided method, the RSS data at a UP was collected and filtered in each step interval for both the BP-BEC and the no-BEC algorithms to generate positioning results, and the positioning results in a moving condition along the trajectories for both algorithms are shown in Figure 17c,d. It can be concluded that the real-case situation localization is not affected by the convergence speed of the BP-BEC algorithm, and both the positioning accuracy and the robustness were improved compared to the no-BEC algorithm. In order to evaluate the performance of the proposed algorithm under a dynamic situation, experiments were conducted in Test bed 2, and two trajectories were selected. The device was held by the tester in front of the body while the tester moved at a walking speed. The real trajectories in Test bed 2 are shown in Figure 17a,b. With an IMU-aided method, the RSS data at a UP was collected and filtered in each step interval for both the BP-BEC and the no-BEC algorithms to generate positioning results, and the positioning results in a moving condition along the trajectories for both algorithms are shown in Figure 17c,d. It can be concluded that the real-case situation localization is not affected by the convergence speed of the BP-BEC algorithm, and both the positioning accuracy and the robustness were improved compared to the no-BEC algorithm. In order to evaluate the performance of the proposed algorithm under a dynamic situation, experiments were conducted in Test bed 2, and two trajectories were selected. The device was held by the tester in front of the body while the tester moved at a walking speed. The real trajectories in Test bed 2 are shown in Figure 17a,b. With an IMU-aided method, the RSS data at a UP was collected and filtered in each step interval for both the BP-BEC and the no-BEC algorithms to generate positioning results, and the positioning results in a moving condition along the trajectories for both algorithms are shown in Figure 17c,d. It can be concluded that the real-case situation localization is not affected by the convergence speed of the BP-BEC algorithm, and both the positioning accuracy and the robustness were improved compared to the no-BEC algorithm.

Discussion of the Strengths and Weaknesses of the Proposed Method
The strength of the BP-BEC algorithm mainly consist of the improvements in both positioning accuracy and robustness, which were demonstrated by the experimental results. The BP-BEC improves the positioning accuracy and robustness by about 60.1% and 73.6%, respectively, compared to the no-BEC. In addition, our works could also provide an alternative strategy when considering the body-shadowing error mitigation. The weakness of the proposed algorithm lies in the execution time of BP-BEC algorithm. The execution time of the BP-BEC algorithm is longer than that of the no-BEC algorithm because it implies iterations in order to compensate the BSIE. However, the speed of generating localization results of the BP-BEC algorithm is still at the millisecond level, which would have an insignificant effect on real-time localizations according to the experimental results in Section 4.3.4.

Conclusions
In this paper, an IMU-aided body-shadowing error compensation method has been proposed, analyzed, and evaluated. The body-shadowing impairment on both RSS-based ranging and trilateration positioning was studied, and a mathematical expression of the relation between the BSIE and the positioning error was derived based on PLM. Factors which may affect the BSIE were given and studied, and an IMU-aided body-shadowing detection strategy was designed to distinguish the shadowed APs in the positioning system. In addition, a body-shadowing error compensation model was established and the BP-BEC algorithm was proposed to improve the positioning accuracy and robustness in indoor BLE positioning. Experiments were designed and conducted in two test beds to validate the improvement of the proposed algorithm. The results showed that the BP-BEC algorithm could improve the positioning accuracy and robustness by about 60.1% and 73.6%, respectively, compared to the no-BEC algorithm. Moreover, the speed of generating the positioning results for the BP-BEC algorithm was also evaluated and discussed. Although the convergence speed of positioning is partly sacrificed in the BP-BEC algorithm because of the body-shadowing error compensation, the localization results in a real-case situation with movements at a walking speed is not affected. Our work could be helpful for the implementation of indoor RSS-based positioning systems and it could also be a guidance for body-shadowing error mitigation and performance improvement of indoor positioning systems.

Discussion of the Strengths and Weaknesses of the Proposed Method
The strength of the BP-BEC algorithm mainly consist of the improvements in both positioning accuracy and robustness, which were demonstrated by the experimental results. The BP-BEC improves the positioning accuracy and robustness by about 60.1% and 73.6%, respectively, compared to the no-BEC. In addition, our works could also provide an alternative strategy when considering the body-shadowing error mitigation. The weakness of the proposed algorithm lies in the execution time of BP-BEC algorithm. The execution time of the BP-BEC algorithm is longer than that of the no-BEC algorithm because it implies iterations in order to compensate the BSIE. However, the speed of generating localization results of the BP-BEC algorithm is still at the millisecond level, which would have an insignificant effect on real-time localizations according to the experimental results in Section 4.3.4.

Conclusions
In this paper, an IMU-aided body-shadowing error compensation method has been proposed, analyzed, and evaluated. The body-shadowing impairment on both RSS-based ranging and trilateration positioning was studied, and a mathematical expression of the relation between the BSIE and the positioning error was derived based on PLM. Factors which may affect the BSIE were given and studied, and an IMU-aided body-shadowing detection strategy was designed to distinguish the shadowed APs in the positioning system. In addition, a body-shadowing error compensation model was established and the BP-BEC algorithm was proposed to improve the positioning accuracy and robustness in indoor BLE positioning. Experiments were designed and conducted in two test beds to validate the improvement of the proposed algorithm. The results showed that the BP-BEC algorithm could improve the positioning accuracy and robustness by about 60.1% and 73.6%, respectively, compared to the no-BEC algorithm. Moreover, the speed of generating the positioning results for the BP-BEC algorithm was also evaluated and discussed. Although the convergence speed of positioning is partly sacrificed in the BP-BEC algorithm because of the body-shadowing error compensation, the localization results in a real-case situation with movements at a walking speed is not affected. Our work could be helpful for the implementation of indoor RSS-based positioning systems and it could also be a guidance for body-shadowing error mitigation and performance improvement of indoor positioning systems.