Tools: autotest: add two basic tests for radio failsafe

This commit is contained in:
Peter Barker 2019-09-26 12:25:27 +10:00 committed by Peter Barker
parent 2e2bbf57bf
commit a386048be7
1 changed files with 21 additions and 0 deletions

View File

@ -3550,6 +3550,23 @@ class AutoTestCopter(AutoTest):
self.wait_current_waypoint(0, timeout=10)
self.set_rc(7, 1000)
def test_radio_failsafe(self):
self.start_subtest("If you haven't taken off yet RC failure should be instant disarm")
self.change_mode("STABILIZE")
self.set_parameter("DISARM_DELAY", 0)
self.arm_vehicle()
self.set_parameter("SIM_RC_FAIL", 1)
self.disarm_wait(timeout=1)
self.set_parameter("SIM_RC_FAIL", 0)
self.set_parameter("DISARM_DELAY", 10)
self.start_subtest("Default behavour from loiter should be RTL")
self.takeoff(10, mode="LOITER")
self.set_parameter("SIM_RC_FAIL", 1)
self.wait_mode("RTL")
self.disarm_wait(timeout=100)
def tests(self):
'''return list of all tests'''
ret = super(AutoTestCopter, self).tests()
@ -3661,6 +3678,10 @@ class AutoTestCopter(AutoTest):
"Test Loiter Mode",
self.loiter),
("RadioFailsafe",
"Test radio failsafes",
self.test_radio_failsafe),
("SimpleMode",
"Fly in SIMPLE mode",
self.fly_simple),