diff --git a/Tools/autotest/arduplane.py b/Tools/autotest/arduplane.py index 531a63a24f9d4f..5cf814b8c2dbf5 100644 --- a/Tools/autotest/arduplane.py +++ b/Tools/autotest/arduplane.py @@ -5312,6 +5312,37 @@ def SagetechMXS(self): home = self.home_position_as_mav_location() self.assert_distance(home, adsb_vehicle_loc, 0, 10000) + def MinThrottle(self): + '''Make sure min throttle does not apply in manual mode and does in FBWA''' + self.context_push() + + servo_min = self.get_parameter("RC3_MIN") + servo_max = self.get_parameter("RC3_MAX") + min_throttle = 10 + servo_min_throttle = servo_min + (servo_max - servo_min) * (min_throttle / 100) + + # Set min throttle + self.set_parameter('THR_MIN', min_throttle) + + # Should be 0 throttle while disarmed + self.change_mode("MANUAL") + self.assert_servo_channel_value(3, servo_min) + + # Arm and check throttle is still 0 in manual + self.wait_ready_to_arm() + self.arm_vehicle() + self.assert_servo_channel_value(3, servo_min) + + # FBWA should apply throttle min + self.change_mode("FBWA") + self.assert_servo_channel_value(3, servo_min_throttle) + + # But not when disarmed + self.disarm_vehicle() + self.assert_servo_channel_value(3, servo_min) + + self.context_pop() + def tests(self): '''return list of all tests''' ret = super(AutoTestPlane, self).tests() @@ -5419,6 +5450,7 @@ def tests(self): self.TerrainRally, self.MAV_CMD_NAV_LOITER_UNLIM, self.MAV_CMD_NAV_RETURN_TO_LAUNCH, + self.MinThrottle, ]) return ret