iPhone Development - Assisted GPS - iphone

What's the deal with iPhone's GPS? I never get a good reading when i'm in my office building, or in my room. What really ticks it! and what doesn't? Please help me understand the assisted GPS science.

If I'm not mistaken, the gps tries to pinpoint your position using three methods:
1. Satellite
2. Mobile network
3. Wi-fi networks
So if you don't have a good reading, then probably one or more of these methods cannot be used properly in your area. For instance, satellite will not always work that well in buildings with thick walls and ceilings.

Assisted GPS means that it may have it's location from different sources than GPS satellites, for instance known wifi hotspots, or GSM masts. However these sources are less accurate the true GPS.
Claus

For the actual GPS in your iphone to get a good position, it has to be in direct sight of the GPS satellites. It cannot do that inside a building. So if you are inside you are not going to get the best position from the iphone. It can give you a position using other methods such as the cell phone network and public wi-fi networks, but these positions aren't as accurate as the real GPS position.
Here is an article that explains the GPS system:
http://en.wikipedia.org/wiki/Gps

Depends on whose definition of Assisted GPS.
True 'assisted GPS' means the GPS receiver uses a known initial position, from the cell tower location, to bootstrap the GPS position calculations. If you know where you are it's much quicker for the position solution to lock to the signal - that's why GPS take so long to find first fix compared to updating.
Some APIs use assisted GPS as shorthand for alternate location services where if GPS is not available, is disabled, or would use too much battery power it will supply a lower grade position based on cell tower triangulation or other methods.

There are many answers I found in WWDC 2010 – Session 115 - Using Core Location in iOS 4.
Very advised.

Related

How accurate can indoor WiFi positioning be when it comes to tracking movement?

Imagine I'm standing in a large room that has a router in the corner. Now I'm holding my iPhone and I start moving around in the room.
Is there a way I can track my movement inside that room using as static reference that router?
Imagine I take one or two steps to the left. Will such a small change in location be captured accurately under such conditions?
Do I need more than one hotspots in order to find my precise location inside the room?
Can the tracking be precise since we're talking about movement inside a room and not out on the streets?
If you're interested in tracking physical movement of the phone using a single wireless router as a point of reference, no, it's not going to work. It's defiantly not going to give you a foot or two of resolution, either.
You'd be using the wireless signal strength as a position indicator. However, you'd need two signals (two static points) minimum to give any sort of triangulation. Furthermore, signal-strength triangulation is really, really imprecise - the Wikipedia article gives a network-based tracking a resolution of around 50m. Handset based tracking uses both GPS and signal strength to give a better resolution, but it's still not within a foot or two.
To get good position tracking, a signal is timed between the source and receiver, then triangulated. This gives quite good resolution - Wikipedia articles on "Trilateration", "Time-Of-Flight", and "Multilateration" would give a decent overview of that kind of system.
Long story short? No, you can't get a physical position using a single static router as a point of reference with any degree of accuracy, or precision.
I think you're misunderstanding how Wi-Fi based location tracking works. I'm not sure about the exact process but if I'm right, it involves your IP address assigned by the hotspot you're connected to. And the accuracy of Wi-Fi based location is not as accurate as the degree (a couple of feet to the left or right) you're referring to.
No matter where you are in that room, or even in the same building connected to that same hotspot, your location is going to be reported as the same place.
So to answer your question, NO, the tracking cannot be precise. If you're using you're using the GPS component of your device, that's a totally different story.

How to implement indoor navigation on the iPhone

I would like to locate the iPhone in a building to build an application with similar features as the iPhone app of the American Museum of Natural History. There is no good GPS reception as there are also rooms in the cellar I would like to cover.
What can save me is that there is good wifi coverage in the whole area, so my idea was to triangulate the position based on the wifi base stations in range, whose positions are known. However I found no public API to find out which base stations are in range.
Questions
Do you have an idea how the app mentioned above manages to get the correct location indoors?
Could one add the wifi base stations manually to Apple's database and use the usual CoreLocation?
Do you have other ideas how to implement it?
Any help is very much appreciated!
Boundary conditions
The indoor navigation is only used during an event to guide guests new to the building, so no complex infrastructure should be installed.
There are approximately 14-18 rooms to be covered. They are in different parts of the building, so wiring everything up would be very costly.
The preferred solution would not require a server backend of any kind and would work with a list of wifi access points and their corresponding locations.
I wouldn't know about 1 and 2. But if you would implement such a thing, turn it around to save a lot of trouble: create your own free-of-charge wifi network, and let the network determine the location, either based on triangulation, or just based on the currently associated access point. Make their signal weak so you have one audible access point per room. Let the app ask a server in what room he appears to be. This will also work for any other mobile/pda/laptop.
As for other ideas: You could use bluetooth to do somewhat the same as you're planning for wifi. You can't do everything with bluetooth, but listing devices seems to be one possibility. So just put a bluetooth device in every room. Bluetooth range is limited by definition.
Another one would be to use the microphone in conjunction with a high pitched sound which identifies the room, but that would cause trouble with dogs (for blind people), attract bats, and repel mice at the same time. Better focus on an RF based solution ;-)
You can also check out Navizon's indoor positioning system:
http://www.navizon.com/product-navizon-indoor-triangulation-system
Their system is able to locate iPhones by using the WiFi signals transmitted by the device and doesn't require an app to run on the phone to locate it. It can locate any other WiFi enabled device for that matter.
Check out wirelesswerx.com They seem to be doing indoor location using Bluetooth and it looks like they can do permanent install or temporary for events.

