autotest: improve diagnostics around touchdown/takeoff expected tests

Also looks at last result as we don't appear to have a consistent number
in our tests
This commit is contained in:
Peter Barker 2021-06-17 22:30:26 +10:00 committed by Andrew Tridgell
parent a9717ea5ff
commit 4a08f1334a
1 changed files with 6 additions and 4 deletions

View File

@ -6845,6 +6845,7 @@ class AutoTestCopter(AutoTest):
self.change_mode('LAND')
self.wait_disarmed()
durations = self.get_takeoffexpected_durations_from_current_onboard_log(ignore_multi=True)
self.progress("touchdown-durations: %s" % str(durations))
duration = durations[0]
self.progress("takeoff-expected-duration %f" % (duration,))
want_lt = 5
@ -6866,11 +6867,12 @@ class AutoTestCopter(AutoTest):
self.change_mode('LAND')
self.wait_disarmed()
gots = self.get_touchdownexpected_durations_from_current_onboard_log(ignore_multi=True)
got = gots[2]
durations = self.get_touchdownexpected_durations_from_current_onboard_log(ignore_multi=True)
self.progress("touchdown-durations: %s" % str(durations))
duration = durations[-1]
expected = 23 # this is the time in the final descent phase of LAND
if abs(got - expected) > 5:
raise NotAchievedException("Was expecting roughly %fs of touchdown expected, got %f" % (expected, got))
if abs(duration - expected) > 5:
raise NotAchievedException("Was expecting roughly %fs of touchdown expected, got %f" % (expected, duration))
# a wrapper around all the 1A,1B,1C..etc tests for travis
def tests1(self):