Browse Source

autotest: correct units in new AHRS2 test

c415-sdk
Peter Barker 4 years ago committed by Andrew Tridgell
parent
commit
a235246628
  1. 20
      Tools/autotest/arduplane.py

20
Tools/autotest/arduplane.py

@ -1314,16 +1314,20 @@ class AutoTestPlane(AutoTest):
raise NotAchievedException("Secondary location looks bad") raise NotAchievedException("Secondary location looks bad")
# check attitude # check attitude
attitude = self.mav.recv_match(type='ATTITUDE', blocking=True, timeout=1) simstate = self.mav.recv_match(type='SIMSTATE', blocking=True, timeout=1)
if attitude is None: if simstate is None:
raise NotAchievedException("Did not receive ATTITUDE message") raise NotAchievedException("Did not receive SIMSTATE message")
self.progress("ATTITUDE: %s" % str(attitude)) self.progress("SIMSTATE: %s" % str(simstate))
if abs(math.degrees(attitude.roll) - ahrs2.roll) > 5: want = math.degrees(simstate.roll)
got = math.degrees(ahrs2.roll)
if abs(want - got) > 5:
raise NotAchievedException("Secondary roll looks bad (want=%f got=%f)" % raise NotAchievedException("Secondary roll looks bad (want=%f got=%f)" %
(math.degrees(attitude.roll), ahrs2.roll)) (want, got))
if abs(math.degrees(attitude.pitch) - ahrs2.pitch) > 5: want = math.degrees(simstate.pitch)
got = math.degrees(ahrs2.pitch)
if abs(want - got) > 5:
raise NotAchievedException("Secondary pitch looks bad (want=%f got=%f)" % raise NotAchievedException("Secondary pitch looks bad (want=%f got=%f)" %
(math.degrees(attitude.pitch), ahrs2.pitch)) (want, got))
def test_main_flight(self): def test_main_flight(self):

Loading…
Cancel
Save