autotest: correct wait_current_waypoint timeout behaviour

This commit is contained in:
Peter Barker 2021-03-09 13:22:34 +11:00 committed by Peter Barker
parent 8e8f2b93a7
commit 3ddffdab9b

View File

@ -5079,7 +5079,9 @@ class AutoTest(ABC):
def wait_current_waypoint(self, wpnum, timeout=60):
tstart = self.get_sim_time()
while self.get_sim_time() < tstart + timeout:
while True:
if self.get_sim_time() - tstart > timeout:
raise AutoTestTimeoutException("Did not get wanted current waypoint")
seq = self.mav.waypoint_current()
self.progress("Waiting for wp=%u current=%u" % (wpnum, seq))
if seq == wpnum: