From 1c98e2063c1786e8ea3ae8221889e8d7fea98bab Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Thu, 25 Jan 2024 14:02:39 -0300 Subject: [PATCH] AP_Compass: allow learning with origin only --- libraries/AP_Compass/Compass_learn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Compass/Compass_learn.cpp b/libraries/AP_Compass/Compass_learn.cpp index e93cafdadc..1e8d0cc854 100644 --- a/libraries/AP_Compass/Compass_learn.cpp +++ b/libraries/AP_Compass/Compass_learn.cpp @@ -49,7 +49,7 @@ void CompassLearn::update(void) const AP_AHRS &ahrs = AP::ahrs(); if (!have_earth_field) { Location loc; - if (!ahrs.get_position(loc)) { + if (!ahrs.get_position(loc) && !ahrs.get_origin(loc)) { // need to wait till we have a global position return; }