I am creating an navigation based iPhone app. I want to calculate the distance and speed of the user moving. Now I am using CLLocationManager
for this. But it not that much accurate. I am calculating the distance with the api distanceFromLocation:
. And then it is divided by time for calculating the speed. The CLLocation
's property speed
is not accurate. Is it possible to find distance and speed using accelerometer.
Please let me know which method have to be used in my case.
Asked
Active
Viewed 639 times
1

Tinku George
- 195
- 2
- 11
-
1possible duplicate of [Need to find Distance using Gyro+Accelerometer](http://stackoverflow.com/questions/6647314/need-to-find-distance-using-gyroaccelerometer) – Ali Feb 08 '13 at 11:05
-
See also [Android accelerometer accuracy (Inertial navigation)](http://stackoverflow.com/q/7829097/341970). The iPhone is not any different from Android in this respect: **You cannot do it due to hardware limitation.** – Ali Feb 08 '13 at 11:07
1 Answers
1
Fortunatley the situation is much better then you stated, I have done all your tasks done in my app:
speeds are acurate as long as they are over 5-7 km/h, at least 1km/h, on higher speeds, 0.1 km/h
distance is acurate if you filter out when the vehicle is standing still. accuracy = 1% (100 m in 12km) use maximum location accuracy (BestForMavigation, or Best) for best results.
Gyro amd acceleromer are relative mesurements, they are not suitable for higher distances, but can support the GPS in low speed or still stand situations.
For vehicle movement, this all is acurate, and not to komplex.
For walking, it gets more difficult, your must write filter to filter out some locations, before using them to measure the distance.

AlexWien
- 28,470
- 6
- 53
- 83
-
1Thank you for your response. Can you please specify which method is to be used for calculating speed - CLLocation's speed property OR calculate speed by dividing distance with time. Also help how to filter the device is standing still. – Tinku George Feb 12 '13 at 05:48