I am new to android. I was wondering if there was way to locate Cell towers (ie. get gps coordinates) ? I have written the code which gives me LAC, CID and RSSI of neighboring Cell towers.
Yes, it would be possible, simply log the current location with the RSSI of the basestation and when enough data is gathered try and calculate the position of the Cell tower. I would also suggest taking a look at this answer which asks the same question from a non-programming perspective.
A cheap way of doing the estimation would be taking last 3 measuring points (you probably want to make sure that they are x meters away from each other for better accuracy) and then using triangulation to estimate the position of the cell power. When enough measurements have been done, but calculating the average you would probably get a fair estimate of the location of the base station.
Related
There are any documentation for this? I've checked many formulas and algorithms but didn't find an explicit definition how they get the speed provided in Geolocation object.
The GPS chipset provides the current velocity to the system along with the current location.
The chipset may compute the velocity by comparing location over time and correcting for the curvature of the Earth at the current location, or from the Doppler shift of the received satellite signals.
Whichever method is used, the operating system doesn’t need to do any processing to get the speed. The velocity data is provided along with location and altitude data directly from the GPS chip (actually chips in many newer devices support both GPS and GLONASS, but which system is used is not visible to the user).
Physics.org has a simple explanation of how GPS works
Wherever you are on the planet, at least four GPS satellites are ‘visible’ at any time. Each one transmits information about its position and the current time at regular intervals. These signals, travelling at the speed of light, are intercepted by your GPS receiver, which calculates how far away each satellite is based on how long it took for the messages to arrive.
Once it has information on how far away at least three satellites are, your GPS receiver can pinpoint your location using a process called trilateration.
But you can search for more detailed explanations of the mathematics and physics involved.
It basically scans your location (i.e. your latitude and longitude) and compares with the last check. Using euclidian distance, it can get the distance in the period of time. With the time (for example, if it scans your location every 2 seconds), it can easily estimate your speed by doing Speed = Distance/2.
I'm working on a robot which need to know its exact position (with an error of +/- 5cm) in relation to a given point of coordinates (0, 0). So my question is :
Is it possible to get this kind of precision using differential GPS ?
The idea would be to place a GPS at the position (0, 0) and a GPS on the robot to compute the difference of coordinates of the 2 GPS and get the relative position of the robot.
Thanks for your answers
It is possible with DGPS, but bot in an mobile phone.
Precision Farming use GPS with cm accuracy.
With a consumer GPS if you would be able to read out the Satellite RAW data, you could do a GPS Post processing, that way you could reach <1m accuracy.
for cm accuracy you need 2 Phase Gps receiver (conusmer ois 1 -phase),
and additional RTK, Then you have cm accuracy.
Read more by searching for topic RTK, Rinex, GPS Post processing.
(But it is not possible for current mobile phones, using GPS)
And robotoers often want to work indoors, where GPS doesn not work, too.
No, GPS is way too inaccurate for that. Best guess would be that you can use the accelerometer to calculate a relative distance on movement.
Might be placing 3 wifi routers in the field and compute by using their relatively signal strength would give a better appoximation on the robot's current location?
How would I verify/ track device location within a 5' accuracy? I've heard of people using cell towers/ gps combinations.
As far as I know, the only way to get a 5 feet accuracy figure is to use GPS, then it still isn't always that accurate depending on how good a fix of the satellites (clear view to the sky) you have.
Cell tower / Wifi triangulation methods only serve to speed up positioning and will seldom (if ever) be more accurate than satellite positioning methods.
GPS is the way to go. Cell towers won't cut it. In Android (and I believe iOS) the system will provide you with an accuracy reading in addition to the actual location. You could use this value to determine whether the value you've received should be uploaded to your server. Keep in mind using the GPS is very battery intensive and there's no guarantee of how good the accuracy will be. Depending on conditions you may not be able to achieve 5' precision.
As #CommonsWare points out, 5' is really unrealistic anyway although you can get close.
As CommonsWare says you will not get much better that 10 metters accuracy in a consummer-grade device. Even in open sky, the atmosphere characteristcs change minute by minute and thats enough to change the GPS readings.
However, it's teoreticaly possible to increase accuracy if you could get all of the following:
1-There are some stationary GPS receiver stations with fixed known locations which measure the current GPS signals deviation. You would need to have one of those close to you and have access to the data in real time.
2-You would need to have low level access to your phone GPS receiver to read the unprocessed data received from sattelites. This would be different from device to device, and as far as I know, no supplier is providing this access.
3-Finnaly, you would need to do all the calculations required to determine your location applying the deviations got from point 1 above.
good luck.
The only way you can get this type of accuracy is with WAAS. As far as I know, there are no Android handsets that can receive WAAS corrections. If this is for a specific controlled situation, you could use a bluetooth gps receiver with WAAS, and only in WAAS supported locations. However, if this was for a wider deployment, then I think you are out of luck.
I want to write a LocationListener that takes the most accurate and precise recent location as its location. I'm intending to use this code in my LocationListener:
#Override
public void onLocationChanged(Location location) {
if(location.distanceTo(mLocation)>location.getAccuracy()){
mLocation = location;
}
}
What I intend this to do is update the location if the user's old location is outside the circle of "possible locations" that the new location indicates. So, for example, if our last measurement was a GPS signal and the new one is a cell tower, and the old location was in range of the cell tower, we don't update; on the other hand, if the cell tower is sufficiently distant, we know the user has moved and record that.
However, the distanceTo(Location) function states it returns the approximate distance in metres between locations. Does it already take the accuracy into account? Will it give me a precise enough figure to let me use in this way?
Short answer is no, Location.distanceTo(Location) does not take Location.getAccuracy() value into account when measuring distance.
Here's the actual code from the Android platform that is used to calculate distance for Location.distanceTo(Location):
https://github.com/android/platform_frameworks_base/blob/master/location/java/android/location/Location.java#L272
It uses Vincenty's Inverse Formula (http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf - Section 4) based on the given latitude and longitude (accuracy not considered).
As to whether your method of updating the "true" user location will be "precise enough", it really depends on GPS sensitivity, accuracy, and precision, which can vary significantly from device to device.
The accuracy estimate value from Location.getAccuracy() can also vary widely depending on the OEM, and typically devices I've seen overestimate accuracy (i.e., the device gives an accuracy value greater than the true accuracy) more than underestimate accuracy.
You might want to check out an app I created "GPS Benchmark" (http://www.gpsbenchmark.com/) which helps quickly benchmark location provider accuracy (GPS and Network) on Android devices, as well as "estimated accuracy" accuracy. I also co-authored a paper on this topic (http://journals.cambridge.org/repo_A82eaJIy) based on GPS benchmarking results from some Java ME devices, and most of the material is also relevant to Android.
How do i get the actual (accurate ~1m) height of my location?
Ive tried registering a LocationListener, receiving the Altitude, but that does not work fine or even accurate. Im around 400m above NN and it displays 7m.
As result: GPS is not a good height-provider as i assume.
Do you have any ideas how to obtain this height?
Presumably you requested a LocationManager, not a LocationListener, and getAltitude() to obtain your height.
GPS/GNSS is not as good at altitude as it is at longitude and latitude, but for a reasonable fix you should be within 10m of the correct altitude. Note that altitude is adjusted for the geoid ( http://en.wikipedia.org/wiki/Geoid ) and the datum ( http://en.wikipedia.org/wiki/Datum_(geodesy) ) in use, which can alter your reported height compared to what you are expecting.
But you may be getting your location provided by a location provider that isn't actually GPS - it could be cell tower based, or due to dead reckoning or WiFi locationing. Or perhaps the android phone you are using just has a bad GPS integreation design that is messing with your accuracy.
I would recommend downloading a test application such as GPS Test ( see https://market.android.com/details?id=com.chartcross.gpstest&hl=en ) which will show you if you have a fix, and what altitude is actually being reported by your GPS. The third box on the bottom of the GPS Test app shows altitude, heading and velocity values for each fix.
If you have a GPS, barometer, and data connection, you can send the GPS location to one of several weather APIs to get the local barometer setting (p0). If p1 is the value from the pressure sensor then SensorManager.getAltitude(p0, p1) will give you a very accurate altitude.
I don't think the altitude will have 1 meter accuracy, but it is about as accurate as you can hope for.
This SO question/answer discuses weather APIs:
Sealevel Pressure and Temperature Calculation