Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accuracy of Core Location

I'm currently working on a location tracking app and I have difficulties with inaccurate location updates from my CLLocationManager. This causes my app to track distance which is in fact only caused by inaccurate GPS readings.

Inaccurate location readings

I can even leave my iPhone on the table with my app turned on and in few minutes my app tracks hundreds of meters worth of distance just because of this flaw.

Here's my initialization code:

- (void)initializeTracking {
    self.locationManager = [[CLLocationManager alloc] init];
    self.locationManager.delegate = self;
    self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    self.locationManager.distanceFilter = 5;

    [self.locationManager startUpdatingLocation];
}

Thanks in advance! :-)

like image 977
Petr Mánek Avatar asked Jul 21 '14 14:07

Petr Mánek


People also ask

How accurate is IOS location?

GPS satellites use an atomic clock to send timestamped signals that are insanely accurate. If your phone is in position to receive 4+ strong satellite signals, most phones GPS should be accurate within 20 feet. A weak signal can quickly reduce that to 100+ feet or even 1,000+ feet!

What is the core location?

Core Location provides services that determine a device's geographic location, altitude, and orientation, or its position relative to a nearby iBeacon device. The framework gathers data using all available components on the device, including the Wi-Fi, GPS, Bluetooth, magnetometer, barometer, and cellular hardware.

What is the desired accuracy?

The accuracy of the location data that your app wants to receive.


2 Answers

One of the ways I solved this in a similar application is to discard location updates where the distance change is somewhat less than the horizontal accuracy reported in that location update.

Given a previousLocation, then for a newLocation, compute distance from the previousLocation. If that distance >= (horizontalAccuracy * 0.5) then we used that location and that location becomes our new previousLocation. If the distance is less then we discard that location update, don't change previousLocation and wait for the next location update.

That worked well for our purposes, you might try something like that. If you still find too many updates that are noise, increase the 0.5 factor, maybe try 0.66.

You may also want to guard against cases when you are just starting to get a fix, where you get a series of location updates that appear to move but really what is happening is that the accuracy is improving significantly.

I would avoid starting any location tracking or distance measuring with a horizontal accuracy > 70 meters. Those are poor quality positions for GNSS, although that may be all you get when in an urban canyon, under heavy tree canopy, or other poor signal conditions.

like image 99
progrmr Avatar answered Sep 24 '22 00:09

progrmr


This is always a problem with satellite locations. It is an estimate and estimates can vary. Each new report is a new estimate. What you need is a position clamp that ignores values when there is no movement.

You might try to use sensors to know if the device is actually moving. Look at accelerometer data, if it isn't changing then the device isn't moving even though GPS says it is. Of course, there is noise on the accelerometer data so you have to filter that out also.

This is a tricky problem to solve.

like image 28
user2246302 Avatar answered Sep 26 '22 00:09

user2246302