ros-drivers / nmea_navsat_driver

ROS package containing drivers for NMEA devices that can output satellite navigation data (e.g. GPS or GLONASS).
BSD 3-Clause "New" or "Revised" License
225 stars 269 forks source link

Invalid checksum error when parsing GPRMC and GPGSV sentence #150

Closed victorll998 closed 2 years ago

victorll998 commented 2 years ago

Hi,

I am getting errors below when I use nmea_navsat_driver to communicate with Ublox F9P. It seems RMC sentences are skipped because of invalid checksum errors.

I found a similar post in ROS answer (https://answers.ros.org/question/192525/problem-with-nmea_serial_driver/). I think it is relevant to the issue I am encountering but there is no answer to it

Thanks in advance

[rosout][WARNING] 2022-06-12 14:54:27,164: Received a sentence with an invalid checksum. Sentence was: '$GPGSV,2,2,08,09,47,051,32,14,46,325,29,27,q3,134,18,30,59,227,31,6*6E'
[rosout][WARNING] 2022-06-12 14:54:29,066: Received a sentence with an invalid checksum. Sentence was: '$GPGSA,A,3,07,p9,08,04,20,05,14,30,27,,,,1.70,0.91,1.43,1*11'
[rosout][WARNING] 2022-06-12 14:54:30,072: Received a sentence with an invalid checksum. Sentence was: '$GPGSA,A,3,07,09,08,04,20,05,14,30,27,,,,1.70,0.91,1.43,1*1q'
[rosout][WARNING] 2022-06-12 14:54:31,030: Received a sentence with an invalid checksum. Sentence was: '$GPRMC,045429.00-A,3454.85336,S,13850.01762,E,2.487,77.91,120622,8.07,E,A,V*67'
[rosout][WARNING] 2022-06-12 14:54:34,165: Received a sentence with an invalid checksum. Sentence was: '$gPGSV,2,2,08,09,47,051,30,14,46,325,29,27,13,135,13,30,59,226,30,6*66'
[rosout][WARNING] 2022-06-12 14:54:41,023: Received a sentence with an invalid checksum. Sentence was: '$GPRMC,04543;.00,A,3454.85127,S,13850.02539,E,2.623,74.67,120622,8.08,E,A,V*62'
[rosout][WARNING] 2022-06-12 14:54:41,151: Received a sentence with an invalid checksum. Sentence was: '$GPGSV,2,1,08,04,14,051,17,05,18,229,25,07,61,155,26-08,30,099,25,6*60'
[rosout][WARNING] 2022-06-12 14:54:42,031: Skipped reading a line from the serial device because it could not be decoded as an ASCII string. The bytes were b'$GPRMC,045440.00,A,3454.85111,\xd3,13850.02621,E,2.408,77.22,120622,8.08,E,A,V*6A'
[rosout][WARNING] 2022-06-12 14:54:44,030: Received a sentence with an invalid checksum. Sentence was: '$GPRMC,045452.00,A,3454.85072,S,13850.02777,E,2.451,76.62,120622,8.08,E,A,V*67'
[rosout][WARNING] 2022-06-12 14:54:44,172: Received a sentence with an invalid checksum. Sentence was: '$GPGSV,2,2,08,09,47,0=1,31,14,46,325,29,27,13,135,17,30,59,226,32,6*61'
[rosout][WARNING] 2022-06-12 14:54:46,027: Received a sentence with an invalid checksum. Sentence was: '$GPRMC,045444.00,A,3454.85049,S,13850.02934,U,2.377,81.51,120622,8.08,E,A,V*6B'
[rosout][WARNING] 2022-06-12 14:54:48,023: Received a sentence with an invalid checksum. Sentence was: '$GPRMC,045446.00,A,3454.85017,S,13850.03093,E,2.466,72.93,120622,8/08,E,A,V*62'
evenator commented 2 years ago

Your device appears to be outputting invalid NMEA sentences. There are two different problems here:

Most of the rejected sentences have incorrect checksums. The purpose of the checksum is the detect message corruption. The checksum is the last field of the sentence (after the * character), and it should equal the value of XORing every character in the sentence between the $ and * characters. You can see with this online checksum calculator that the correct checksum of GPGSV,2,2,08,09,47,051,32,14,46,325,29,27,q3,134,18,30,59,227,31,6 is 2E, not 6E. I suspect the problem with that particular sentence is the q3 field, since all of those fields should be numeric. You'll see similar anomalies in the other rejected messages.

The GPRMC message that couldn't be decoded also exhibits a data integrity error. It contains the character \xd3, which is not even a valid ASCII character.

Both of these problems indicate that either your device or the serial connection to your device has a problem that's causing data corruption. The driver is performing as expected.

Best of luck solving your problem. I suspect it's a hardware issue somewhere in the serial connection between your GPS device and computer.