AR_AttitudeControl: get_steering_out_rate use abs speed for G limit

This commit is contained in:
Iampete1 2021-05-19 11:26:49 +01:00 committed by Peter Hall
parent f2c03a66b6
commit bc90ba5486
1 changed files with 1 additions and 1 deletions

View File

@ -498,7 +498,7 @@ float AR_AttitudeControl::get_steering_out_rate(float desired_rate, bool motor_l
float speed; float speed;
if (get_forward_speed(speed)) { if (get_forward_speed(speed)) {
// do not limit to less than 1 deg/s // 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); _desired_turn_rate = constrain_float(_desired_turn_rate, -turn_rate_max, turn_rate_max);
} }