From eac9c78d046136f19d88ddfa5e847c3f23648cb2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Aug 2024 14:40:10 +1000 Subject: [PATCH] AP_NavEKF2: fixed return of common origin when common origin is set we should return that, not backends private origin --- libraries/AP_NavEKF2/AP_NavEKF2.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_NavEKF2/AP_NavEKF2.cpp b/libraries/AP_NavEKF2/AP_NavEKF2.cpp index dbbac13a957a90..4f8006ccac945f 100644 --- a/libraries/AP_NavEKF2/AP_NavEKF2.cpp +++ b/libraries/AP_NavEKF2/AP_NavEKF2.cpp @@ -1089,6 +1089,10 @@ bool NavEKF2::getOriginLLH(Location &loc) const if (!core) { return false; } + if (common_origin_valid) { + loc = common_EKF_origin; + return true; + } return core[primary].getOriginLLH(loc); }