# Real-Time Indoor Positioning Approach Using iBeacons and Smartphone Sensors
## 4 Experiment
As mentioned above, we considered two errors for real-time tracking: inaccurate initial position and disturbed orientation. Figure 11 presents the positioning result of Route 1 with an inaccurate initial position. This position has an error of 2.30 m. Figure 11a,b presents the raw PDR locations and those with filtered orientations, respectively. There is certain accuracy improvement around turn locations. However, the orientation filtering still cannot eliminate the systematic drifting caused by the initial position and directional measurements. In contrast, the final trajectory overcomes the both types of error (Figure 11c). \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **RMSE XY (m)** & **RMSE X (m)** & **RMSE Y (m)** & **Mean Error X (m)** & **Mean Error Y (m)** \\ \hline Route 1 & 2.71 & 2.57 & 0.85 & 1.90 & 0.60 \\ Route 2 & 2.77 & 2.69 & 0.66 & 2.06 & 0.50 \\ All & 2.75 & 2.65 & 0.74 & 2.00 & 0.53 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Accuracy of the positioning method fusing trilateration and fingerprinting of iBeacon. Figure 11: Trajectory of Route 1 with an inaccurate initial position, where red lines represent the trail of user and black lines indicate the ground truth: (**a**) PDR locations; (**b**) PDR locations after orientation filtering; and (**c**) the path derived from the fusion workflow. Figure 10: The BLE-derived locations. The black lines indicate the ground truth: (**a**) Route 1; and (**b**) Route 2. Figure 12 presents the real-time trajectories when the smartphone was randomly swayed between left and right directions. Figure 12a shows the noises in orientation severely influences the positioning accuracy. The angle at all these turn locations are incorrect. The orientations and the related location estimates are improved in Figure 12b, although the error is still considerable. The location accuracy is largely improved by the proposed fusion workflow. Figure 12c shows that this orientation noise can be alleviated by the result of the BLE-based method. Figure 13 presents the tracking result of Route 2 with an inaccurate initial position. The error of the position is 2.03 m. Figure 13a presents an obvious systematic error on absolute coordinates. Similarly, orientation filtering provides local corrections (e.g., more overlapping segments), although the systematic error still exists (Figure 13b). The systematic drifting is removed in the trajectory of Figure 13c at the beginning phase. The four segments of the trajectory divided by the three U-turns highly overlap with the ground truth, which proves the proposed fusion workflow can deal with changes at turns as planned. When the smartphone is swayed, the PDR computation becomes error-prone because of the noise of orientation measurement.The first segment of the trajectory in Figure 14a gets over the turn point,  
Figure 12: Trajectory of Route 1 when the heading was randomly swayed: (**a**) PDR locations; (**b**) PDR locations after orientation filtering; and (**c**) the path derived from the fusion workflow. Figure 13: Trajectory of Route 2 with an inaccurate initial position: (**a**) PDR locations; (**b**) PDR locations after orientation filtering; and (**c**) the path derived from the fusion workflow. which deteriorates the precision of the following location estimates. The proposed fusion method corrects most locations of PDR back to the corridor area (Figure 14c). The improvement of accuracy also validates the use of the BLE-based method on severe deviation of PDR. The above results demonstrate the BLE-based method can compensate the drifting error of PDR, and their fusion can improve positioning accuracy. For instance, the accuracy regarding inaccurate initial position is a little higher than the independent BLE positioning. With disturbed orientations, the proposed fusion method can resist the noisy measurements and still obtain a stable accuracy. Table 3 lists the RMSE of the four cases. We ran the proposed fusion workflow for each route four times and calculated the RMSE by averaging the test results.