diff --git a/src/modules/ekf2/EKF/EKFGSF_yaw.cpp b/src/modules/ekf2/EKF/EKFGSF_yaw.cpp index e4467a225f..da0ae57704 100644 --- a/src/modules/ekf2/EKF/EKFGSF_yaw.cpp +++ b/src/modules/ekf2/EKF/EKFGSF_yaw.cpp @@ -23,7 +23,6 @@ void EKFGSF_yaw::update(const imuSample &imu_sample, _delta_vel = imu_sample.delta_vel; _delta_ang_dt = imu_sample.delta_ang_dt; _delta_vel_dt = imu_sample.delta_vel_dt; - _run_ekf_gsf = run_EKF; _true_airspeed = airspeed; // to reduce effect of vibration, filter using an LPF whose time constant is 1/10 of the AHRS tilt correction time constant @@ -60,7 +59,7 @@ void EKFGSF_yaw::update(const imuSample &imu_sample, } // The 3-state EKF models only run when flying to avoid corrupted estimates due to operator handling and GPS interference - if (_run_ekf_gsf && _vel_data_updated) { + if (run_EKF && _vel_data_updated) { if (!_ekf_gsf_vel_fuse_started) { initialiseEKFGSF(); ahrsAlignYaw(); @@ -111,7 +110,7 @@ void EKFGSF_yaw::update(const imuSample &imu_sample, } } - } else if (_ekf_gsf_vel_fuse_started && !_run_ekf_gsf) { + } else if (_ekf_gsf_vel_fuse_started && !run_EKF) { // wait to fly again _ekf_gsf_vel_fuse_started = false; } diff --git a/src/modules/ekf2/EKF/EKFGSF_yaw.h b/src/modules/ekf2/EKF/EKFGSF_yaw.h index 55dc4f8cca..58603cbae9 100644 --- a/src/modules/ekf2/EKF/EKFGSF_yaw.h +++ b/src/modules/ekf2/EKF/EKFGSF_yaw.h @@ -108,7 +108,6 @@ private: } _ekf_gsf[N_MODELS_EKFGSF] {}; bool _vel_data_updated{}; // true when velocity data has been updated - bool _run_ekf_gsf{}; // true when operating condition is suitable for to run the GSF and EKF models and fuse velocity data Vector2f _vel_NE{}; // NE velocity observations (m/s) float _vel_accuracy{}; // 1-sigma accuracy of velocity observations (m/s) bool _ekf_gsf_vel_fuse_started{}; // true when the EKF's have started fusing velocity data and the prediction and update processing is active