# Multi-Condition Constrained Pedestrian Localization Algorithm Based on IMU
## 2 Methods  
### Pedestrian Navigation State Estimation Framework  
The core foundation of pedestrian navigation research is to effectively extract useful information from the walking data obtained by inertial sensors, and to conduct an in-depth analysis of these data to identify and infer the navigation state of the pedestrian at each moment. This enables the reconstruction of the pedestrian's movement trajectory, thereby achieving autonomous localization. The basic framework used in this article is shown in Figure 1.  
From the simplified framework diagram of the pedestrian navigation algorithm above, we can roughly understand the basic principles and steps involved in pedestrian navigation state estimation. Specifically, \(\varphi_{0}^{n}\) represents the initial attitude angle; \(R_{\varphi_{0}}^{n}\) is the rotation matrix that converts from the body frame to the navigation frame, derived from; \(q_{0}^{n}\) is the  
Figure 1: Navigation State Estimation Basic Framework.  
initial quaternion obtained from the conversion of \(\mathrm{R_{bq}^{n}}\); \(\mathrm{q_{i}^{n}}\) represents the new quaternion at the next time step, calculated using the gyro measurement at the current time and the quaternion \(\mathrm{q_{0}^{n}}\); \(\mathrm{R_{bq}^{n}}\) is the rotation matrix from \(\mathrm{q_{i}^{n}}\) that converts the body frame to the navigation frame; finally, the current attitude angle \(\mathrm{\varphi_{i}^{n}}\) can be directly computed from \(\mathrm{R_{bq}^{n}}\). Additionally, by combining the accelerometer and gyroscope measurements, along with \(\mathrm{R_{bq}^{n}}\), further calculations can provide the pedestrian's location and velocity information at the current moment, denoted as \(\mathrm{p_{i}^{n}}\) and \(\mathrm{v_{i}^{n}}\).  
The mutual conversion between quaternions, rotation matrices, and attitude angles follows well-established methods in the literature, so these will not be elaborated further here. The basic idea for calculating the pedestrian's location and velocity at the i-th moment is as follows. By integrating the accelerometer data, the velocity at the corresponding time can be obtained, and by integrating the velocity, the corresponding location can be derived. The specific formulas are as follows:  
\[\begin{cases}\mathrm{v(t)}=\mathrm{v_{0}}+\int\mathrm{a(t)dt}\\ \mathrm{x(t)}=\mathrm{x_{0}}+\int\mathrm{v(t)dt^{\prime}}\end{cases} \tag{1}\]  
where \(\mathrm{a(t)}\) is the accelerometer measurement in the navigation frame at the i-th moment, and the specific calculation formula for the three-axis accelerometer values at time i is:  
\[\mathrm{p_{i}^{n}}=\mathrm{p_{i-1}^{n}}+\mathrm{v_{i-1}^{n}}\cdot\mathrm{Ts}+ \frac{1}{2}\cdot\mathrm{acc_{i}^{n}}\cdot\mathrm{Ts}^{2}\\ \mathrm{v_{i}^{n}}=\mathrm{v_{i-1}^{n}}+\mathrm{acc_{i}}\cdot\mathrm{Ts}\end{cases}, \tag{2}\]  
where Ts is the sampling frequency of the IMU, and \(\mathrm{acc_{i}}\) represents the three-axis pedestrian acceleration information in the navigation frame at the i-th moment. The calculation formula for \(\mathrm{acc_{i}}\) is:  
\[\begin{array}{c}\mathrm{acc_{i}^{n}}=\mathrm{R_{b}^{t}}\cdot\mathrm{a_{iv}^ {n}}\\ \mathrm{acc_{iv}^{n}}=\mathrm{R_{b}^{t}}\cdot\mathrm{a_{iv}^{n}}\\ \mathrm{acc_{i2}^{n}}=\mathrm{R_{b}^{t}}\cdot\mathrm{a_{iv}^{n}}-\mathrm{g} \end{array}. \tag{3}\]