From b69130d352b804925d836afe1be82cd241a30e6d Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 22 Jul 2020 10:03:32 +1000 Subject: [PATCH] autotest: require uptime of 5s before declaring GPS definitely not present Until we detect a GPS we mark it as "not present", even if the parameters say that there should be one present. --- Tools/autotest/common.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 550499c9d2..1b594bfe54 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -3679,14 +3679,18 @@ class AutoTest(ABC): self.progress("Waiting for GPS health") tstart = self.get_sim_time_cached() while True: - if self.get_sim_time_cached() - tstart > timeout: + now = self.get_sim_time_cached() + if now - tstart > timeout: raise AutoTestTimeoutException("GPS status bits did not become good") m = self.mav.recv_match(type='SYS_STATUS', blocking=True, timeout=1) if m is None: continue if (not (m.onboard_control_sensors_present & mavutil.mavlink.MAV_SYS_STATUS_SENSOR_GPS)): self.progress("GPS not present") - return + if now > 5: + # it's had long enough to be detected.... + return + continue if (not (m.onboard_control_sensors_enabled & mavutil.mavlink.MAV_SYS_STATUS_SENSOR_GPS)): self.progress("GPS not enabled") continue