Is iPhone Proximity detection possible with Bluetooth?

Would it be possible to fill a building with 20 - 30 bluetooth devices that act as proximity detectors and write an app that can calculate location in the building based on distance from the current detected sensors.
I've looked at the GameKit API, but I don't see anything about calculating distance from devices.
Can someone point me in the direction of an Apple API, or a 3rd party API that can be used for this kind of application.
We don't get the low level BlueTooth or WiFi control that would be required to do this. So unless you jailbreak you can't.
Low level Bluetooth can provide RSSI and Trasmit power level at the maximum for any kind of proximity indications.
As I understand it is extremely difficult to calculate the distance from these reliably.
Location services is surprisingly good at estimating location even in a residential area with only secured wireless APs detectable. But how you would add your APs into that DB, I don't know.

Is there a technology that can pinpoint an iPhone's *exact* location (to the feet/couple feet, indoors)?

Is there is a way to determine an iPhone's exact location (indoors, and to a distance of just a couple of feet) via use of radio/antenna's or some other infrastructure located around premises (i.e a hospital, shopping mall, school). Will appreciate any ideas/direction (technologies, research) as for how to overcome this limitation.
If you mean for an area you have control over (setting up a location network for a specific school/hospital) as opposed to generic location, you'd be able to triangulate your position based on wifi signal power for APs with known locations.
If you wanted it to be a generic solution, and you know there would be multiple APs in/around the buildings you wanted, you could triangulate all wifi signals while you have GPS outside the building, and then reference those locations when you lose gps accuracy. The first part is something that many wardriving applications already do.
Here's an article describing a commercial technology for this purpose in high-level detail: link
And here's a link to a SO page where people have started discussing possible methodologies: link
Use the GPS and hope that you got good coverage.
Other than this, you can deploy several wifi hotspots that can measure the signal strength for each packet and do a triangulation to calculate the iPhone position with regards to three or more of these hotspots based on the signal strength each of them measured.
A quick search for "signal triangulation" on the internet reveals a Wi-Fi Based Real-Time Location Tracking technology from Cisco. I have not used it, so I can't vouch for it; and I suspect it's rather expensive. There might be other solutions as well.
The alternative would be to buy several wifi routers or access points and flash them with your own version of the firmware. You can probably use OpenWRT or DD-WRT as a base for this.

How accurate is the triangulated GPS of the non-3G iPhone?

Does anyone have any experience with the triangulated GPS used by the non-3G iPhone? How does it compare with 3G positioning? Does the iPhone 3G use triangulation in the event that there is no GPS signal available? Is there anyway to determine the accuracy of the non 3G coordinates? Thanks.
I have done a lot of mobile software with a bunch of different devices including 3G iphones and 3G blackberry's and here is what I have found.
The blackberry and iPhone GPS is really good when you have clear line of sight and at least 9 satellites present. In some dense residential or urban areas you might only get 5-6 satellites which can take a while to converge.
If you do not have a signal, GSM phones like the iPhone will try and find your position using cell tower signal strength but it is NOT as accurate as GPS... not by a long shot.
I have heard, though this has not been confirmed that the iPhone also uses some server side machine learning when it can't find a GPS lock meaning that it takes the average all of the cell towers, plus the average of all the users who have used GPS in your area to try and find your best position. This is sometimes called AGPS or assisted GPS where the GPS information and cell tower strength are used together.
Also, the only thing I can think of for finding the accuracy of the non 3G coordinates would be to programmaticly switch providers in your code, or simply go into preferences and turn off 3G and write an application that does some tests.
The Pragmatic Programmers have a great iPhone SDK book that just added a chapter on using the Location API, so that might be a great place to start.
Hope this helps.
The CLLocation class has the properties 'horizontalAccuracy' (for latitude/longitude) and 'verticalAccuracy' (for elevation).
In addition to cell towers and GPS, locations may also determined by Skyhook Wireless, which has a database of Wi-Fi base station MAC addresses and locations.
When using only GSM towers, it's +/- 500m (it varies greatly, sometimes it's more precise).
If it finds known Wi-Fi network, then it's down to +/- 50m.