Handle NavSatFix NaN value to prevent crashes#63
Handle NavSatFix NaN value to prevent crashes#63maax-cha wants to merge 1 commit intoLORD-MicroStrain:ros2from
Conversation
|
Thanks for submitting this PR. Crashing is definitely not the desired behavior here. However, I am curious if we even want to send the NMEA sentence to the server if it has NaN for either Latitude or Longitude. Most of the time, those are the only two pieces of information that NTRIP servers actually look at from the NMEA sentence. Do you have experience using a server that is okay with receiving blank position information, and what is the purpose of sending the blank position information if so? |
|
Actually, I have been using the package you provided without a full understanding of NTRIP. (By the way, thank you for creating such a convenient package! haha)
Since I couldn’t find an official specification for NTRIP servers, I referred to an NTRIP example from SparkFun’s ZED-F9P. In that example, it appeared that the system forwarded the NMEA sentence without checking whether the latitude or longitude was empty. However, to avoid unnecessary traffic, it might be a good idea not to send the data if it is empty. |
Intro
When valid latitude, longitude, or altitude data isn’t received from the GPS (particularly immediately after powering on the GPS module), the NavSatFix message’s latitude and longitude fields may show up as NaN.
raw NMEA data
NavSatFix data
In this situation, the following error occurs in the NTRIP client:
Changes
Before using
fix.latitudeandfix.longitude, check for NaN and clear the fields if detected.