Browse Source

Tools: autotest: improve debug output

mission-4.1.18
Peter Barker 6 years ago committed by Peter Barker
parent
commit
d3b8504757
  1. 12
      Tools/autotest/arducopter.py

12
Tools/autotest/arducopter.py

@ -1716,9 +1716,9 @@ class AutoTestCopter(AutoTest):
self.mav.recv_match(type='GLOBAL_POSITION_INT', blocking=True) self.mav.recv_match(type='GLOBAL_POSITION_INT', blocking=True)
new_pos = self.mav.location() new_pos = self.mav.location()
delta = self.get_distance(old_pos, new_pos) delta = self.get_distance(old_pos, new_pos)
if delta > 1:
raise NotAchievedException()
self.progress("Landed %u metres from original position" % delta) self.progress("Landed %u metres from original position" % delta)
if delta > 1:
raise NotAchievedException("Did not land close enough to original position")
except Exception as e: except Exception as e:
self.progress("Exception caught") self.progress("Exception caught")
@ -2350,7 +2350,7 @@ class AutoTestCopter(AutoTest):
tstart = self.get_sim_time() tstart = self.get_sim_time()
while True: while True:
if self.get_sim_time() - tstart > timeout: if self.get_sim_time() - tstart > timeout:
raise NotAchievedException() raise NotAchievedException("Mount pitch not achieved")
m = self.mav.recv_match(type='MOUNT_STATUS', m = self.mav.recv_match(type='MOUNT_STATUS',
blocking=True, blocking=True,
@ -2411,8 +2411,7 @@ class AutoTestCopter(AutoTest):
blocking=True, blocking=True,
timeout=5) timeout=5)
if m.pointing_a != 0 or m.pointing_b != 0 or m.pointing_c != 0: if m.pointing_a != 0 or m.pointing_b != 0 or m.pointing_c != 0:
self.progress("Stabilising when not requested") raise NotAchievedException("Mount stabilising when not requested")
raise NotAchievedException()
self.mavproxy.send('mode guided\n') self.mavproxy.send('mode guided\n')
self.wait_mode('GUIDED') self.wait_mode('GUIDED')
@ -2434,8 +2433,7 @@ class AutoTestCopter(AutoTest):
blocking=True, blocking=True,
timeout=5) timeout=5)
if m.pointing_a != 0 or m.pointing_b != 0 or m.pointing_c != 0: if m.pointing_a != 0 or m.pointing_b != 0 or m.pointing_c != 0:
self.progress("Stabilising when not requested") raise NotAchievedException("Mount stabilising when not requested")
raise NotAchievedException()
self.progress("Enable pitch stabilization using MOUNT_CONFIGURE") self.progress("Enable pitch stabilization using MOUNT_CONFIGURE")
self.do_pitch(despitch) self.do_pitch(despitch)

Loading…
Cancel
Save