2016년 12월 11일 일요일

How to use an external Bluetooth GPS ?


I need to use an external GPS. GPS is connected with a bluetooth. What blocks could i use for Latitude and longitude ? 

-- 
I assume you have an Arduino and a GPS shield.  You might want to view this video https://www.youtube.com/watch?v=v74E01ESdUA    The video shows the principles of use.  The Arduino has the ability to send the latitude, longitude and time  from the GPS as comma separated data. (cvs).  

The Arduino needs a module to communicate via Bluetooth.    You use the Bluetooth to communicate with your Android with AI2.  

You will need the AI2 Bluetooth blocks and capture the NEMA cvs, you can then post the data stream to a label or whatever.  You might search the forum for  GPS Arduino Bluetooth to see what other forum users have to say.   I am not aware of a tutorial that specifically shows how to  capture latitude and longitude from the external GPS.

What have you tried?   Can you capture the data stream from the GPS or are you just starting to program?

 I suggest before you start using a separate device, you learn to use GPS navigation using the GPS in your Android.  You might look at the MIT tutorial  Walk, then run.  Then look at the threads here   https://groups.google.com/forum/#!searchin/mitappinventortest/arduino   that lists discussions in the Forum how to do do things with Arduino ... a device controller possibly similar to what you have.  One of the threads discusses using a separate GPS device ..you need to find it.

We want you to have fun with App Inventor so here are some resources to help you learn to use the AI2 tools  A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks. You can read the entire book in an hour or so and the time spent will be worth while.

There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  

How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling.

Does this help you program?    Please continue to ask questions here however if you read the information above, you will not have to wait for answers.

Just try some blocks and have fun... and walk, don't run.  Run later and ask specific questions when you have tried some blocks.


-- 
I use also external BT-gps module due the possibility to have correction calculation to data stream with Lefebure NTRIP software, maybe this could be one solution. But now one question about Ai2 position block: why lat&lon desimal are cutted (trim) to 5 digits? And is there a trick to get more digits from block; location changed? And another question: how to make block where I can get lat&lon for example every second? This would be very useful when calculating capability of location data, for example collect 10 pcs lat&lon => calculate position accuracy, how big circle is where all collected points are etc.

-- 
Have you read the MIT LocationSensor tutorial and did you DO the exercises (both projects)  https://docs.google.com/document/d/1V1Zm5cYoa12KVb_cTlfelSfyUkW7IH2WPHUoTa02XaY/pub  
The gps in phones/tablets is not necessarily the precision surveying tool many think it is.  Data reported by the GPS is frequently off by +/- 50 meters or more and seldom accurate to within 2 or 3 meters.

Satellite NEMA strings are reported to five digits as the data is broadcast from the positional satellites.  The GPS receives a data string to a precision of five digits as a text string..   0.00001 of a degree of latitude is 0.006 of a nautical mile, or 3 feet, 7+3/4 inches

More digits ... oh it is possible but NOT with the phones and tablets that Android uses. "More digits" is obtained by 'averaging' multiple satellite fixes and statistical processing.  One cannot do that to the precision required with AI2 in a reasonable time frame probably. Professional surveyors us multi-channel dedicated GPS receivers and special techniques to get greater precision.  Five digits (  0.00001 of a degree of latitude)  provides a resolution of  0.9144 meters; seldom possible with a phone GPS  (read the article about Accuracy and multi-channel GPS receivers)

You cannot actually get latitude and longitude every second using an Android and AI2.  When you query the sensor, the sensor takes a few seconds to get a satellite 'fix'   The initial fix might take 20 to 30 seconds or more and sometimes one can get a 'fix'.  Setting the interval to less than 5000 ms (5 seconds) will probably give your Android a 'heart attack'...AI2 processes commands asynchronously.  Request more often and you request a new fix before the previous fix is resolved by your Android's cpu . Most likely no new data will be acquired.  There are other reasons why you do not want to sample every second.

The LocationSensor algorithms calculate an Accuracycircle.  You can read about it and use the aia file in the article to test your device.  Sorry, the GPS and Android usually do not report exactly where the data says the device is located.  Really? So, to help users, a concept called Accuracy is calculated.  What is reported as a satellite fix lays within one standard deviation of where it is actually reported.  Accuracy is affected by the number of satellites the GPS uses to get a fix, the angles to the satellites etc.

Yes, you can plot 10 samples of latitude and longitude using the Google Maps API ...the simplest way is to create a static map  and/or you could write a statistical algorithm to use the information from the ten locations to statistically average them.  Have you ever tried to solve Math issues with AI2 blocks?   Scary.  Statistical algorithms take a long time to create.  AI2 is not a scripting language and the blocks are awkward creating formulas.  When you are done the processing is relatively slow for lots of reasons compared to a Java solution.  The algorithms themselves are not trivial.  Give it a try and please post your statistical averaging block so the AI2 users can benefit.   You might find searching for terms like Kriging , spatial data, gridding etc will help you find an appropriate algorithm to create a spatial average of the ten locations.  Many of these techniques require using matrices , integration and determinates ..concepts AI2's math drawer cannot really handle.

Please read the article and when you are done perhaps google     NEMA ,  GPS resolution  etc. on the Internet to help you understand why GPS measurements with Android phones is not precise.  The MIT article is intended as an introduction to the concepts of geo-positioning and using a GPS receiver.

-- 
Yep, just those mentioned tutorials has guided to this location world with AI2. I understand the fact of phone or tablet gps/glonass capabilty&accuracy and that is the reason why I am using external BT-receiver&software to re-calculate the information of positioning (Lefebure NTRIP).

 I live in Finland and we have free (!) accses to correlation data from our geologic institute and with this method the accuracy of positioning data can be quite nice. I can reach HDOP-values up to 0.7-0.9 with 11-12 satellites, when the sky is clear and the humidity is low. HDOP-value is telling to me, when the quality is good enough to use data to post processing.

I studied also a little the documentation of those java classes and I found the information of class Location:Constants;Constant used to specify formatting of a latitude or longitude in the form "[+-]DDD.DDDDD where D indicates degrees.

So, I have to study more of programming and try to read direct information of nmea-stream...

And the reason why I am doing this more or less crazy stuff:

I like to develop a app where user can pick two points (more than 50 meters difference) and this app calculates my diff from straight line when I am walking between points.
And because my hobby is also math&stats, the calculating two-dimensional data capability is also quite challenging and fun and those purposes I use R, but the data have to be collect first.

-- 


댓글 없음:

댓글 쓰기