From ecf11f2208412d7660630e1c24e9bb6972e015af Mon Sep 17 00:00:00 2001 From: George Zogopoulos Date: Fri, 4 Oct 2024 19:26:17 +0200 Subject: [PATCH] autotest: Added back-transition throttle test --- Tools/autotest/quadplane.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Tools/autotest/quadplane.py b/Tools/autotest/quadplane.py index 5458bc30a4..0e6ef03d3f 100644 --- a/Tools/autotest/quadplane.py +++ b/Tools/autotest/quadplane.py @@ -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,