Properly timestamping GNSS data
Hi there, I'm relatively new to ROS. I'm looking to fuse data from various sensors using robot_localization. To parse NMEA sentences from a GPS reciever, I'm using the 'nmea_navsat_driver' package. I noticed that the timestamp it affixes to position and velocity messages is the system timestamp (by that I mean it uses the time of the computer running the package) rather than the time contained in the NMEA sentence. It seems to me that to fuse GPS data with, say, IMU data, it would be better to use the time contained in the NMEA sentences. I can timestamp the IMU data using a real time clock (RTC is synchronised to GPS time using a PPS signal) in a Teensy before sending it to the computer which runs robot_localization. Therefore, I'm about to modify the nmea_navsat_driver python code to do this. Am I missing something? Is there another way to deal with this. I'm using ROS kinetic.
Finally, I used the time_ref topic published by 'nmea_navsat_driver' package. It has the same timestamp as the fix messages (fix and time information are contained in the same NMEA line) but the time message contained within is slightly earlier and starts on the second and at intervals corresponding to the frequency at which the GPS is outputting data.
I wrote a node which matches fix messages with time_ref messages and outputs the fix messages over a new topic with the time given by the GPS module as the timestamp. This node also saves the GPS fixes.
This is the gist of it:
So is your question answered at this point?
Yes, your first message answered my question. Thank you. I couldn't find an easy way to modify nmea_navsat_driver so I dealt with it as above. Moreover, it's nice to be able to tell the lag between my system clock and GPS time.