AP_AHRS: take secondary attitude from EKF3 if it is configured

This commit is contained in:
Peter Barker 2020-11-05 08:59:37 +11:00 committed by Andrew Tridgell
parent 0f234583d6
commit 814aa4e5ec

View File

@ -608,13 +608,20 @@ bool AP_AHRS_NavEKF::get_secondary_attitude(Vector3f &eulers) const
switch (active_EKF_type()) {
case EKFType::NONE:
// EKF is secondary
#if HAL_NAVEKF2_AVAILABLE
EKF2.getEulerAngles(-1, eulers);
return _ekf2_started;
#else
return false;
switch ((EKFType)_ekf_type.get()) {
#if HAL_NAVEKF3_AVAILABLE
case EKFType::THREE:
EKF3.getEulerAngles(-1, eulers);
return _ekf3_started;
#endif
#if HAL_NAVEKF2_AVAILABLE
case EKFType::TWO:
EKF2.getEulerAngles(-1, eulers);
return _ekf2_started;
#endif
default:
return false;
}
#if HAL_NAVEKF2_AVAILABLE
case EKFType::TWO:
#endif