mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 13:07:34 +08:00
quaternion from dcm: comment and reference
This commit is contained in:
@@ -135,6 +135,10 @@ public:
|
||||
data[3] = static_cast<float>(cosPhi_2 * cosTheta_2 * sinPsi_2 - sinPhi_2 * sinTheta_2 * cosPsi_2);
|
||||
}
|
||||
|
||||
/**
|
||||
* set quaternion to rotation by DCM
|
||||
* Reference: Shoemake, Quaternions, http://www.cs.ucr.edu/~vbz/resources/quatut.pdf
|
||||
*/
|
||||
void from_dcm(const Matrix<3, 3> &dcm) {
|
||||
float tr = dcm.data[0][0] + dcm.data[1][1] + dcm.data[2][2];
|
||||
if (tr > 0.0f) {
|
||||
|
||||
Reference in New Issue
Block a user