From 39f16c4679c373b965ce2b92d70de026bc6f0e49 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 23 Jul 2020 20:37:12 +1000 Subject: [PATCH] autotest: reboot SITL after running autotune switch test --- Tools/autotest/arducopter.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index a47e402356..d733921a7e 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -1716,6 +1716,24 @@ class AutoTestCopter(AutoTest): def fly_autotune_switch(self): """Test autotune on a switch with gains being saved""" + self.context_push() + + ex = None + + try: + self.fly_autotune_switch_body() + except Exception as e: + self.progress("Exception caught: %s" % ( + self.get_exception_stacktrace(e))) + ex = e + + self.context_pop() + self.reboot_sitl() + + if ex is not None: + raise ex + + def fly_autotune_switch_body(self): self.set_parameter("RC8_OPTION", 17) self.set_parameter("ATC_RAT_RLL_FLTT", 20) rlld = self.get_parameter("ATC_RAT_RLL_D")