### Heading Drift Correction Methods Based on Heuristic and Magnetic Field-Aided Methods  
To mitigate the heading drift, the zero-angular-rate update (ZARU) algorithm [39] was proposed to estimate the gyro biases, and then the heading error could be reduced. However, according to [30], there is a small rotation of the foot during the stance phase. Hence, ZARU should be used in the still phase instead of in every stance phase. [PERSON] et al. proposed the heuristic drift reduction (HDR) algorithm [40], inspired by the tendency of pedestrians to walk along a straight line. The basic theory of the HDR method is that the ideal output of a z-axis gyro should be zero when a pedestrian walks along an absolutely straight line, but the actual output is gyro drift. Thus, the drift could be regarded as a disturbance and tracked using an I-controller in a closed-loop control system. Since pedestrians generally walk along the dominant paths in buildings, heuristic drift elimination (HDE) algorithms [41; 42] were further proposed. Following similar hypotheses (i.e., the ideal heading should be constant when a pedestrian walks along an absolutely straight line, but the actual heading difference is the heading drift) to those of the original HDR, the algorithm termed as heuristic heading reduction (we call it \"new HDR\" here) was implemented with a KF framework [39]. It is very different from the original HDR. Instead of filtering the gyro signals with a binary I-controller, the new HDR algorithm works in the yaw space. In addition, magnetic fields [39; 43; 44] are commonly employed as references to improve the heading or quaternion estimation accuracy, such as with the electronic compass (EC) algorithm [39]. However, since magnetic fields are easily affected by ferromagnetic objects and other magnetic sources, it is difficult for these approaches to achieve stable performance, especially in buildings, where magnetic fields are affected by the concrete structure. By investigating the magnetic fields above the floor (from 5 to 180 cm height) of a laboratory, [PERSON] et al. [45] concluded that the magnetic fields suffered the strongest magnetic disturbances at a 5 cm height, but some pure magnetic fields still existed at this height. Because the foot-mounted sensor was located at a height near 5 cm, it was reasonable to design a magnetic disturbance detector (MDD) to filter the magnetic fields. For an MDD applied in a PNS, the simplest approach is to employ a validation gate on normalized magnetic fields [46]. With the assumption that a measured pure magnetic field is quasistatic when the magnetometer remains stationary, [PERSON] et al. [47] proposed a quasistatic magnetic field detector (QMD) by checking the variation in the magnetic field vector under the body frame (b-frame), and then applied the detector to a handheld magnetic-sensor-aided PNS. The authors of [9] reported a foot-mounted pedestrian navigation reference system (PERSY) that integrated a QMD and other error-correction algorithms. [PERSON] et al. [48] improved the QMD and applied it to a foot-mounted compass-aided PNS. However, the improved QMD was limited by the walking pattern and worked only during straight-line walking. Assuming that the total magnetic field intensity and the magnetic inclination in pure magnetic fields are constant in a local area, [PERSON] et al. [31] proposed another MDD by checking the validation gates of the two features. Similarly, [PERSON] et al. [49] proposed a threshold-based magnetic disturbance detection algorithm that utilized the measured magnetic field vector and magnetic inclination to match the true magnetic field vector and true magnetic inclination, respectively. There are also some works on integrating both heuristic methods and magnetic data [31; 39]. These works generally switch among different constraint methods according to different conditions.