# S-PDR: SBAUPT-Based Pedestrian Dead Reckoning Algorithm for Free-Moving Handheld Devices
## 2 Related Work
### Alignment and Walking Direction Estimation  
Although gyroscopes are known for their short-term accuracy and reliability in comparison to accelerometers, the continuous integration of the angular rates over time will cause drift in the estimated attitudes. Errors in attitude angles affect the transformation of accelerations and magnetic measurements to LLF. On one hand, failure to do proper alignment between the navigation device--sensor/body frame (BF)--and LLF results in wrong gravity compensation, causing wrong step length estimation. On the other hand, the wrong leveling of magnetic measurements affects the quality of azimuth estimation and correction leading to the wrong direction of motion estimation. These factors combined result in fast and high drift in position estimation and divergence from the true navigation solution. For attitude and heading estimation in PDR, the attitude and heading reference system (AHRS) algorithm is employed to enhance the PDR performance. The main concept of an AHRS is to fuse the data from magnetic, angular rate, and gravity (MARG) sensors, where each sensor is used to compensate for the biases introduced by the other sensors. The data from all sensors go through an attitude/orientation filter to get the final estimated attitude angles. Some of the commonly used AHRS systems are the fundamental AHRS [44], Mahony [45], Madgwick [46], and DLR-AHRS [44]. In the case of smartphone navigation, there is another factor which is the changing orientation of the device with respect to the user. This variability raises a new problem, where the heading of the user and the navigation device can be different in many cases. This imposes extra processing to estimate the heading of the pedestrian separately from the azimuth angle. The attitude mechanization suffers from drift from measurement integration and imposes the need for periodic attitude corrections and realignment between the BF and LLF. The realignment process is usually carried out in two phases, the first is leveling where tilting angles--roll and pitch--are estimated, and then the azimuth is corrected from projected magnetic measurements in the LLF. For the tilt compensation, the accelerometer measurements are used to extract gravity information for the leveling process. One way to estimate the gravity components is through averaging of acceleration measurements over a window of time [47, 48, 49], where the underlying principle is that accelerations over time will tend to gravity value. The magnetometer is then used for azimuth estimation, and the magnetic measurements are validated to reduce the effect of magnetic interference [46, 50, 51, 52, 53]. Fusion of sensor data from accelerometer, gyroscope, and magnetometer is used for In-run calibration to estimate the errors in the measured angular rates [54, 55]. Alternative sensors that can derive angular rates can be used for attitude correction such as a camera. Cameras can be used to derive visual angular rates through feature extraction from subsequent frames [56, 57] and can be used to provide corrections for the estimated attitudes from the gyroscope and magnetometer. Filters and optimization techniques are used for information fusion from IMU and possible alternative sensors to form an AHR system. Some of these techniques are but not limited to: complementary filter (CP) [58, 59], extended Kalman filter (EKF) [60], unscented Kalman filter (UKF) [21, 50], particle filter (PF) [51], quaternion EKF with gradient descent (GD) [61]. After the attitudes representing the misalignment between the BF and LLF are estimated, the heading direction of the user is needed. The main source of direction of motion information is the projected accelerations in the LLF, hence the majority of the research regarding this issue relies on different ways to analyze the projected accelerations. In its simplest form, the heading of a step can be computed from the arctangent of the accumulative accelerations of the step [62], but suffers from the inaccuracies in the accelerations unless filtered properly.