From bc90ba54868e90da90e895e249db180a256e98af Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Wed, 19 May 2021 11:26:49 +0100 Subject: [PATCH] AR_AttitudeControl: get_steering_out_rate use abs speed for G limit --- libraries/APM_Control/AR_AttitudeControl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/APM_Control/AR_AttitudeControl.cpp b/libraries/APM_Control/AR_AttitudeControl.cpp index 3b62baf92a..16e8416a74 100644 --- a/libraries/APM_Control/AR_AttitudeControl.cpp +++ b/libraries/APM_Control/AR_AttitudeControl.cpp @@ -498,7 +498,7 @@ float AR_AttitudeControl::get_steering_out_rate(float desired_rate, bool motor_l float speed; if (get_forward_speed(speed)) { // do not limit to less than 1 deg/s - const float turn_rate_max = MAX(get_turn_rate_from_lat_accel(get_turn_lat_accel_max(), speed), radians(1.0f)); + const float turn_rate_max = MAX(get_turn_rate_from_lat_accel(get_turn_lat_accel_max(), fabsf(speed)), radians(1.0f)); _desired_turn_rate = constrain_float(_desired_turn_rate, -turn_rate_max, turn_rate_max); }