Mbed library to handle GPS data reception and parsing
Dependents: GPS_U-blox_NEO-6M_Code
Features
- All positionning parameters are contained into a global data structure.
- Automatic nema string parsing and data structure update.
- GSA,GGA,VTG and RMC
- Convert latitude and longitude to decimal value.
- Converts latittude,longitude and altitude to ECEF coordinates.
Planed developement
- Test library for RTOS use.
- Complete the nema parsing decoders (couple of parameters are not parsed yet and not present in the data structure).
- Add conversion tool to get ENU coordinates.
Diff: GPS.cpp
- Revision:
- 5:8a73e34b3978
- Parent:
- 4:d911d7c4e09d
--- a/GPS.cpp Mon Feb 15 05:26:36 2016 +0000 +++ b/GPS.cpp Tue Feb 16 02:57:35 2016 +0000 @@ -49,7 +49,7 @@ RxMessageBuffer.data[(insertIndex++)%RX_BUFFER_SIZE] = in; } } -void GPS::PumpGpsMessages(void) +void GPS::UpdateGPS(void) { if(GPSRMCMessage.MessageIsNew > 0) { @@ -88,11 +88,13 @@ } ECEFDistance GPS::DistanceBetweenTwoWP(ECEFPoint p1,ECEFPoint p2) { + return DistanceBetweenTwoECEFPoints(p1,p2); } geodPoint GPS::ReadDecGeodLoc(void){ geodPoint newLoc; + UpdateGPS(); newLoc.latitude = nmea_to_dec(info.latitude,info.latLoc); newLoc.longitude = nmea_to_dec(info.longitude,info.lonLoc); newLoc.altitude = info.GPSAltitude; @@ -101,6 +103,7 @@ geodPoint GPS::ReadRawGeodLoc(void){ geodPoint newLoc; + UpdateGPS(); newLoc.latitude = info.latitude; newLoc.longitude = info.longitude; newLoc.altitude = info.GPSAltitude; @@ -109,12 +112,15 @@ bool GPS::FixIs3d(void){ + UpdateGPS(); return (info.fix == 3); } bool GPS::FixIs2d(void){ + UpdateGPS(); return (FixIs3d() || (info.fix == 2)); } bool GPS::GPSFixValid(void){ + UpdateGPS(); return (info.GPSStatus == 'A'); }