You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using ROS Melodic and got this error when working with the nmea_topic_driver node. Value error, likely due to missing fields in the NMEA message. Error was: invalid literal for int() with base 10: ''
I tracked the error to the parser.py script. Specifically on line 128: nanosecs = int(nmea_utc[7:]) * pow(10, 9 - len(nmea_utc[7:]))
My GPS reports NMEA strings in the RMC format, the first field in the sentence is the timestamp, which in my case only has a length of 6 digits, causing the aforementioned line to fail.
A possible fix would be changing the line to: nanosecs = int(nmea_utc[7:]) * pow(10, 9 - len(nmea_utc[7:])) if len(time_str) > 6 else 0
Cheers
The text was updated successfully, but these errors were encountered:
Hello!
I'm using ROS Melodic and got this error when working with the nmea_topic_driver node.
Value error, likely due to missing fields in the NMEA message. Error was: invalid literal for int() with base 10: ''
I tracked the error to the parser.py script. Specifically on line 128:
nanosecs = int(nmea_utc[7:]) * pow(10, 9 - len(nmea_utc[7:]))
My GPS reports NMEA strings in the RMC format, the first field in the sentence is the timestamp, which in my case only has a length of 6 digits, causing the aforementioned line to fail.
A possible fix would be changing the line to:
nanosecs = int(nmea_utc[7:]) * pow(10, 9 - len(nmea_utc[7:])) if len(time_str) > 6 else 0
Cheers
The text was updated successfully, but these errors were encountered: