AP_Math: change ROTATION_YAW_293_PITCH_68_ROLL_180 to ROLL_90

This commit is contained in:
Jonathan Challinger 2014-12-31 15:20:18 -08:00 committed by Randy Mackay
parent ef55a3c6a6
commit 9e5a30d5ba
3 changed files with 6 additions and 6 deletions

View File

@ -148,7 +148,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)

View File

@ -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
};
/*

View File

@ -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;
}
}