Browse Source

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.
zr-v5.1
Peter Barker 5 years ago committed by Peter Barker
parent
commit
b69130d352
  1. 6
      Tools/autotest/common.py

6
Tools/autotest/common.py

@ -3679,14 +3679,18 @@ class AutoTest(ABC): @@ -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")
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

Loading…
Cancel
Save