From a386048be7b52910b60d6842d1b78416767946cd Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 26 Sep 2019 12:25:27 +1000 Subject: [PATCH] Tools: autotest: add two basic tests for radio failsafe --- Tools/autotest/arducopter.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index f9581b84b3..a579c99d8e 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -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),