# Location-Aware Point-to-Point RPL in Indoor IR-UWB Networks
## 3 UWB-Based Cooperative Multi-Hop Self Localization
### Mobile Node Tracking Based on the Inertial Navigation System with Particle Filtering  
The Inertial Navigation System (INS) provides a methodology for tracking the position and the direction of a mobile device using inertial sensors. Particle filtering based INS is used to accurately track the B-box of the mobile node. The particle filter describes the posterior distribution of the probabilistic process, using a set of weighted samples. Every mobile node keeps one set of weighted particles to track its movement. Each particle has a state with the position and the orientation of the mobile node. The weight \(\omega\) of each particle represents the probability of that particle being sampled. The state vector **s** of each particle consists of two-dimensional position coordinates **r** and the orientation  
Figure 2: The process of determining the B-box state. quaternion \(\mathbf{q}\). Assuming that each mobile node holds \(N_{p}\) particles, the weighted particle set at node \(\eta_{j}\) is defined as:  
\[\mathbf{\xi}_{j,k}\equiv\left\{\left\langle\mathbf{s}_{j,k}^{l},\omega_{j,k}^{l }\right\rangle\mid l\in\left\{1,\cdots,N_{p}\right\}\right\},\quad\eta_{j}\in \Omega_{m} \tag{6}\]  
\[\mathbf{s}_{j,k}^{l}\equiv\left[\mathbf{r}_{j,k}^{l}\quad\mathbf{q}_{j,k}^{l }\right]^{T} \tag{7}\]  
According to the particle set \(\mathbf{\xi}_{j,k}\), the posterior probability of the mobile node location is described as:  
\[p\left(\mathbf{s}_{j,k}\right)\approx\sum_{l=1}^{N_{p}}\omega_{j,k}^{l}\delta \left(\mathbf{s}_{j,k}-\mathbf{s}_{j,k}^{l}\right) \tag{8}\]  
where \(\delta\left(\cdot\right)\) is the Dirac delta function. The particle filtering iteration of the mobile node begins with B-box initialization. At the beginning of the particle filtering, the positional state variable of each particle is sampled uniformly within the B-box region, and the orientation quaternions are initialized as arbitrary values in the entire state space because no relevant information is provided:  
\[\mathbf{\xi}_{j,k}\sim p\left(\mathbf{s}_{j,k}\mid\mathbf{B}_{j,k}\right), \quad\eta_{j}\in\Omega_{m} \tag{9}\]  
If the particle set was initialized in the previous iteration, the weight of the particles is adjusted according to the state of the B-box state. Since all particles must be located in the B-box state, the weight of particles located outside the B-box area is adjusted to zero. The probability that each particle state of the mobile node satisfies the current B-box constraint is given by:  
\[p\left(\mathbf{B}_{j,k}\mid\mathbf{s}_{j,k}^{l}\right)= \begin{cases}1&x_{j,k}^ {lb}\leq x_{j,k}^{l}\leq x_{j,k}^{ub}\,and\,y_{j,k}^{lb}\leq y_{j,k}^{l}\leq y_ {j,k}^{ub}\\ 0&else\end{cases}  \tag{10}\]  
Each particle state is associated with a weight. The adjusted weight is proportional to the probability that the particle follows the B-box constraint. \[\omega_{j,k}^{l}\propto\omega_{j,k-1}^{l}p\left(\mathbf{B}_{j,k}\mid\mathbf{ s}_{j,k}^{l}\right),\quad l=1,...,N_{p} \tag{11}\]  
The particle states are independently updated according to the transition model to track the movement of the mobile node. In tracking of smartphones, the particle states are updated according to the pedestrian model, which includes step detection, step length estimation, and rotation tracking. Input sample values of the step length and heading direction are used to update the state of each particle. If no step event has been detected since the last prediction update, all step length values are set to zero. The step length values \(\Delta\lambda\) are sampled according to the accelerometer and gyroscope output sequences \(\mathbf{\alpha}_{0:k},\mathbf{\gamma}_{0:k}\):  
\[\left\{\Delta\lambda\,_{j,k}^{l}\mid l\in\left\{1,\cdots,N_{p}\right\}\right\} \sim p\left(\Delta\lambda\,_{j,k}\mid\mathbf{\alpha}_{0:k},\mathbf{\gamma}_{0 :k}\right) \tag{12}\]  
After sampling all the step length values, we need to determine the moving direction of each particle.