diff --git a/src/modules/mavlink/streams/GPS2_RAW.hpp b/src/modules/mavlink/streams/GPS2_RAW.hpp index 025421e471..9ae6f37792 100644 --- a/src/modules/mavlink/streams/GPS2_RAW.hpp +++ b/src/modules/mavlink/streams/GPS2_RAW.hpp @@ -68,7 +68,7 @@ private: hrt_abstime now{}; if (_sensor_gps_sub.update(&gps)) { - if (gps.time_utc_usec > 0) { + if (gps.time_utc_usec <= 0) { msg.time_usec = gps.timestamp; } else { diff --git a/src/modules/mavlink/streams/GPS_RAW_INT.hpp b/src/modules/mavlink/streams/GPS_RAW_INT.hpp index a3b7620fb7..6f68fe1c83 100644 --- a/src/modules/mavlink/streams/GPS_RAW_INT.hpp +++ b/src/modules/mavlink/streams/GPS_RAW_INT.hpp @@ -68,7 +68,7 @@ private: hrt_abstime now{}; if (_sensor_gps_sub.update(&gps)) { - if (gps.time_utc_usec > 0) { + if (gps.time_utc_usec <= 0) { msg.time_usec = gps.timestamp; } else {