From 79975b130959eb014765846ac6dfa97b53813b45 Mon Sep 17 00:00:00 2001 From: Jonathan Challinger <mr.challinger@gmail.com> Date: Wed, 31 Dec 2014 15:20:18 -0800 Subject: [PATCH] AP_Math: change ROTATION_YAW_293_PITCH_68_ROLL_180 to ROLL_90 --- libraries/AP_Math/examples/rotations/rotations.pde | 2 +- libraries/AP_Math/rotations.h | 2 +- libraries/AP_Math/vector3.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/AP_Math/examples/rotations/rotations.pde b/libraries/AP_Math/examples/rotations/rotations.pde index 2327bd9a5..9473c815b 100644 --- a/libraries/AP_Math/examples/rotations/rotations.pde +++ b/libraries/AP_Math/examples/rotations/rotations.pde @@ -147,7 +147,7 @@ static void test_eulers(void) test_euler(ROTATION_ROLL_270_PITCH_270,270,270, 0); test_euler(ROTATION_ROLL_90_PITCH_180_YAW_90, 90, 180, 90); test_euler(ROTATION_ROLL_90_YAW_270, 90, 0, 270); - test_euler(ROTATION_YAW_293_PITCH_68_ROLL_180,180,68.8,293.3); + test_euler(ROTATION_YAW_293_PITCH_68_ROLL_90,90,68.8,293.3); } static bool have_rotation(const Matrix3f &m) diff --git a/libraries/AP_Math/rotations.h b/libraries/AP_Math/rotations.h index 226b9d141..404f31dc5 100644 --- a/libraries/AP_Math/rotations.h +++ b/libraries/AP_Math/rotations.h @@ -64,7 +64,7 @@ enum Rotation { ROTATION_ROLL_270_PITCH_270 = 35, ROTATION_ROLL_90_PITCH_180_YAW_90 = 36, ROTATION_ROLL_90_YAW_270 = 37, - ROTATION_YAW_293_PITCH_68_ROLL_180 = 38, + ROTATION_YAW_293_PITCH_68_ROLL_90 = 38, ROTATION_MAX }; /* diff --git a/libraries/AP_Math/vector3.cpp b/libraries/AP_Math/vector3.cpp index 8ec1634b0..ae5399df3 100644 --- a/libraries/AP_Math/vector3.cpp +++ b/libraries/AP_Math/vector3.cpp @@ -221,13 +221,13 @@ void Vector3<T>::rotate(enum Rotation rotation) tmp = x; x = y; y = -tmp; return; } - case ROTATION_YAW_293_PITCH_68_ROLL_180: { + case ROTATION_YAW_293_PITCH_68_ROLL_90: { float tmpx = x; float tmpy = y; float tmpz = z; - x = 0.1430389f * tmpx -0.9184465f * tmpy -0.3687762f * tmpz; - y = -0.3321327f * tmpx -0.3955452f * tmpy +0.8562895f * tmpz; - z = -0.9323238f * tmpx -0.00000003f * tmpy -0.3616245f * tmpz; + x = 0.143039f * tmpx + 0.368776f * tmpy + -0.918446f * tmpz; + y = -0.332133f * tmpx + -0.856289f * tmpy + -0.395546f * tmpz; + z = -0.932324f * tmpx + 0.361625f * tmpy + 0.000000f * tmpz; return; } } -- GitLab