From 3444de06b15a0a9a93d5201a3f85ad98a58ab80d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Aug 2024 07:33:04 +1000 Subject: [PATCH] AP_NavEKF2: allow setOrigin when using GPS this allows for use of a common origin between backends, and aligns with EKF3 behaviour --- libraries/AP_NavEKF2/AP_NavEKF2.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/AP_NavEKF2/AP_NavEKF2.cpp b/libraries/AP_NavEKF2/AP_NavEKF2.cpp index dfd2aa7b6d..2e89cebcfd 100644 --- a/libraries/AP_NavEKF2/AP_NavEKF2.cpp +++ b/libraries/AP_NavEKF2/AP_NavEKF2.cpp @@ -1113,11 +1113,9 @@ bool NavEKF2::setOriginLLH(const Location &loc) if (!core) { return false; } - if (_fusionModeGPS != 3 || common_origin_valid) { - // we don't allow setting of the EKF origin if using GPS - // or if the EKF origin has already been set. - // This is to prevent accidental setting of EKF origin with an - // invalid position or height or causing upsets from a shifting origin. + if (common_origin_valid) { + // we don't allow setting of the EKF origin if the EKF origin + // has already been set. GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "EKF2 refusing set origin"); return false; }