Skip to first unread message
Assigned to steve....@gmail.com by taifu...@gmail.com

Chris Bird

unread,
Jun 4, 2014, 2:23:42 PM6/4/14
to mitappinv...@googlegroups.com
Hi,

I'd like to try to improve the accuracy of GPS waypoints taken by my Phone.  I searched the forum and found some info on the gps functionality in app inventor but I didn't find any specific strategies to improve the accuracy of a gps waypoint.

I've run some tests of the accuracy of the gps in my phone vs a garmin gps map 78 using an app inventor program that i wrote.  Not surprisingly, my phone performs worse than the garmin in terms of accuracy.  Additionally, the garmin returns much more precise waypoints (13 decimal places) relative to the phone (5 decimal places).

I'm thinking about using app inventor to logg several gps points and then calculate an average lat and long.  That would hopefully increase the accuracy of the way point, and would allow me to log waypoints with greater precision.  In my specific application for the app, I'll be spending at least a minute at a location.  Does anybody have any experience with this?  How long would I have to remain in one location (given clear line of sight to satellites) to get a good sample of the variation in the gps signal?

Any thoughts?

Thanks!

M. Hossein Amerkashi

unread,
Jun 4, 2014, 2:28:09 PM6/4/14
to mitappinv...@googlegroups.com
Did you set the LocationSensor.ProviderName to "gps" ? That will give you much better accuracy.

-Hossein.

Chris Bird

unread,
Jun 4, 2014, 2:36:01 PM6/4/14
to mitappinv...@googlegroups.com
along similar lines, when my phone is connected to an external gps device, can I grab lat and long values from that external device with app inventor?

Chris Bird

unread,
Jun 4, 2014, 2:55:45 PM6/4/14
to mitappinv...@googlegroups.com
Yes, I set the provider name to gps.  Additionally, I collected the data in the middle of the Pacific ocean around uninhabitated atolls- no cell towers.
Message has been deleted

Chris Bird

unread,
Jun 4, 2014, 3:52:45 PM6/4/14
to mitappinv...@googlegroups.com
for example, this external gps connects to android devices via bluetooth http://gps.dualav.com/explore-by-product/xgps160/

Then, you can use an app like bluetooth gps which makes the external gps data available to apps on the android.

How do I make the GPS Receiver work with my Android tablet?

Android tablet owners will need a “helper app” which connects the GPS data from the XGPS160 to all apps on the tablet. We recommend using one of these two apps: Bluetooth GPS or Bluetooth GPS Provider. Both are free downloads from the Google Play store.

Instructions for making the XGPS160 work with Android devices:

• If you have Android version 2.x or 3.x installed on your tablet:
• Configure the tablet to use mock locations: go to Settings->Applications->Development and enable “Allow mock locations“.
• Next, pair the XGPS160 with your tablet:
• On the tablet go to Settings->Wireless & networks->Bluetooth Settings. Look for XGPS160-xxxxxx in the list of devices.
• If it does not appear, tap the “Find nearby devices” button and wait a few moments.
• Once the XGPS160 appears in the list of devices, tap the device name in the list. The tablet with think for a few moments and then say “Paired but not connected.”

• If you have Android version 4.x or later on your tablet:
• Configure the tablet to use mock locations: go to Settings->Developer options and enable “Allow mock locations“.
• Next, pair the XGPS160 with your tablet:
• On the tablet go to Settings->Bluetooth. Look for the XGPS160-xxxxxx in the list of devices.
• If it does not appear, tap the “SEARCH FOR DEVICES” button in the upper right corner of the screen and wait a few moments.
• Once the XGPS160 appears in the list of devices, tap the device name in the list.

If you are using Bluetooth GPS:

• Download, install and open the app on the tablet
• Open the Settings screen by clicking the Overflow icon (the three dot icon) in the upper right and check the options for Reconnect and Use Unsecure Connection.
• Exit the Settings screen and go to the Main tab.
• Click the Start button.
• The app will begin to communicate with the XGPS160 and show you information about the connection.

If you are using Bluetooth GPS Provider:

