From b30563e10b211ea78ae441e0614e4bed4d908ce4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 22 Feb 2024 15:54:49 +1100 Subject: [PATCH] AP_GPS: correct check of reported antenna distance vs stated offset --- libraries/AP_GPS/GPS_Backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_GPS/GPS_Backend.cpp b/libraries/AP_GPS/GPS_Backend.cpp index f6d08fc761..451789fe40 100644 --- a/libraries/AP_GPS/GPS_Backend.cpp +++ b/libraries/AP_GPS/GPS_Backend.cpp @@ -367,7 +367,7 @@ bool AP_GPS_Backend::calculate_moving_base_yaw(AP_GPS::GPS_State &interim_state, } - if ((offset_dist - reported_distance) > (min_dist * permitted_error_length_pct)) { + if (fabsf(offset_dist - reported_distance) > (min_dist * permitted_error_length_pct)) { // the magnitude of the vector is much further then we were expecting Debug("Exceeded the permitted error margin %f > %f", (double)(offset_dist - reported_distance), (double)(min_dist * permitted_error_length_pct));