From 29684aa54112938db09a9b5eab6c446c8aee04c5 Mon Sep 17 00:00:00 2001 From: Gone4Dirt Date: Tue, 3 Sep 2024 17:28:15 +0100 Subject: [PATCH] Autotest: helicopter: fixup --- Tools/autotest/helicopter.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Tools/autotest/helicopter.py b/Tools/autotest/helicopter.py index a42490434777c8..4ba57ea952b2a9 100644 --- a/Tools/autotest/helicopter.py +++ b/Tools/autotest/helicopter.py @@ -304,11 +304,11 @@ def SplineWaypoint(self, timeout=600): def AutoRotation(self, timeout=600): """Check engine-out behaviour""" + self.context_push() start_alt = 100 # metres self.set_parameters({ "AROT_ENABLE": 1, "H_RSC_AROT_ENBL": 1, - "PILOT_TKOFF_ALT": start_alt * 100, }) self.change_mode('POSHOLD') self.set_rc(3, 1000) @@ -346,7 +346,12 @@ def AutoRotation(self, timeout=600): speed = float(self.re_match.group(1)) if speed > 30: raise NotAchievedException("Hit too hard") + + # Set throttle low to trip auto disarm + self.set_rc(3, 1000) + self.wait_disarmed() + self.context_pop() def ManAutoRotation(self, timeout=600): """Check autorotation power recovery behaviour""" @@ -381,8 +386,6 @@ def TestAutoRotationConfig(self, arot_ramp_time, arot_idle): RUNUP_TIME = 15 AROT_RUNUP_TIME = arot_ramp_time + 4 RSC_SETPOINT = 66 - runup_time = self.get_parameter("H_RSC_RUNUP_TIME") - crit_rotor_speed_pct = self.get_parameter("H_RSC_CRITICAL")*0.01 start_alt = 100 # metres self.set_parameters({ "H_RSC_AROT_ENBL": 1, @@ -467,6 +470,7 @@ def TestAutoRotationConfig(self, arot_ramp_time, arot_idle): # We test the bailout behavior of two different configs # First we test config with a regular throttle curve self.progress("testing autorotation with throttle curve config") + self.context_push() ramp_time = 2.0 arot_idle = 0 TestAutoRotationConfig(self, ramp_time, arot_idle) @@ -476,6 +480,7 @@ def TestAutoRotationConfig(self, arot_ramp_time, arot_idle): ramp_time = 0.0 arot_idle = 20 TestAutoRotationConfig(self, ramp_time, arot_idle) + self.context_pop() def mission_item_home(self, target_system, target_component): '''returns a mission_item_int which can be used as home in a mission'''