# Intelligent Fusion Structure for Wi-Fi/BLE/QR/MEMS Sensor-Based Indoor Localization
## 4 Intelligent Integration Model of Wi-Fi/BLE/QR/Mems Sensors
### Multi-Source Integration via Robust Unscented Kalman Filter  
In this work, in order to cover a large-scale indoor space, hybrid measurements were used as the observation model, including the Wi-Fi FTM- and BLE-based ranging results, landmark-detection results, and MEMS sensor-based estimation results:  
\[\delta z_{d}= \begin{bmatrix}\delta z_{1,ranging}\\ \vdots\\ \delta z_{m,ranging}\end{bmatrix} = \begin{bmatrix}\zeta_{MEMS,1}-\zeta_{wifi/ ble,1}\\ \vdots\\ \zeta_{MEMS,m}-\zeta_{wifi/ble,m}\end{bmatrix}  \tag{24}\]  
where \(\delta z_{m,ranging}\) indicates the calculated observation residuals between MEMS sensor-based distance-estimation results and the wireless-signal-based ranging results. To provide a full range of observations, the landmark-detection results of Wi-Fi FTM stations can also be served as the observed location for the MEMS-sensor approach:  
\[\delta z_{\tau}^{n}=\mathbf{r}_{wifi}^{n}-\mathbf{r}_{MEMS}^{n}=\delta\mathbf{r}+n_{wifi} \tag{25}\]  
where \(\mathbf{r}_{wifi}^{n}\) represents the location of the Wi-Fi FTM station obtained when the landmark is detected; in this case, the uncertainty error of detected Wi-Fi landmarks can be described as:  
\[n_{wifi}\sim\sum_{\tau=0}^{\partial}\mathbf{v}_{RuKF}^{n}(\tau)d\tau \tag{26}\]  
where \(\mathbf{v}_{RuKF}^{n}(\tau)\) represents the RUKF-provided speed information in the landmark-detection procedure, \(\tau\) indicates the recorded timestamp, and \(\partial\) is the half-length of the DTW period. BLE landmarks can also be identified when the DTW index meets a set threshold, and the absolute 3D position provided by the recognized BLE landmark is described as:  
\[\delta z_{p}^{n}=\mathbf{p}_{BLE}^{n}-\mathbf{p}_{{}_{\text{\tiny{INS}}}}^{n}=\delta \mathbf{p}+n_{BLE} \tag{27}\]  
where \(\mathbf{p}_{BLE}^{n}\) indicates the 3D position of the recognized BLE landmark; the measurement error of the detected BLE landmark is calculated as:  
\[n_{BLE}\sim\sum_{\tau=0}^{\partial}\mathbf{v}_{{}_{\text{\tiny{INS}}}}^{n}(\tau)d\tau \tag{28}\]  
where \(\mathbf{v}_{{}_{\text{\tiny{INS}}}}^{n}(\tau)\) represents the travel speed of the inertial ranging provided within the time window applied, \(\tau\) indicates the time epoch, and \(\partial\) indicates the length-of-time window. To improve the diversity of landmarks, the QR code is applied as a third kind of landmark point, which also provides absolute 3D location information:  
\[\delta z_{p}^{n}=\mathbf{p}_{QR}^{n}-\mathbf{p}_{{}_{\text{\tiny{INS}}}}^{n}=\delta \mathbf{p}+n_{QR} \tag{29}\]  
where \(\mathbf{p}_{QR}^{n}\) indicates the 3D positioning information of the scanned QR code; the measurement error of scanned QR code is calculated as:  
\[n_{QR}\sim\sum_{\tau=0}^{\partial}\mathbf{v}_{{}_{\text{\tiny{INS}}}}^{n}(\tau)d\tau \tag{30}\]  
where \(\mathbf{v}_{{}_{\text{\tiny{INS}}}}^{n}(\tau)\) represents the inertial odometry-provided walking speed during the time period of camera scanning, \(\tau\) indicates the time epoch, and \(\partial\) indicates the recorded time period of the camera scanning. To reduce the impact of gross errors in measurement-positioning sources, RUKF is used to achieve accurate and stable multi-source fusion based on the indoor positioning framework, as the ranging models based on Wi-Fi FTM and BLE RSSI are non-linear in the multi-source fusion process; hence, there is a need to use UKF for effective fusion, and the variance expansion parameter can effectively overcome the observed gross errors to improve the final positioning accuracy. In this context, we proposed the variance inflation parameter to adjust the weights of the measurement vectors accordingly:  
\[\lambda_{ii}=\left\{ \begin{array}{l}1,\left|\widetilde{v}_{i}\right|=\left| \frac{\overline{v}_{i}}{\widetilde{v}_{i_{j}}}\right|\leq c\\ \frac{\left|\widetilde{v}_{i}\right|}{c},\left|\widetilde{v}_{i}\right|>c\end{array} \right.