mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
gps: use UTC timestamp when GPS fixed (#26127)
This commit is contained in:
parent
f46fd89057
commit
1e618a7eb0
@ -68,7 +68,13 @@ private:
|
||||
hrt_abstime now{};
|
||||
|
||||
if (_sensor_gps_sub.update(&gps)) {
|
||||
msg.time_usec = gps.timestamp;
|
||||
if (gps.time_utc_usec > 0) {
|
||||
msg.time_usec = gps.timestamp;
|
||||
|
||||
} else {
|
||||
msg.time_usec = gps.time_utc_usec;
|
||||
}
|
||||
|
||||
msg.fix_type = gps.fix_type;
|
||||
msg.lat = static_cast<int32_t>(round(gps.latitude_deg * 1e7));
|
||||
msg.lon = static_cast<int32_t>(round(gps.longitude_deg * 1e7));
|
||||
|
||||
@ -68,7 +68,13 @@ private:
|
||||
hrt_abstime now{};
|
||||
|
||||
if (_sensor_gps_sub.update(&gps)) {
|
||||
msg.time_usec = gps.timestamp;
|
||||
if (gps.time_utc_usec > 0) {
|
||||
msg.time_usec = gps.timestamp;
|
||||
|
||||
} else {
|
||||
msg.time_usec = gps.time_utc_usec;
|
||||
}
|
||||
|
||||
msg.fix_type = gps.fix_type;
|
||||
msg.lat = static_cast<int32_t>(round(gps.latitude_deg * 1e7));
|
||||
msg.lon = static_cast<int32_t>(round(gps.longitude_deg * 1e7));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user