To solve the problem of the severe decrease in positioning accuracy caused by the accu-mulation of errors in the pedestrian inertial navigation system over time,a three-dimensional(3D)pedestrian inertial positioning algorithm based on the auxiliary information of inter-foot distance is proposed.Based on zero velocity update(ZUPT),the algorithm utilizes an ultrasonic ranging module installed on the feet to measure the relative distance between the pedestrian's feet in real-time,constructing a constraint model based on ultrasonic ranging for inter-foot distance.In addi-tion,the random forest algorithm is used to recognize pedestrian motion patterns.For stairway scenarios,the height is calculated based on the step height and inter-foot distance,ultimately a-chieving 3D pedestrian inertial positioning.The 3D positioning experiment is carried out on the ac-tual route.The data show that the plane closed-loop error of the proposed algorithm is 0.64%of the total distance,which is decreased by 55.56%compared with the ZUPT algorithm,and the height error is 0.06 m,which is decreased by 64.70%compared with the ZUPT combined with barometer algorithm.In general,the 3D positioning with navigation error within 0.50%of the to-tal distance can be achieved.These results demonstrate the practical engineering value of the pro-posed algorithm.