From b9a3712ccba9d64b2ee960b2d735779183c1b1fe Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Wed, 18 May 2016 19:23:44 +1000 Subject: [PATCH] EKF: record yaw alignment event during initialisation to allow heading fusion to start early This ensures bad yaw gyro biases are compensated for early, rather than waiting for the tilt alignment to fully converge before fusing heading. --- EKF/ekf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/ekf.cpp b/EKF/ekf.cpp index 68d709483f..e928f72240 100644 --- a/EKF/ekf.cpp +++ b/EKF/ekf.cpp @@ -511,7 +511,7 @@ bool Ekf::initialiseFilter(void) Vector3f mag_init = _mag_filt_state; // calculate the initial magnetic field and yaw alignment - resetMagHeading(mag_init); + _control_status.flags.yaw_align = resetMagHeading(mag_init); // if we are using the range finder as the primary source, then calculate the baro height at origin so we can use baro as a backup // so it can be used as a backup ad set the initial height using the range finder