From 335db007e91722e1dcf95d11cd65f3302e423216 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 9 Apr 2024 17:41:12 +1000 Subject: [PATCH] Blimp: remove far_from_EKF_origin sanity checks some flawed implementations, and the extreme-ardupilot project means these checks are no longer required --- Blimp/Blimp.h | 1 - Blimp/commands.cpp | 19 ------------------- 2 files changed, 20 deletions(-) diff --git a/Blimp/Blimp.h b/Blimp/Blimp.h index ccaa200a1c..086f17f44a 100644 --- a/Blimp/Blimp.h +++ b/Blimp/Blimp.h @@ -312,7 +312,6 @@ private: void set_home_to_current_location_inflight(); bool set_home_to_current_location(bool lock) override WARN_IF_UNUSED; bool set_home(const Location& loc, bool lock) override WARN_IF_UNUSED; - bool far_from_EKF_origin(const Location& loc); // ekf_check.cpp void ekf_check(); diff --git a/Blimp/commands.cpp b/Blimp/commands.cpp index 28942deb39..2185955e24 100644 --- a/Blimp/commands.cpp +++ b/Blimp/commands.cpp @@ -58,11 +58,6 @@ bool Blimp::set_home(const Location& loc, bool lock) return false; } - // check home is close to EKF origin - if (far_from_EKF_origin(loc)) { - return false; - } - // set ahrs home (used for RTL) if (!ahrs.set_home(loc)) { return false; @@ -76,17 +71,3 @@ bool Blimp::set_home(const Location& loc, bool lock) // return success return true; } - -// far_from_EKF_origin - checks if a location is too far from the EKF origin -// returns true if too far -bool Blimp::far_from_EKF_origin(const Location& loc) -{ - // check distance to EKF origin - Location ekf_origin; - if (ahrs.get_origin(ekf_origin) && ((ekf_origin.get_distance(loc) > EKF_ORIGIN_MAX_DIST_M) || (labs(ekf_origin.alt - loc.alt) > EKF_ORIGIN_MAX_DIST_M))) { - return true; - } - - // close enough to origin - return false; -}