AP_SteerController: fix get_steering_out_rate bug when reversing

This commit is contained in:
Randy Mackay 2017-08-03 21:41:07 +09:00
parent 30852d4713
commit 164096225b

View File

@ -145,7 +145,7 @@ int32_t AP_SteerController::get_steering_out_rate(float desired_rate)
// We do this in earth frame to allow for rover leaning over in hard corners
float yaw_rate_earth = ToDeg(_ahrs.get_yaw_rate_earth());
if (_reverse) {
yaw_rate_earth = wrap_180(180 + yaw_rate_earth);
yaw_rate_earth *= -1.0f;
}
float rate_error = (desired_rate - yaw_rate_earth) * scaler;