From f88ca4b7e4ec3fdb7bd6eab9b917e05ff8e6aab2 Mon Sep 17 00:00:00 2001 From: rmackay9 Date: Sun, 7 Oct 2012 19:14:40 +0900 Subject: [PATCH] ArduCopter: bug fix in earth-frame to body-frame conversion for roll --- ArduCopter/Attitude.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArduCopter/Attitude.pde b/ArduCopter/Attitude.pde index ccee828fe9..6908523b48 100644 --- a/ArduCopter/Attitude.pde +++ b/ArduCopter/Attitude.pde @@ -224,7 +224,7 @@ get_acro_yaw(int32_t target_rate) update_rate_contoller_targets() { // convert earth frame rates to body frame rates - roll_rate_target_bf = roll_rate_target_ef + sin_pitch * yaw_rate_target_ef; + roll_rate_target_bf = roll_rate_target_ef - sin_pitch * yaw_rate_target_ef; pitch_rate_target_bf = cos_roll_x * pitch_rate_target_ef + sin_roll * yaw_rate_target_ef; yaw_rate_target_bf = cos_pitch_x * cos_roll_x * yaw_rate_target_ef + sin_roll * pitch_rate_target_ef; }