autotest: Added TKOFF_THR_MIN test

This commit is contained in:
George Zogopoulos 2024-08-12 21:56:22 +02:00 committed by Andrew Tridgell
parent 3b247a346a
commit f7d40c0c73
1 changed files with 24 additions and 0 deletions

View File

@ -1556,6 +1556,29 @@ class AutoTestQuadPlane(vehicle_test_suite.TestSuite):
self.fly_home_land_and_disarm()
def TransitionMinThrottle(self):
'''Ensure that TKOFF_THR_MIN is applied during the forward 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('TKOFF_THR_MIN', 80)
self.change_mode('AUTO')
self.wait_ready_to_arm()
self.arm_vehicle()
self.wait_current_waypoint(2)
# Wait for 5 seconds into the transition.
self.delay_sim_time(5)
# Ensure TKOFF_THR_MIN is still respected.
thr_min = self.get_parameter('TKOFF_THR_MIN')
self.wait_servo_channel_value(3, 1000+thr_min*10, comparator=operator.eq)
self.fly_home_land_and_disarm()
def MAV_CMD_NAV_TAKEOFF(self):
'''test issuing takeoff command via mavlink'''
self.change_mode('GUIDED')
@ -1811,6 +1834,7 @@ class AutoTestQuadPlane(vehicle_test_suite.TestSuite):
self.RCDisableAirspeedUse,
self.mission_MAV_CMD_DO_VTOL_TRANSITION,
self.mavlink_MAV_CMD_DO_VTOL_TRANSITION,
self.TransitionMinThrottle,
self.MAV_CMD_NAV_TAKEOFF,
self.Q_GUIDED_MODE,
self.DCMClimbRate,