From f8ae8ba502cf222e049fd30e1c18af02d7c1ea72 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Wed, 13 Mar 2019 08:26:31 +1100 Subject: [PATCH] ekf2: Use ecl library with recent bug fixes and enhancements. Bug Fixes: https://github.com/PX4/ecl/pull/586 - EKF: fix covariance and output filter buffer initialization https://github.com/PX4/ecl/pull/590 - EKF: Fix innovation in fuseDeclination() Enhancements: https://github.com/PX4/ecl/pull/543 - ekf_helper: add more useful methods to interface with the covariances https://github.com/PX4/ecl/pull/588 - Add unit tests for DataValidator Note: https://github.com/PX4/ecl/pull/543 has required a change to how the state variances are accessed . --- src/lib/ecl | 2 +- src/modules/ekf2/ekf2_main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/ecl b/src/lib/ecl index a85d3a43ed..a892ececf8 160000 --- a/src/lib/ecl +++ b/src/lib/ecl @@ -1 +1 @@ -Subproject commit a85d3a43edc4ac4b85ae21159510b9c26f7359e6 +Subproject commit a892ececf8490b21aa8917bc243b2bc441af6a87 diff --git a/src/modules/ekf2/ekf2_main.cpp b/src/modules/ekf2/ekf2_main.cpp index 6b58853c04..7093f6a25a 100644 --- a/src/modules/ekf2/ekf2_main.cpp +++ b/src/modules/ekf2/ekf2_main.cpp @@ -1423,7 +1423,7 @@ void Ekf2::run() // Get covariances to vehicle odometry float covariances[24]; - _ekf.get_covariances(covariances); + _ekf.covariances_diagonal().copyTo(covariances); // get the covariance matrix size const size_t POS_URT_SIZE = sizeof(odom.pose_covariance) / sizeof(odom.pose_covariance[0]); @@ -1540,7 +1540,7 @@ void Ekf2::run() status.timestamp = now; _ekf.get_state_delayed(status.states); status.n_states = 24; - _ekf.get_covariances(status.covariances); + _ekf.covariances_diagonal().copyTo(status.covariances); _ekf.get_gps_check_status(&status.gps_check_fail_flags); // only report enabled GPS check failures (the param indexes are shifted by 1 bit, because they don't include // the GPS Fix bit, which is always checked)