mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 16:33:34 +08:00
vehicle_gps_position: use timestamp field instead of timestamp_position
timestamp was unused. This allows to remove timestamp_position.
This commit is contained in:
@@ -366,7 +366,7 @@ static bool gnssCheck(orb_advert_t *mavlink_log_pub, bool report_fail)
|
||||
else {
|
||||
struct vehicle_gps_position_s gps;
|
||||
if ( (OK != orb_copy(ORB_ID(vehicle_gps_position), gpsSub, &gps)) ||
|
||||
(hrt_elapsed_time(&gps.timestamp_position) > 1000000)) {
|
||||
(hrt_elapsed_time(&gps.timestamp) > 1000000)) {
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2167,7 +2167,7 @@ int commander_thread_main(int argc, char *argv[])
|
||||
if (!map_projection_global_initialized()
|
||||
&& (gps_position.eph < eph_threshold)
|
||||
&& (gps_position.epv < epv_threshold)
|
||||
&& hrt_elapsed_time((hrt_abstime *)&gps_position.timestamp_position) < 1e6) {
|
||||
&& hrt_elapsed_time((hrt_abstime *)&gps_position.timestamp) < 1e6) {
|
||||
/* set reference for global coordinates <--> local coordiantes conversion and map_projection */
|
||||
globallocalconverter_init((double)gps_position.lat * 1.0e-7, (double)gps_position.lon * 1.0e-7,
|
||||
(float)gps_position.alt * 1.0e-3f, hrt_absolute_time());
|
||||
@@ -2189,7 +2189,7 @@ int commander_thread_main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (gps_position.fix_type >= 3 && hrt_elapsed_time(&gps_position.timestamp_position) < FAILSAFE_DEFAULT_TIMEOUT) {
|
||||
if (gps_position.fix_type >= 3 && hrt_elapsed_time(&gps_position.timestamp) < FAILSAFE_DEFAULT_TIMEOUT) {
|
||||
/* handle the case where gps was regained */
|
||||
if (status_flags.gps_failure && !gpsIsNoisy) {
|
||||
status_flags.gps_failure = false;
|
||||
|
||||
Reference in New Issue
Block a user