Browse Source

AP_AHRS : change initialisation requirements for EKF and use dynamic method

master
Paul Riseborough 11 years ago committed by priseborough
parent
commit
9f3c19c03a
  1. 6
      libraries/AP_AHRS/AP_AHRS_NavEKF.cpp
  2. 2
      libraries/AP_AHRS/AP_AHRS_NavEKF.h

6
libraries/AP_AHRS/AP_AHRS_NavEKF.cpp

@ -52,14 +52,14 @@ void AP_AHRS_NavEKF::update(void) @@ -52,14 +52,14 @@ void AP_AHRS_NavEKF::update(void)
_dcm_attitude(roll, pitch, yaw);
if (!ekf_started) {
// if we have a compass set we can start the EKF
if (get_compass()) {
// if we have a compass set and GPS lock we can start the EKF
if (get_compass() && get_gps()->status() >= GPS::GPS_OK_FIX_3D) {
if (start_time_ms == 0) {
start_time_ms = hal.scheduler->millis();
}
if (hal.scheduler->millis() - start_time_ms > startup_delay_ms) {
ekf_started = true;
EKF.InitialiseFilterBootstrap();
EKF.InitialiseFilterDynamic();
}
}
}

2
libraries/AP_AHRS/AP_AHRS_NavEKF.h

@ -38,7 +38,7 @@ public: @@ -38,7 +38,7 @@ public:
EKF(this, baro),
_baro(baro),
ekf_started(false),
startup_delay_ms(5000)
startup_delay_ms(10000)
{
}

Loading…
Cancel
Save