From 164096225b89db08337c9cc67bf253409d301a7b Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Thu, 3 Aug 2017 21:41:07 +0900 Subject: [PATCH] AP_SteerController: fix get_steering_out_rate bug when reversing --- libraries/APM_Control/AP_SteerController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/APM_Control/AP_SteerController.cpp b/libraries/APM_Control/AP_SteerController.cpp index efda79e4f9..d82ed41265 100644 --- a/libraries/APM_Control/AP_SteerController.cpp +++ b/libraries/APM_Control/AP_SteerController.cpp @@ -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;