mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 07:43:37 +08:00
shouldUse321RotationSequence(const Dcmf& R)
This commit is contained in:
committed by
Paul Riseborough
parent
4872f2a545
commit
15afa8ae17
+2
-2
@@ -486,7 +486,7 @@ bool Ekf::resetMagHeading(const Vector3f &mag_init, bool increase_yaw_var, bool
|
||||
} else if (_params.mag_fusion_type <= MAG_FUSE_TYPE_3D) {
|
||||
// rotate the magnetometer measurements into earth frame using a zero yaw angle
|
||||
Dcmf R_to_earth;
|
||||
if (fabsf(_R_to_earth(2, 0)) < fabsf(_R_to_earth(2, 1))) {
|
||||
if (shouldUse321RotationSequence(_R_to_earth)) {
|
||||
// rolled more than pitched so use 321 rotation order
|
||||
Eulerf euler321(_state.quat_nominal);
|
||||
euler321(2) = 0.0f;
|
||||
@@ -1658,7 +1658,7 @@ void Ekf::resetQuatStateYaw(float yaw, float yaw_variance, bool update_buffer)
|
||||
|
||||
// update the rotation matrix using the new yaw value
|
||||
// determine if a 321 or 312 Euler sequence is best
|
||||
if (fabsf(_R_to_earth(2, 0)) < fabsf(_R_to_earth(2, 1))) {
|
||||
if (shouldUse321RotationSequence(_R_to_earth)) {
|
||||
// use a 321 sequence
|
||||
Eulerf euler321(_R_to_earth);
|
||||
euler321(2) = yaw;
|
||||
|
||||
Reference in New Issue
Block a user