
Indoor Positioning System.
An indoor positioning system that tracks a walker with nothing but a phone's motion sensors. Steps become distance, a Kalman filter fuses the magnetometer and gyroscope into a heading, and together they trace the walked path more closely than the phone's GPS.
Reports
Highlights

Distance.
Building on the pedometer, three distance estimators were compared on walks of 8 to 37 m. A fixed step length averaged 2.5% error. An adaptive model, which scales each stride by its duration and acceleration, averaged 3.0% but was chosen for the final system because its weights could still be tuned. Integrating acceleration twice drifted to errors of more than 400%.

Heading.
The magnetometer gives an absolute heading but is corrupted by hard- and soft-iron effects, so it was calibrated with magcal and unwrapped. The gyroscope is smooth but has to be integrated, so its heading slowly drifts. Both were tested against the phone's own orientation sensor through a sequence of 90° and 180° turns.

Fusion.
A Kalman filter fuses the two headings, with its noise weights set from each sensor's variance while stationary (R = 0.1697, Q = 6.819). Combined with the step-based distance, it traced a rectangular walk far more closely than the phone's 1 Hz GPS. Because the gyroscope was so noisy, the fused path follows the magnetometer closely; a better gyroscope would let the filter do more.
