autotest: improve gps-for-yaw test

There are flag values in the mavlink definitions for this message, so
make sure we get something approaching the right number.
This commit is contained in:
Peter Barker 2021-10-21 08:48:54 +11:00 committed by Peter Barker
parent 5cf62e8fb3
commit 754192ff26
1 changed files with 9 additions and 2 deletions

View File

@ -7337,6 +7337,7 @@ class AutoTestCopter(AutoTest):
self.do_RTL()
def GPSForYaw(self):
self.context_push()
self.load_default_params_file("copter-gps-for-yaw.parm")
self.reboot_sitl()
ex = None
@ -7344,12 +7345,18 @@ class AutoTestCopter(AutoTest):
self.wait_gps_fix_type_gte(6, message_type="GPS2_RAW", verbose=True)
m = self.assert_receive_message("GPS2_RAW")
self.progress(self.dump_message_verbose(m))
if m.yaw == 0:
raise NotAchievedException("Expected to get GPS-from-yaw")
want = 27000
if abs(m.yaw - want) > 500:
raise NotAchievedException("Expected to get GPS-from-yaw (want %f got %f)" % (want, m.yaw))
self.wait_ready_to_arm()
except Exception as e:
self.print_exception_caught(e)
ex = e
self.context_pop()
self.reboot_sitl()
if ex is not None:
raise ex