Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

GPSSerial library

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 01-15-2009, 02:11 PM
schimanski's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: Germany
Posts: 289
Default

Hello agraham!

One example for the same position:

With GPS as GPSDriver-Object:

GPS.Latitude=51.029435
GPS.Longitude=5.99185

With GPS as GPSSerial-Object:

GPS.Latitude=510.173,850
GPS.Longitude=55.951,450
__________________
schimanski
--------------------------------------
Device: Motorola Defy, Samsung Galaxy Tab P1000
Dekstop: Asus Eee PC
Reply With Quote
  #12 (permalink)  
Old 01-15-2009, 03:07 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

It looks like your readings are a factor of 10 out but I don't see that problem here. I am sure another user would have meantioned this if it were a general problem. Are you using two different GPS receivers for the GPSDriver and GPSSerial apps?

I have a test program that I wrote for GPSDriver and then, like you, transferred to GPSSerial. I've just run the two side by side.

My HTC Diamond with internal GPS receiver using GPSDriver and my Axim X30 with an external Bluetooth Fuzion GPS receiver running GPSSerial both give almost the same latitude and longitude readings.

The latitude and longitude are taken from the $GPRMC sentence. If you can look at the contents of that sentence that might give a clue as to what is happening.
Reply With Quote
  #13 (permalink)  
Old 01-15-2009, 03:14 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by schimanski View Post
With GPS as GPSSerial-Object:

GPS.Latitude=510.173,850
GPS.Longitude=55.951,450
Should those commas be there? Is this a culture thing? Are those erroneous readings actually 510173.85 and 55951.45?
Reply With Quote
  #14 (permalink)  
Old 01-15-2009, 04:50 PM
schimanski's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: Germany
Posts: 289
Default

Quote:
Should those commas be there? Is this a culture thing? Are those
erroneous readings actually 510173.85 and 55951.45?
I have checked it and the commas are there.

You are right, that I use two different GPS receivers. For the GPSSerial I use a DiMP3 bluetooth receiver (SirfIII) and my device has an internal SirfIII.

I have read the NMEA-sentences with your testapplication GPSSerial on the device and the desktop:

Both RMC-Sentences are the same:
GPSSerial: Latitude=5101.7372, Longitude=00559.5017
GPSDriver: Latitude=5101.7505, Longitude=00559.5182
(with the typical receiver difference)


But I have noticed, that GPSSerial shows on the device and the desktop this format:

GPS.Latitude=510.173,850
GPS.Longitude=55.951,450

But I need the following, because it is the format of the GPSDriver-Lib (displayed with the GPSDriver-testapplication):

GPS.Latitude=51.029435
GPS.Longitude=5.99185

What can I do without modifying the code for desktop and device?
__________________
schimanski
--------------------------------------
Device: Motorola Defy, Samsung Galaxy Tab P1000
Dekstop: Asus Eee PC

Last edited by schimanski : 01-15-2009 at 05:13 PM.
Reply With Quote
  #15 (permalink)  
Old 01-15-2009, 05:40 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by schimanski View Post
What can I do without modifying the code for desktop and device?
Wait for me to post tomorrow a slightly modified GPSSerial that can cope with OS culture settings where the decimal separator is a comma. It is an oversight on my part (I think). I assume that your culture settings on your device and desktop are German and this is causing the decimal point to be ignored when converting the NMEA data as it is being interpreted as a group separator and not a decimal point - hence the value comes out about 10000 times too large. I need to override your culture settings.

I haven't had to deal with culture dependent formatting before. Can you tell me when you use Basic4ppc and enter decimal data do you have to use the decimal point and not a comma for decimal data? Also what happens with the following three lines of code

test1 = 10
test2 = test1 + 1234.567 ' UK and US number format
test3 = test1 + 1234,567 ' European number format ' does this error?
msgbox(test2 & crlf & test3)

Quote:
GPS.Latitude=510.173,850
Do you know how that number is being formatted for output. Are you using Format()? I am puzzled why it comes out in European format as I thought that Basic4ppc enforced the use of US standard numeric formatting.
Reply With Quote
  #16 (permalink)  
Old 01-15-2009, 06:02 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Version 1.2 now posted has a small modification to hopefully cope with computers whose culture settings use comma rather than full-stop as a decimal point separator.

Also added to the GPSSerial object are four new properties that return the last copy of each NMEA sentence that was parsed to provide the GPS data. These sentences are complete with checksum. It is probably easier to use these properties than parse the sentences out of the stream of data returned by the NMEAReadXXX methods.
Reply With Quote
  #17 (permalink)  
Old 01-15-2009, 07:17 PM
schimanski's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: Germany
Posts: 289
Default

Hello agraham, thanks for your fast help.

Quote:
test1 = 10
test2 = test1 + 1234.567 ' UK and US number format
test3 = test1 + 1234,567 ' European number format ' does this error?
msgbox(test2 & crlf & test3)
The result is test2=1244.567, for test3, I get a syntax error.

I have test also the new GPSSerial.Lib. Now I get:

GPS.Latitude=51,029435
GPS.Longitude=5,99185

The calculate of the distance etc. are wrong. I think that it is the comma. Instead of the comma there must be a point....
__________________
schimanski
--------------------------------------
Device: Motorola Defy, Samsung Galaxy Tab P1000
Dekstop: Asus Eee PC
Reply With Quote
  #18 (permalink)  
Old 01-15-2009, 07:30 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by schimanski View Post
I think that it is the comma. Instead of the comma there must be a point....
Sorry, I overlooked a line of code that I should have fixed as well. I now realise where the formatting comes from that puzzled me earlier. I'll fix it tomorrow. It's a bit tricky to fix this stuff that doesn't occur on your own computer
Reply With Quote
  #19 (permalink)  
Old 01-16-2009, 10:31 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Version 1.3 now posted is hopefully now immune to OS culture setting problems.
Reply With Quote
  #20 (permalink)  
Old 01-16-2009, 12:11 PM
schimanski's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: Germany
Posts: 289
Thumbs up

Yes, agraham! I have tested the new lib in my application and it runs perfect!

much thanks...
__________________
schimanski
--------------------------------------
Device: Motorola Defy, Samsung Galaxy Tab P1000
Dekstop: Asus Eee PC
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Door library (Beta) - Special library Erel Official Updates 60 01-13-2011 12:23 PM
Merging Outlook library and Phone library Erel Official Updates 11 09-15-2010 10:22 AM
PhoneticAlgorithms Library (ex-StringComparison Library) moster67 Additional Libraries 10 11-11-2008 08:46 PM


All times are GMT. The time now is 01:37 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0