Skip to content

Commit

Permalink
Autotest: helicopter: fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKear committed Sep 3, 2024
1 parent ec61b4c commit 29684aa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Tools/autotest/helicopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"""
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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'''
Expand Down

0 comments on commit 29684aa

Please sign in to comment.