szenergy / duro_gps_driver

:blue_book: ROS/ROS2 driver for SwiftNav Duro Inertial GPS / GNSS receivers
BSD 3-Clause "New" or "Revised" License
13 stars 14 forks source link

Time reference to sec + nsec #14

Closed horverno closed 1 year ago

horverno commented 2 years ago

Swiftnaw provides GPS time in msec + nsec_residual basis, but the standard ROS time is sec + nsec. Conversion is needed.

https://swift-nav.github.io/libsbp/c/build/docs/html/structsbp__gps__time__t.html

time_msg->time_ref.sec = time_gps.tow; // TODO - It is not sec: GPS time of week rounded to the nearest millisecond [ms]
time_msg->time_ref.nsec = time_gps.ns_residual; // TODO - It is not nsec: Nanosecond residual of millisecond-rounded TOW

https://github.com/szenergy/duro_gps_driver/blob/ac53808d67c2e45e08247716ef20e3c5e08f417e/src/duro.cpp#L257