AP_AHRS: fixed a bug with startup ordering of SITL

this fixes a crash that can happen with SITL
This commit is contained in:
Andrew Tridgell 2017-12-13 12:27:55 +11:00
parent a5b7de2577
commit 7a6ab4ac44

View File

@ -85,6 +85,11 @@ void AP_AHRS_NavEKF::update(bool skip_ins_update)
if (_ekf_type == 1) {
_ekf_type.set(2);
}
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
update_SITL();
#endif
update_DCM(skip_ins_update);
if (_ekf_type == 2) {
// if EK2 is primary then run EKF2 first to give it CPU
@ -96,9 +101,6 @@ void AP_AHRS_NavEKF::update(bool skip_ins_update)
update_EKF3();
update_EKF2();
}
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
update_SITL();
#endif
// call AHRS_update hook if any
AP_Module::call_hook_AHRS_update(*this);