Design and implementation of an inertial navigation system for pedestrians based on a low-cost MEMS IMU