From 7677a162aaad97b1bed19592a887daf210ada15d Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Sun, 13 Mar 2016 20:35:51 +1100 Subject: [PATCH] EKF: Don't start the output observer before the main filter has initialised This prevents the possibility of output transients if alignment is delayed. --- EKF/ekf.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/EKF/ekf.cpp b/EKF/ekf.cpp index 62f4e1cbbc..12a1ffd177 100644 --- a/EKF/ekf.cpp +++ b/EKF/ekf.cpp @@ -160,8 +160,6 @@ bool Ekf::init(uint64_t timestamp) bool Ekf::update() { - // Only run the filter if IMU data in the buffer has been updated - if (_imu_updated) { if (!_filter_initialised) { _filter_initialised = initialiseFilter(); @@ -170,6 +168,9 @@ bool Ekf::update() } } + // Only run the filter if IMU data in the buffer has been updated + if (_imu_updated) { + // perform state and covariance prediction for the main filter predictState(); predictCovariance();