Browse Source

autotest: start and stop MAVProxy for alttype and surface tracking tests

autotest doesn't currently supply terrain tiles, so MAVProxy must be
started
zr-v5.1
Peter Barker 4 years ago committed by Peter Barker
parent
commit
8901efd69d
  1. 15
      Tools/autotest/arducopter.py
  2. 21
      Tools/autotest/common.py

15
Tools/autotest/arducopter.py

@ -2725,6 +2725,11 @@ class AutoTestCopter(AutoTest):
ex = None ex = None
self.context_push() self.context_push()
# we must start mavproxy here as otherwise we can't get the
# terrain database tiles - this leads to random failures in
# CI!
mavproxy = self.start_mavproxy()
try: try:
self.set_analog_rangefinder_parameters() self.set_analog_rangefinder_parameters()
self.set_parameter("RC9_OPTION", 10) # rangefinder self.set_parameter("RC9_OPTION", 10) # rangefinder
@ -2772,6 +2777,9 @@ class AutoTestCopter(AutoTest):
self.print_exception_caught(e) self.print_exception_caught(e)
self.disarm_vehicle(force=True) self.disarm_vehicle(force=True)
ex = e ex = e
self.stop_mavproxy(mavproxy)
self.context_pop() self.context_pop()
self.reboot_sitl() self.reboot_sitl()
if ex is not None: if ex is not None:
@ -4805,6 +4813,11 @@ class AutoTestCopter(AutoTest):
''' '''
# we must start mavproxy here as otherwise we can't get the
# terrain database tiles - this leads to random failures in
# CI!
mavproxy = self.start_mavproxy()
self.set_parameter("FS_GCS_ENABLE", 0) self.set_parameter("FS_GCS_ENABLE", 0)
self.change_mode('GUIDED') self.change_mode('GUIDED')
self.wait_ready_to_arm() self.wait_ready_to_arm()
@ -4864,6 +4877,8 @@ class AutoTestCopter(AutoTest):
self.wait_disarmed() self.wait_disarmed()
self.stop_mavproxy(mavproxy)
def fly_precision_companion(self): def fly_precision_companion(self):
"""Use Companion PrecLand backend precision messages to loiter.""" """Use Companion PrecLand backend precision messages to loiter."""

21
Tools/autotest/common.py

@ -7786,6 +7786,7 @@ Also, ignores heartbeats not from our target system'''
def test_set_position_global_int(self, timeout=100): def test_set_position_global_int(self, timeout=100):
"""Test set position message in guided mode.""" """Test set position message in guided mode."""
# Disable heading and yaw test on rover type # Disable heading and yaw test on rover type
if self.is_rover(): if self.is_rover():
test_alt = False test_alt = False
test_heading = False test_heading = False
@ -7795,16 +7796,16 @@ Also, ignores heartbeats not from our target system'''
test_heading = True test_heading = True
test_yaw_rate = True test_yaw_rate = True
self.set_parameter("FS_GCS_ENABLE", 0)
self.change_mode("GUIDED")
self.wait_ready_to_arm()
self.arm_vehicle()
# we must start mavproxy here as otherwise we can't get the # we must start mavproxy here as otherwise we can't get the
# terrain database tiles - this leads to random failures in # terrain database tiles - this leads to random failures in
# CI! # CI!
mavproxy = self.start_mavproxy() mavproxy = self.start_mavproxy()
self.set_parameter("FS_GCS_ENABLE", 0)
self.change_mode("GUIDED")
self.wait_ready_to_arm()
self.arm_vehicle()
if self.is_copter() or self.is_heli(): if self.is_copter() or self.is_heli():
self.user_takeoff(alt_min=50) self.user_takeoff(alt_min=50)
@ -8026,16 +8027,16 @@ Also, ignores heartbeats not from our target system'''
test_heading = True test_heading = True
test_yaw_rate = True test_yaw_rate = True
self.set_parameter("FS_GCS_ENABLE", 0)
self.change_mode("GUIDED")
self.wait_ready_to_arm()
self.arm_vehicle()
# we must start mavproxy here as otherwise we can't get the # we must start mavproxy here as otherwise we can't get the
# terrain database tiles - this leads to random failures in # terrain database tiles - this leads to random failures in
# CI! # CI!
mavproxy = self.start_mavproxy() mavproxy = self.start_mavproxy()
self.set_parameter("FS_GCS_ENABLE", 0)
self.change_mode("GUIDED")
self.wait_ready_to_arm()
self.arm_vehicle()
if self.is_copter() or self.is_heli(): if self.is_copter() or self.is_heli():
self.user_takeoff(alt_min=50) self.user_takeoff(alt_min=50)

Loading…
Cancel
Save