diff --git a/libraries/AC_AttitudeControl/AC_AttitudeControl.cpp b/libraries/AC_AttitudeControl/AC_AttitudeControl.cpp index 89c45a5bb0..c7d04fd24e 100644 --- a/libraries/AC_AttitudeControl/AC_AttitudeControl.cpp +++ b/libraries/AC_AttitudeControl/AC_AttitudeControl.cpp @@ -57,6 +57,13 @@ const AP_Param::GroupInfo AC_AttitudeControl::var_info[] PROGMEM = { // @User: Advanced AP_GROUPINFO("ACCEL_P_MAX", 7, AC_AttitudeControl, _accel_pitch_max, AC_ATTITUDE_CONTROL_ACCEL_RP_MAX_DEFAULT), + // @Param: ANGLE_BOOST + // @DisplayName: Angle Boost + // @Description: Angle Boost increases output throttle as the vehicle leans to reduce loss of altitude + // @Values: 0:Disabled, 1:Enabled + // @User: Advanced + AP_GROUPINFO("ANGLE_BOOST", 12, AC_AttitudeControl, _angle_boost_enabled, 1), + AP_GROUPEND }; diff --git a/libraries/AC_AttitudeControl/AC_AttitudeControl.h b/libraries/AC_AttitudeControl/AC_AttitudeControl.h index c227a63244..bae0ff093b 100644 --- a/libraries/AC_AttitudeControl/AC_AttitudeControl.h +++ b/libraries/AC_AttitudeControl/AC_AttitudeControl.h @@ -286,6 +286,7 @@ protected: AP_Float _accel_pitch_max; // maximum rotation acceleration for earth-frame pitch axis AP_Float _accel_yaw_max; // maximum rotation acceleration for earth-frame yaw axis AP_Int8 _rate_bf_ff_enabled; // Enable/Disable body frame rate feed forward + AP_Int8 _angle_boost_enabled; // Enable/Disable angle boost // internal variables // To-Do: make rate targets a typedef instead of Vector3f? diff --git a/libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp b/libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp index 223daa9cac..a7f23210c9 100644 --- a/libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp +++ b/libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp @@ -8,6 +8,10 @@ // throttle value should be 0 ~ 1000 float AC_AttitudeControl_Multi::get_boosted_throttle(float throttle_in) { + if (!_angle_boost_enabled) { + return throttle_in; + _angle_boost = 0; + } // inverted_factor is 1 for tilt angles below 60 degrees // reduces as a function of angle beyond 60 degrees // becomes zero at 90 degrees