diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index 3a8cdf75ce..005f7a2aa1 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -700,7 +700,6 @@ private: void set_home_to_current_location_inflight(); bool set_home_to_current_location(bool lock); bool set_home(const Location& loc, bool lock); - void set_ekf_origin(const Location& loc); bool far_from_EKF_origin(const Location& loc); void set_system_time_from_GPS(); diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index 5788f825f1..1e4a3186bb 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -1803,9 +1803,3 @@ const AP_FWVersion &GCS_MAVLINK_Copter::get_fwver() const { return copter.fwver; } - - -void GCS_MAVLINK_Copter::set_ekf_origin(const Location& loc) -{ - copter.set_ekf_origin(loc); -} diff --git a/ArduCopter/GCS_Mavlink.h b/ArduCopter/GCS_Mavlink.h index cd0ae72701..de8519b8c8 100644 --- a/ArduCopter/GCS_Mavlink.h +++ b/ArduCopter/GCS_Mavlink.h @@ -24,7 +24,6 @@ protected: AP_AdvancedFailsafe *get_advanced_failsafe() const override; AP_VisualOdom *get_visual_odom() const override; const AP_FWVersion &get_fwver() const override; - void set_ekf_origin(const Location& loc) override; uint8_t sysid_my_gcs() const override; diff --git a/ArduCopter/commands.cpp b/ArduCopter/commands.cpp index 56e95c1fde..e8d65459c8 100644 --- a/ArduCopter/commands.cpp +++ b/ArduCopter/commands.cpp @@ -110,32 +110,6 @@ bool Copter::set_home(const Location& loc, bool lock) return true; } -// sets ekf_origin if it has not been set. -// should only be used when there is no GPS to provide an absolute position -void Copter::set_ekf_origin(const Location& loc) -{ - // check location is valid - if (!check_latlng(loc)) { - return; - } - - // check EKF origin has already been set - Location ekf_origin; - if (ahrs.get_origin(ekf_origin)) { - return; - } - - if (!ahrs.set_origin(loc)) { - return; - } - - // log ahrs home and ekf origin dataflash - ahrs.Log_Write_Home_And_Origin(); - - // send ekf origin to GCS - gcs().send_ekf_origin(loc); -} - // far_from_EKF_origin - checks if a location is too far from the EKF origin // returns true if too far bool Copter::far_from_EKF_origin(const Location& loc)