mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-11-09 16:41:21 +08:00
AP_Math: added new rotation for PITCH_7
This commit is contained in:
1 parent
977fe09276
commit
e2eda63d2c
3 files changed
+11
No files matched your search
@@ -244,6 +244,15 @@ void Vector3<T>::rotate(enum Rotation rotation)
|
||||
x = tmp;
|
||||
return;
|
||||
}
|
||||
case ROTATION_PITCH_7: {
|
||||
const float sin_pitch = 0.12186934340514748f; // sinf(pitch);
|
||||
const float cos_pitch = 0.992546151641322f; // cosf(pitch);
|
||||
float tmpx = x;
|
||||
float tmpz = z;
|
||||
x = cos_pitch * tmpx + sin_pitch * tmpz;
|
||||
z = -sin_pitch * tmpx + cos_pitch * tmpz;
|
||||
return;
|
||||
}
|
||||
case ROTATION_CUSTOM: // no-op; caller should perform custom rotations via matrix multiplication
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user