From 2919491298a3bf0bd7a96cdad08615b90096e31c Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Fri, 24 Apr 2020 15:02:19 +0900 Subject: [PATCH] AP_NavEKF2: getLLH fix when no GPS available --- libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp b/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp index 32dabcc2f7..bd5ce7ce86 100644 --- a/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp +++ b/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp @@ -349,6 +349,8 @@ bool NavEKF2_core::getLLH(struct Location &loc) const } else { // if no GPS fix, provide last known position before entering the mode // correct for IMU offset (EKF calculations are at the IMU position) + loc.lat = EKF_origin.lat; + loc.lng = EKF_origin.lng; loc.offset((lastKnownPositionNE.x + posOffsetNED.x), (lastKnownPositionNE.y + posOffsetNED.y)); return false; }