AP_NavEKF2: allow setOrigin when using GPS

this allows for use of a common origin between backends, and aligns
with EKF3 behaviour
This commit is contained in:
Andrew Tridgell 2024-08-16 07:33:04 +10:00
parent 777aab6e0c
commit 3444de06b1

View File

@ -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;
}