From 961aab742591443653ad227a39ce8afb03e8812a Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Sat, 4 Aug 2018 16:07:59 +0900 Subject: [PATCH] Rover: balance bot passes motor limits to pitch control --- APMrover2/balance_bot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APMrover2/balance_bot.cpp b/APMrover2/balance_bot.cpp index 9efb23da19..87747f6a45 100644 --- a/APMrover2/balance_bot.cpp +++ b/APMrover2/balance_bot.cpp @@ -8,7 +8,7 @@ void Rover::balancebot_pitch_control(float &throttle, bool armed) const float demanded_pitch = radians(-throttle * 0.01f * g2.bal_pitch_max); // calculate required throttle using PID controller - const float balance_throttle = g2.attitude_control.get_throttle_out_from_pitch(demanded_pitch, armed, G_Dt) * 100.0f; + const float balance_throttle = g2.attitude_control.get_throttle_out_from_pitch(demanded_pitch, g2.motors.limit.throttle_lower, g2.motors.limit.throttle_upper, G_Dt) * 100.0f; // constrain throttle between -100 and 100 throttle = constrain_float(balance_throttle, -100.0f, 100.0f);