(1) The initial position and heading of pedestrian are known

The distribution of the sampled particles is shown in Figure 7. The noise of step length and heading change of particles conform to Gaussian distribution. At the beginning, the particles are distributed within a certain range, with red representing "illegal particles" and blue representing passable "legal particles".

Figure 8 shows the navigation trace comparison and its positioning error CDF curve with an known initial position and heading. In Figure 8a, the red line represents the ideal trace without noise, the green line represents the trace with noise calculated by PDR, and the blue line represents the trace diagram of the IMAPF method proposed in this paper. It can be seen that the method proposed in this paper can well correct the position of the navigation system. Figure 8b shows the CDF curve, which shows that the algorithm proposed in this paper is better than the PDR method in error correction. Figure 8c shows the error of each step.

**Figure 7.** Sampling particle distribution and motion trace with known position and heading. (**a**) Particle distribution at initial moment. (**b**) Particle distribution in motion.

**Figure 8.** Navigation trace comparison and positioning error CDF curve with known initial position and heading. (**a**) Comparison diagram of positioning trace. (**b**) CDF curve of positioning error. (**c**) Absolute position error of each step.

Table 2 shows the error comparison under the condition that the initial position and heading are known. It can be seen from the data in the table that the error of PDR algorithm increases with the increase in motion time. The method proposed in this paper can effectively restrain error divergence.


**Table 2.** Error comparison under the condition that the initial position and heading are known.

(2) The initial position and heading of pedestrian are unknown (adaptive particle number)

The distribution of sampling particles is shown in Figure 9. Using the global search method, the particles are evenly distributed in the whole map at the beginning, with red indicating "illegal particles" and blue indicating passable "legal particles". With continuous movement, the approximate position of pedestrians can be found at the 74th step, and then the positioning coordinates will be modified for pedestrians, finally providing navigation and positioning functions for pedestrians. Due to the structural features, such as rooms and corridors, the path complexity can be increased by increasing the number of room entry and exit to achieve global search as soon as possible.

**Figure 9.** Sampling particle distribution and motion trace with unknown initial position and heading. (**a**) Particle distribution at initial moment; (**b**) particle distribution and motion trace of the 44th step in the motion process; (**c**) particle distribution and motion trace of the 74th step in the motion process; and (**d**) particle distribution and motion trace of the 162th step in the motion process.

Figure 10 shows the navigation trace comparison and its positioning error CDF curve under the condition of unknown initial position and heading, while the PDR algorithm is not applicable to this condition. In Figure 10a, the red line represents the real motion trace without noise, and the blue line represents the trace diagram of the IMAPF method proposed in this paper. It can be seen that the method proposed in this paper can provide accurate positioning function for pedestrians when the initial position and heading are unknown. Figure 10b shows the CDF curve, which clearly shows that the algorithm proposed in this paper can provide accurate positioning function for pedestrians under the condition of unknown initial positon and heading. Figure 10c shows the error of each step. The average error of IMAPF algorithm is 0.36 m, and the maximum error is 0.84 m.

**Figure 10.** Navigation trace comparison and positioning error CDF curve with unknown initial position and heading. (**a**) Comparison diagram of positioning trace; (**b**) CDF curve of positioning error; and (**c**) absolute position error of each step.

It can be seen that the IMAPF algorithm studied in this paper performs better than the PDR algorithm for pedestrian navigation, whether the initial position and heading are known or not.

(3) The initial position and heading of pedestrian are unknown (fixed particle number)

In order to compare the calculation efficiency and error value between the fixed particle number and the adaptive particle number, under the condition of unknown initial position and heading of pedestrians, the fixed particle number of 2000, 10,000, 50,000 and 100,000 are compared, respectively. Table 3 shows statistics of positioning errors with different particle numbers.

Figure 11 shows the pedestrian motion trajectory obtained by solving with different particle numbers and compares the navigation results of four different particle numbers. The navigation and positioning error value of the adaptive particle number method proposed in this paper is smaller than that of the fixed particle number of 100,000. However, the calculation time of the adaptive particle number method is reduced by about 20 times lower compared to the calculation time of 100,000 fixed particles.


**Table 3.** Statistics of positioning errors with different particle numbers under simulation conditions.

**Figure 11.** Pedestrian motion trace calculated with different particle numbers under simulation conditions.
