From 3c8aa955d533a9a132dff88c0d8af7877c7f2c22 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Wed, 29 Jan 2020 10:57:29 +0900 Subject: [PATCH] AC_AttitudeControlSub: fix update_althold_lean_angle_max use of throttle_in --- libraries/AC_AttitudeControl/AC_AttitudeControl_Sub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AC_AttitudeControl/AC_AttitudeControl_Sub.cpp b/libraries/AC_AttitudeControl/AC_AttitudeControl_Sub.cpp index f08d5e5061..d5713b7571 100644 --- a/libraries/AC_AttitudeControl/AC_AttitudeControl_Sub.cpp +++ b/libraries/AC_AttitudeControl/AC_AttitudeControl_Sub.cpp @@ -267,7 +267,7 @@ void AC_AttitudeControl_Sub::update_althold_lean_angle_max(float throttle_in) return; } - float althold_lean_angle_max = acosf(constrain_float(_throttle_in/(AC_ATTITUDE_CONTROL_ANGLE_LIMIT_THROTTLE_MAX * thr_max), 0.0f, 1.0f)); + float althold_lean_angle_max = acosf(constrain_float(throttle_in/(AC_ATTITUDE_CONTROL_ANGLE_LIMIT_THROTTLE_MAX * thr_max), 0.0f, 1.0f)); _althold_lean_angle_max = _althold_lean_angle_max + (_dt/(_dt+_angle_limit_tc))*(althold_lean_angle_max-_althold_lean_angle_max); }