From da3d3cc21beb4b34eda70de55c4c5e53f546514b Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 10 Dec 2019 20:33:22 +1100 Subject: [PATCH] AP_NavEKF: stop taking ahrs in constructor --- libraries/AP_NavEKF2/AP_NavEKF2.cpp | 4 ++-- libraries/AP_NavEKF2/AP_NavEKF2.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_NavEKF2/AP_NavEKF2.cpp b/libraries/AP_NavEKF2/AP_NavEKF2.cpp index 3417104cf6..919f788554 100644 --- a/libraries/AP_NavEKF2/AP_NavEKF2.cpp +++ b/libraries/AP_NavEKF2/AP_NavEKF2.cpp @@ -585,10 +585,10 @@ const AP_Param::GroupInfo NavEKF2::var_info[] = { AP_GROUPEND }; -NavEKF2::NavEKF2(const AP_AHRS *ahrs) : - _ahrs(ahrs) +NavEKF2::NavEKF2() { AP_Param::setup_object_defaults(this, var_info); + _ahrs = &AP::ahrs(); } /* diff --git a/libraries/AP_NavEKF2/AP_NavEKF2.h b/libraries/AP_NavEKF2/AP_NavEKF2.h index 23837b30c2..e15404753a 100644 --- a/libraries/AP_NavEKF2/AP_NavEKF2.h +++ b/libraries/AP_NavEKF2/AP_NavEKF2.h @@ -37,7 +37,7 @@ class NavEKF2 { friend class NavEKF2_core; public: - NavEKF2(const AP_AHRS *ahrs); + NavEKF2(); /* Do not allow copies */ NavEKF2(const NavEKF2 &other) = delete;