• Open the Bluetooth GPS Provider app on the tablet
• Open the Preferences screen by clicking the Overflow icon (the three dot icon) in the upper right corner.
• In the Choose GPS receiver popup menu, select the XGPS160.
• In the GPS Connection Method popup menu, select Insecure (Reflection).
• Exit the Preferences screen and go to the Main tab:
• Click the Start button.
• The app will begin to communicate with the XGPS160 and show you information about the connection.

The tablet will now be connected to the XGPS160, and apps on the tablet can use the data from the XGPS160.

To use the XGPS160 subsequently, just make sure that the helper app is open and running on the tablet.

- See more at: http://gps.dualav.com/explore-by-product/xgps160/#sthash.YZXfU4N0.dpuf

SteveJG

unread,
Jun 4, 2014, 5:56:33 PM6/4/14
to
My suggestion is to do a little reading about gps.   Have you done this tutorial http://appinventor.mit.edu/explore/ai2/location-sensor.html  ?    It explains accuracy  issues and limitations of Android phone GPS receivers versus dedicated GPS units.  

GPS satellites only report five decimal digits of latitude/longitude ... and you have something reporting 13?     Do you realize that  0.00001 degree is essentially a little more than 3 feet?

Averaging readings for a fixed point over a period of time is one of the best ways to improve accuracy.  Yes, collect readings over a period of time and it will improve readings but be careful.  If you use all readings, some of them might be 'trash.'  That is the reported accuracy may be greater than 10 meters or 3 meters or whatever is your standard for measurement.    Use readings over time, however, seriously consider filtering readings whose accuracy does not meet your criteria.

The accuracy of your phone is determined by the number of channels it can receive  and, the number of satellites that comprise the fix.   With AI2, you can retrieve the 'accuracy' but not the number of satellites actually used in the fix ... to do that, you would have to interpret the NEMA strings transmitted by the satellites.   AI2 does not have the capability of reading the ascii NEMA data strings but does report 'accuracy.'  Your phone will not get a fix with less than three satellites, but gets a greatly improved fix with more satellites.

Also, if you want the best fixes, stay with gps only... a network fix is at best ball park at all times.   To ensure that when your phone attempts a fix,   set Provider to gps   and then Lock.    If you do not lock, the phone will revert to a network fix.

How long to wait for additional readings?   Well, read the article and it will give you an idea and a tool to experiment with.  Surveyers, using dedicated units may wait upwards of 10 minutes.  Is 1 enough? No idea.   When you experiment, please tell us how long to get an improved 'fix'.

Have fun.

Regards,
Steve

Scott Ferguson

unread,
Jun 4, 2014, 7:35:29 PM6/4/14
to mitappinv...@googlegroups.com
the garmin returns much more precise waypoints (13 decimal places) relative to the phone (5 decimal places).
That is the number of digits displayed in a label. The internal precision (double?) is the same as that for Java, I think. Hal posted the exact value a while back, but I cannot find it.
---
Scott

SteveJG

unread,
Jun 4, 2014, 9:30:29 PM6/4/14
to
Some additional things to consider when 'averaging'    data to 'improve' accuracy of the positional determination.    You probably do not want to do an arithmetic average of all the points.  A geometric average would be more appropriate.  The reality is that you want to find the 'center' of a set of location points that cluster about a central point -- the point that should represent the best estimate of the 'average' of all the points.  You should be looking for that 'central point' .  You are going to have to do some statistics and  cluster analysis.

Adding to my original post of an hour ago:  What you 'average' is the black location points  and what you want is the location of the red cross.  The points you get might be within this circle of radius 10 meters or 40 meters etc. when you plot the points during your one or ten minute interval  probably minus the points with accuracy greater than the radius of the circle perhaps.  So you need to calculate the weighted average of these points and find the center.   To do that you need to do the statistical analysis.  Can AI2 do it?   


Also, consider,  how many fixes are possible within a minute ..some fixes may take 10-20 seconds, others 2 or 3 seconds.  So you might be able to get 3 to 6 fixes in a minute.  Not a lot for cluster analysis.




A simple arithmetic 'average' is not going to be very helpful in providing a better estimate; all you get is an average of all the positions of the various fixes.

Regards,
Steve
Reply all
Reply to author
Forward
0 new messages