ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.74k stars 17.19k forks source link

GPS NMEA doesn't recognise GNGGA messages #1241

Closed fnoop closed 8 years ago

fnoop commented 10 years ago

Hi, it looks like ardupilot/libraries/AP_GPS/AP_GPS_NMEA.[cpp|h] only recognised GPS messages, not GLONASS or GNSS messages. The first two characters of the message determines the constellation type so GPGGA is the familiar GPS, GLGGA would be GLONASS and GNGGA is GNSS (eg. GPS+GLONASS). Some GPS receivers (I'm looking at Navspark) output GNGGA by default and while it's possible to change requires some manual setup to do so. If APM could recognise GL/GN messages as well as GP, it would automatically be compatible with a wider range of GPS receivers. In the case of the navspark, it works perfectly once the 'Talker ID' is forced to GP instead of GN.

AndKe commented 9 years ago

+1

hyperion11 commented 8 years ago

+1

SovGVD commented 8 years ago

The dirty hack is just ignore prefix. (Copter-3.3 diff)

< const char AP_GPS_NMEA::_gprmc_string[] PROGMEM = "GPRMC";
< const char AP_GPS_NMEA::_gpgga_string[] PROGMEM = "GPGGA";
< const char AP_GPS_NMEA::_gpvtg_string[] PROGMEM = "GPVTG";
---
> const char AP_GPS_NMEA::_gprmc_string[] PROGMEM = "RMC";
> const char AP_GPS_NMEA::_gpgga_string[] PROGMEM = "GGA";
> const char AP_GPS_NMEA::_gpvtg_string[] PROGMEM = "VTG";
339c342
<         if (!strcmp_P(_term, _gprmc_string)) {
---
>         if (!strcmp_P(_term+2, _gprmc_string)) {
342c345
<         } else if (!strcmp_P(_term, _gpgga_string)) {
---
>         } else if (!strcmp_P(_term+2, _gpgga_string)) {
345c348
<         } else if (!strcmp_P(_term, _gpvtg_string)) {
---
>         } else if (!strcmp_P(_term+2, _gpvtg_string)) {
OXINARF commented 8 years ago

Fixed on master.

fnoop commented 8 years ago

Great, thanks :)