This is based on the serial.c program that reads the GPS serial port as text and extracts the North and West data. The program serial.c was very ineffective and I rewrote it completely.
The serialGPS object will open the port you give it as argument (and ttyS3 if you leave it empty), flush any existing data, and set up a timer to read the port at 1 second intervals. Each read looks only for the North and West data. If no data is forthcoming, then GPS is considered to have no lock, which can be tested with the isLocked() member function. If isLocked() returns true then the getNorth() and getWest() routines will return the decimal degrees and minutes from the last read of the GPS (1 second at most).
I found that the following mapping brings GPS and odometry into rough aligment:
X value =-36432*304.8*(North-North0)/5
Y value =-22176*304.8*(West-West0)/5
The source code for the serialGPS object is here:
The include file is here:
This is a little test program to show how to call the object
YOU can only have ONE serialGPS object!
--
DamianLyons - 2011-07-11