Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How accurate is the distance? #2

Closed
thyselius opened this issue May 29, 2017 · 4 comments
Closed

How accurate is the distance? #2

thyselius opened this issue May 29, 2017 · 4 comments

Comments

@thyselius
Copy link

Hi, thanks for a great app!

I'm seeking the answer to this question https://stackoverflow.com/questions/43980198/getting-most-accurate-current-pace-when-running-with-iphone-gps basically Getting most accurate “current pace” when running with iPhone GPS.

Have you tried running in a measured race and seen how your gps distance compares to the real distance? Would really appreciate your response.

Thanks again

@vermont42
Copy link
Owner

Thanks for the feedback. What feature(s) in particular do you like? May I ask how you found RaceRunner? I'm always looking for ways to increase the effectiveness of my marketing. :P

I have not compared claimed distance versus RaceRunner-measured distance. Obtaining an accurate distance to measure RaceRunner against might be difficult because there is often no reason to believe that the claimed distance for a particular race is accurate. The presence of large prizes, professional runners, and the possibility of setting recognized records in a race would increase my confidence in the accuracy of a claimed distance. That said, RaceRunner does use the most accurate, battery-intensive setting for GPS.

@thyselius
Copy link
Author

thyselius commented May 30, 2017

I found RaceRunner while searching Github for good examples of code for running with GPS. I'm trying to make a running app withe very accurate current pace and distance.

Since it's so easy to make exact measurements with a wheel, in combination with records etc which you mention I assume that races are accurate down to 1m, but you might be right.

I'm using the following settings and are testing the code when running using both Nike+ simultaneously on my phone, and a Garmin Fenix 3 watch with the Styrd footpod (which is said to be super accurate).

	_locationManager.desiredAccuracy = kCLLocationAccuracyBest
	_locationManager.activityType = .fitness
	_locationManager.distanceFilter = kCLDistanceFilterNone

Then in locationmanager:

	if location.horizontalAccuracy < 40 {
		distance += location.distance(from: savedLocations.last!)
	}

Using this code i get 20% more distance compared to Nike+ and Garmin.
My code 12.3 km
Nike + 10.01 km (running simultaneously on the phone, getting the same GPS updates)
Garmin 9.75 km

These ratios was kept during the whole run, so when Nike+ logged 5km, my code logged 6km.

My code differs from yours only in that you use distanceFilter of 10 while I use kCLDistanceFilterNone.

Since the GPS location often has a low (actual) horizontalAccuracy, some extra operations should be needed to get really accurate distance. I wanted to see what would happen if I simply adjusted the ratio to align with Nike+, ie 10/12,3 = 0.81 ratio.

So I changed the code to

	distance += location.distance(from: savedLocations.last!) * 0.81

and ran the same 10 km yesterday. This time I got the results:
My code 9.04 km (or 11.16 if I wouldn't have used * 0.81)
Nike+ 10.00 km
Garmin 9.66 km

So, this time the ratio was actually to 0.9 than 0.81. So there must be something else that Nike+ does.

The most depressing fact is that my code logged 12.3 km the first time and 11.16 km the second time.

Ideas:

  • increase (lower the value of) the required accuracy.

    if location.horizontalAccuracy < 40 {
    However I needed 40 for it to work well in the city with my iPhone 7+
    Clearly I'd rather get no update than one that is 40m wrong

  • set distanceFilter to for example 10 (as you have)

    _locationManager.distanceFilter = 10.0

Both these ideas affects the number of location updates that will be generated. This in turn will make the runner seem to go more "in a straight line", less jitter. This will make the distance shorter which is what we want. But is it a well balanced accuracy for the average running trail? Small turns will not get picked up. Will it be more accurate that the * 0.81 approach?

I will probably try today with

_locationManager.distanceFilter = 10.0
if location.horizontalAccuracy <= 20 {

and see where that takes me.

Sorry for the long post, but it helped me think while I wrote it :)

@thyselius
Copy link
Author

Also found this if you're interested
Race distances rarely lie, as they’re set up with the latest technology called the calibrated bike method. Jim Gerweck, a USATF course certifier based on Connecticut, said the method has been in place since the early 1970s and involves riding a bicycle outfitted with a counter that notes each time the wheel makes a revolution. At the end of the ride, some math calculations are made and the course distance is revealed. The route is ridden four times, and then, once the distance is figured out, two more times. The shorter route of those final two rides is the final distance.
Read more at http://running.competitor.com/2014/06/training/debating-the-accuracy-of-gps-vs-race-distances_105664#4ulEMIuKwUGQLEWB.99

@vermont42
Copy link
Owner

@thyselius I'm interested in seeing your running app. Sound like iPhone GPS just isn't as accurate as the bike method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants