iOS GPS Testing and Location Services
Article Summary
Trevor Phillips from Freeletics built a comprehensive GPS testing framework that improved location accuracy from 7% error down to 1.68%. Here's how they systematically validated every improvement.
The Freeletics engineering team needed precise distance tracking for running workouts, so they collected real GPS data from employees, analyzed the noise patterns in iOS CLLocation data, and built a Kalman filter to improve accuracy. They created 54 test scenarios simulating different conditions to validate their approach.
Key Takeaways
- Raw iPhone GPS data showed errors ranging from 0.28% to 7% of actual distance
- Built 54 test scenarios combining path types, distances, speeds, and signal strengths
- Kalman filter achieved 0.7% to 1.68% accuracy across all simulated conditions
- Mean distance between GPS points was 0.952 meters with 1 second intervals
- Accuracy degrades significantly in first 10 to 20 measurements then stabilizes
By systematically collecting real data, simulating noise patterns, and applying Kalman filtering, the team reduced GPS tracking errors to under 1.7% in worst case scenarios.
About This Article
iPhone GPS data was accurate to about 7.2 meters on average, with a standard deviation of 1.7 meters horizontally. Vertical accuracy averaged 3.6 meters. These gaps caused real problems for Freeletics' running workout tracking, leading to significant distance measurement errors.
Trevor Phillips' team built a Kalman filter that works with CLLocation objects. The filter predicts position changes based on how much time has passed and the timeUncertainty parameter. It then refines those predictions using the measurement accuracy values from incoming data.
The Kalman filter cut distance calculation errors down to 0.7% in ideal conditions and 1.68% in the worst case across 54 test runs. Raw GPS data on the same paths produced errors up to 7%, so the filter consistently performed better.