uavcan: ignore 0 UTC timestamps (#24529)

We need to wait for a valid UTC timestamp, otherwise we end up in 1970
with Here 4 which sends 0 for a bit even if there is already a fix.
This commit is contained in:
Julian Oes 2025-03-18 18:19:54 +13:00 committed by GitHub
parent b6597f2984
commit d72c2cc378
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -453,7 +453,7 @@ void UavcanGnssBridge::process_fixx(const uavcan::ReceivedDataStructure<FixType>
}
// If we haven't already done so, set the system clock using GPS data
if ((fix_type >= sensor_gps_s::FIX_TYPE_2D) && !_system_clock_set) {
if (report.time_utc_usec != 0 && (fix_type >= sensor_gps_s::FIX_TYPE_2D) && !_system_clock_set) {
timespec ts{};
// get the whole microseconds