AP_AHRS: change order of EK2/EK3 update

if EK3 is our primary estimator when we want to run the EK3 update
first, so it gets time priority for inter-EKF scheduling.
This commit is contained in:
Andrew Tridgell 2017-04-29 10:26:29 +10:00
parent 36a633bc7a
commit e78f55ef9b
1 changed files with 10 additions and 2 deletions

View File

@ -86,8 +86,16 @@ void AP_AHRS_NavEKF::update(bool skip_ins_update)
_ekf_type.set(2);
}
update_DCM(skip_ins_update);
if (_ekf_type == 2) {
// if EK2 is primary then run EKF2 first to give it CPU
// priority
update_EKF2();
update_EKF3();
} else {
// otherwise run EKF3 first
update_EKF3();
update_EKF2();
}
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
update_SITL();
#endif