From 6f29bbafb403f1d6ee5980fdc56c785a24e79e59 Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Thu, 21 Jan 2016 15:08:56 +0900 Subject: [PATCH] AC_AttControl_Multi: get_althold_lean_angle_max uses motor thrust in 0 to 1 range --- libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp b/libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp index 3b17390b2e..78cbeca43f 100644 --- a/libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp +++ b/libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp @@ -8,14 +8,14 @@ float AC_AttitudeControl_Multi::get_althold_lean_angle_max() const { // calc maximum tilt angle based on throttle - float thr_max = _motors_multi.throttle_max(); + float thr_max = _motors_multi.get_throttle_thrust_max(); // divide by zero check if (is_zero(thr_max)) { return 0.0f; } - return ToDeg(acos(constrain_float(_throttle_in_filt.get()/(0.9f * thr_max / 1000.0f), 0.0f, 1000.0f) / 1000.0f)) * 100.0f; + return ToDeg(acos(constrain_float(_throttle_in_filt.get()/(0.9f * thr_max), 0.0f, 1.0f))) * 100.0f; } // returns a throttle including compensation for roll/pitch angle