Whats the sample frequency of iPhones velocimeter? - ios

I'm developing an iOS app that needs precision velocimeter data capturing. For that i need to know what are the maximum sample frequency of iOS devices velocimeters. Couldn't find that on devices especifications or anywhere.
Please help

So the speed gets calculated from distance and time, there is not a real frequency.
The CLLocation speed attribute gets updated every time your device is moving.
It means, even when you looking for the object every millisecond, you only get the last calculated coordinate.
Update
https://developer.apple.com/reference/corelocation/cllocationmanager/1423500-distancefilter
This distance is measured relative to the previously delivered location. Use the value kCLDistanceFilterNone to be notified of all movements. The default value of this property is kCLDistanceFilterNone.
This property is used only in conjunction with the standard location services and is not used when monitoring significant location changes.
So I think this means, that the frequency is depending on the gps signal it self.
https://en.wikipedia.org/wiki/GPS_signals

Related

Use only GPS for iOS device location

I need to know if the GPS device component of my users is healthy, so i want to get the location ONLY by the GPS and NOT form wifi or surrounding antennas.
I'm forcing my users to close their wifi before this operation so i definitely know that the received signal is not from the wifi (because its possible).
I tried to work with the CLLocationManager and CLLocation's horizontalAccuracy.
some people say that when the horizontalAccuracy is lower than 160 it means we have a good GPS strength, but its not perfect at all..
I also tried to create an array of [CLLocation] after calling [locationManager startUpdatingLocation], and than i saw that when i'm in a place like a basement(with no GPS signal), my array's count was lower that a situation with signal because the updates frequency is lower.. but this is not a perfect solution either..
I just want to be sure that the GPS component is definitely working and the location that i get is from the GPS.
so, any solution please?

how ios core location distance filter work?

I am using a CLLocationManager to get the location data in my ios app, I am using locationManager.distanceFilter method to update how often I want to update my location.
Does this method record the location every time the device moves at least that much of distance? and what happens if it is set to 0? will it update the location even if the location is not changing?
Any help would be appreciated.
With the distance filter set to 0 you should get new location about every 1 second. All of them will be slightly different even if you are not moving because GPS/GLONASS accuracy is not perfect. If you set it to some bigger value next location will be reported only when the distance between locations will be greater than specified value.

CoreLocation : efficient way to keep track user's location

what's the efficient way to keep track user's location? I mean I do not care if the location has been change slightly, because it will waste the resources.
i used in my code: LocationManager.stopUpdatingLocation()
to stop every small changes in location...
is there a way to keep track the location only if it oldLocation and newLocation has big different?
Yes there are two ways you can achieve that. First way is to use
func startMonitoringSignificantLocationChanges()
startMonitoringSignificantLocationChanges starts the generation of updates based on significant location changes. Apps can expect a notification as soon as the device moves 500 meters when you are using startMonitoringSignificantLocationChanges. And if you want to use startUpdatingLocation then set distanceFilter to distance of your choice and it will report location only if location change is more than distance specified in filter. distanceFilter represents the minimum distance (measured in meters) a device must move horizontally before an update event is generated.

why did didupdatelocation be called when device is not moved

i use CLLocation for a app that record people's trace in map view when they are running or walking ,but i found when my device is still (not moved) ,the
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations is also get called frequently ?
currently ,my locationmanager's desiredAccuracy is 10 meters and distanceFilter is 10.
how to deal with this situation? I have tried use big distancefilter value(like 150) ,but I found if i do this, then i can't record exactly when people is running or walking
GPS is not exact. You can move around a few feet and get the same location. Or you can sit still and get told you have moved a few feet.
You might be able to combine measurements from the accelerometer to determine if you have really moved but this would only work if the device was sitting on a table not moving.
Have you called stopUpdatingLocation after the initial startUpdatingLocation? It will keep updating location if you do not call it.
How does system know whether or not you have actually moved? It MUST fetch your location to find out. The more accurate your desired accuracy is, the more vigorously and frequently it would look. By vigorous I mean if it's suppose to use cell-tower information then it would look into more cell-towers to better triangulate. Or simply put it, the interval between its fetches would be smaller. Concluding: OS would fetch data even if you don't move.
Additionally to triangulate your position the OS (depending on your desiredAccuracy and previous movements) would use a mix of GPS, wifi, Cell-tower. And because someone may all of sudden turn off/on their wifi, or satellite that you were using to get your location has moved a bit or the satellites have changed, or a cell-tower signal may become more or less accurate due to its bandwidth limitations then your calculated location may change which triggers a callback if it's more than your distanceFilter. ( I don't believe you get callbacks for less than your distanceFilter, but I may be wrong) This likely means your distanceFilter is set to very small number which depending on your business requirements may or may not be a good choice. Concluding: your location is never ever 100% accurate
The result of periodical fetching, possibility of error and small distanceFilters lead to possible incorrect locationChanges.

iOS location significant change accuracy and distance

I want to know the accuracy and the distance filter of the low-power significant change location service (i.e if I use startMonitoringSignificantLocationChanges how much it's accurate, and what is the distance of the significant change)?
I need some experimental (non documentary) info from real time apps
I had a chance to speak with the Apple Location Engineers at WWDC this past year and this is how it was explained to me.
The significant location change is the least accurate of all the location monitoring types. It only gets its updates when there is a cell tower transition or change. This can mean a varying level of accuracy and updates based on where the user is. City area, more updates with more towers. Out of town, interstate, fewer towers and changes.
This is also the hardest location type to test for since you can't use the simulator either. I'm not sure if they have fixed it to work with the GPX files for 6.0, but the significant location change api did not work at all in the simulator prior to iOS 6.
I have tried to avoid using the signification location change for many of these reasons. Sometimes it can't be helped. I ended up using the region monitoring API's as they are far more accurate and just as good on battery life. Hope this helps.
From the Apple documentation:
This interface delivers new events only when it detects changes to the
device’s associated cell towers, resulting in less frequent updates
and significantly lower power usage.
There doesn't appear to be much more specific information available about the exact accuracy, so I would assume you have accuracy roughly equivalent to the approximate distance between cell towers in the area that the iOS device is currently located in (which is shorter in more highly populated areas).
I had to build an app back then that uses cell tower significant location changes.
Short answer: very inaccurate.
I was clearly crossing the boundaries of my region.
From what we observe in our app, it can be a few hundred metres to a few kilometres off. Our testing was in the city area, cell towers in suburbs parellel to the train tracks and other suburban cell towers.
Pretty rough.
It was consistent most of the time. I notice that every time I was about to go into the tunnel to the underground train station, it would fire off my 3 region crossing notifications that I have setup for the CBD city area.
I'm using Xcode 4.6.2, and you can indeed simulate significant location change on this simulator.
In the iOS Simulator, the menu entries you need are Debug->Location->Freeway Drive.
Caveats (I welcome being told I'm wrong):
1. After a long while, there seem to be no more significant location change events.
2. You can only drive a pre-defined route in the general Cupertino/SF area. If all you care about is significant location change, that's fine.
Be careful, although you can access the speed property of the location got from the significant location update, it's useless! the simulator actually gives the speed but in real devices the speed is not available because location got from cell towers will not include the actual speed(unlike GPS). more the that as said before the location itself is very inaccurate it can be a few km off.
Be aware of that.
The only way to get the speed is have two cllocation and compute the speed manually

Resources