rotations: sync rotation enum, SENS_BOARD_ROT, CAL_MAGx_ROT with MAV_SENSOR_ORIENTATION

This commit is contained in:
Daniel Agar
2020-09-21 17:38:56 -04:00
parent 8b26b84fd1
commit 00e955cc3e
9 changed files with 25 additions and 89 deletions
+2 -25
View File
@@ -245,23 +245,6 @@ rotate_3f(enum Rotation rot, float &x, float &y, float &z)
return;
}
case ROTATION_PITCH_9_YAW_180: {
const float tmpx = x;
const float tmpy = y;
const float tmpz = z;
x = -0.987688f * tmpx + 0.000000f * tmpy + -0.156434f * tmpz;
y = 0.000000f * tmpx + -1.000000f * tmpy + 0.000000f * tmpz;
z = -0.156434f * tmpx + 0.000000f * tmpy + 0.987688f * tmpz;
return;
}
case ROTATION_PITCH_45: {
tmp = M_SQRT1_2_F * x + M_SQRT1_2_F * z;
z = M_SQRT1_2_F * z - M_SQRT1_2_F * x;
x = tmp;
return;
}
case ROTATION_PITCH_315: {
tmp = M_SQRT1_2_F * x - M_SQRT1_2_F * z;
z = M_SQRT1_2_F * z + M_SQRT1_2_F * x;
@@ -285,10 +268,7 @@ rotate_3f(enum Rotation rot, float &x, float &y, float &z)
return;
}
case ROTATION_ROLL_180_PITCH_90:
// FALLTHROUGH
case ROTATION_PITCH_90_YAW_180: {
case ROTATION_ROLL_180_PITCH_90: {
tmp = x;
x = -z;
y = -y;
@@ -339,10 +319,7 @@ rotate_3f(enum Rotation rot, float &x, float &y, float &z)
return;
}
case ROTATION_ROLL_90_PITCH_180_YAW_90:
// FALLTHROUGH
case ROTATION_ROLL_270_YAW_270: {
case ROTATION_ROLL_90_PITCH_180_YAW_90: {
tmp = x;
x = z;
z = -y;