ekf2: utils add getEulerYaw() that uses the best rotation sequence

This commit is contained in:
Daniel Agar
2022-02-02 08:54:03 -05:00
parent c3e0b93fc8
commit 88ffc177f7
9 changed files with 24 additions and 44 deletions
+1 -3
View File
@@ -192,9 +192,7 @@ bool Ekf::isYawFailure() const
return false;
}
const float euler_yaw = shouldUse321RotationSequence(_R_to_earth)
? getEuler321Yaw(_R_to_earth)
: getEuler312Yaw(_R_to_earth);
const float euler_yaw = getEulerYaw(_R_to_earth);
const float yaw_error = wrap_pi(euler_yaw - _yawEstimator.getYaw());
return fabsf(yaw_error) > math::radians(25.f);