mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 09:08:30 -04:00
AP_NavEKF3: use use_EKFGSFYaw to reduce code duplication
This commit is contained in:
parent
a31ea88ff5
commit
6dfd2f2ff9
@ -1464,12 +1464,8 @@ bool NavEKF3_core::EKFGSF_resetMainFilterYaw()
|
||||
return false;
|
||||
};
|
||||
|
||||
float yawEKFGSF, yawVarianceEKFGSF, velInnovLength;
|
||||
if (yawEstimator->getYawData(yawEKFGSF, yawVarianceEKFGSF) &&
|
||||
is_positive(yawVarianceEKFGSF) &&
|
||||
yawVarianceEKFGSF < sq(radians(GSF_YAW_ACCURACY_THRESHOLD_DEG)) &&
|
||||
(assume_zero_sideslip() || (yawEstimator->getVelInnovLength(velInnovLength) && velInnovLength < frontend->maxYawEstVelInnov))) {
|
||||
|
||||
float yawEKFGSF, yawVarianceEKFGSF;
|
||||
if (EKFGSF_getYaw(yawEKFGSF, yawVarianceEKFGSF)) {
|
||||
// keep roll and pitch and reset yaw
|
||||
rotationOrder order;
|
||||
bestRotationOrder(order);
|
||||
|
Loading…
Reference in New Issue
Block a user