autotest: Added back-transition throttle test

This commit is contained in:
George Zogopoulos 2024-10-04 19:26:17 +02:00 committed by Andrew Tridgell
parent 1a1edf92b7
commit ecf11f2208
1 changed files with 28 additions and 0 deletions

View File

@ -1644,6 +1644,33 @@ class AutoTestQuadPlane(vehicle_test_suite.TestSuite):
self.fly_home_land_and_disarm()
def BackTransitionMinThrottle(self):
'''Ensure min throttle is applied during back transition.'''
wps = self.create_simple_relhome_mission([
(mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 30),
(mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 2000, 0, 30),
(mavutil.mavlink.MAV_CMD_NAV_RETURN_TO_LAUNCH, 0, 0, 0),
])
self.check_mission_upload_download(wps)
self.set_parameter('Q_RTL_MODE', 1)
trim_pwm = 1000 + 10*self.get_parameter("TRIM_THROTTLE")
min_pwm = 1000 + 10*self.get_parameter("THR_MIN")
self.change_mode('AUTO')
self.wait_ready_to_arm()
self.arm_vehicle()
self.context_collect('STATUSTEXT')
self.wait_statustext("VTOL airbrake", check_context=True, timeout=300)
self.wait_servo_channel_value(3, trim_pwm, comparator=operator.le, timeout=1)
self.wait_statustext("VTOL position1", check_context=True, timeout=10)
self.wait_servo_channel_value(3, min_pwm+10, comparator=operator.le, timeout=1)
self.wait_disarmed(timeout=60)
def MAV_CMD_NAV_TAKEOFF(self):
'''test issuing takeoff command via mavlink'''
self.change_mode('GUIDED')
@ -2089,6 +2116,7 @@ class AutoTestQuadPlane(vehicle_test_suite.TestSuite):
self.mission_MAV_CMD_DO_VTOL_TRANSITION,
self.mavlink_MAV_CMD_DO_VTOL_TRANSITION,
self.TransitionMinThrottle,
self.BackTransitionMinThrottle,
self.MAV_CMD_NAV_TAKEOFF,
self.Q_GUIDED_MODE,
self.DCMClimbRate,