Abstract:The heading angle error is one of the main errors in pedestrian navigation. A common solution is to use the MIMU in combination with magnetometers, but the magnetometer has a large error, so it needs to be calibrated before use. To solve this problem, this paper proposes a pedestrian navigation algorithm based on magnetometer online calibration. Before walking, the ellipsoid fitting through spatial rotation is used to complete the preliminary calibration, and then the UKF is used to estimate and eliminate the time-varying error in real time during the journey. Correct the pedestrian heading with the output of the calibrated magnetometer. Experiments show that the pedestrian navigation algorithm based on online magnetometer calibration has reduced the closed-loop error by 6.17% and 2.8%, respectively, compared with the pedestrian navigation algorithm where the magnetometer is not calibrated and the magnetometer is only initially calibrated. The results show that the algorithm proposed in this paper effectively calibrates the magnetometer, suppresses the divergence of the heading angle in pedestrian navigation, and improves the navigation accuracy.