Skip to content

Commit

Permalink
autotest: Added TKOFF_THR_MIN test
Browse files Browse the repository at this point in the history
  • Loading branch information
Georacer committed Aug 12, 2024
1 parent 989b574 commit 9cf0b18
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Tools/autotest/quadplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,29 @@ def mavlink_MAV_CMD_DO_VTOL_TRANSITION(self):

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')
Expand Down Expand Up @@ -1815,6 +1838,7 @@ def tests(self):
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,
Expand Down

0 comments on commit 9cf0b18

Please sign in to comment.