diff --git a/libraries/AP_AHRS/AP_AHRS.h b/libraries/AP_AHRS/AP_AHRS.h index e70b6623d2..34afebc331 100644 --- a/libraries/AP_AHRS/AP_AHRS.h +++ b/libraries/AP_AHRS/AP_AHRS.h @@ -462,7 +462,7 @@ public: // set the home location in 10e7 degrees. This should be called // when the vehicle is at this position. It is assumed that the // current barometer and GPS altitudes correspond to this altitude - virtual void set_home(const Location &loc) = 0; + virtual bool set_home(const Location &loc) WARN_IF_UNUSED = 0; // set the EKF's origin location in 10e7 degrees. This should only // be called when the EKF has no absolute position reference (i.e. GPS) diff --git a/libraries/AP_AHRS/AP_AHRS_DCM.cpp b/libraries/AP_AHRS/AP_AHRS_DCM.cpp index 77fe1fa0a6..27ee51d6ef 100644 --- a/libraries/AP_AHRS/AP_AHRS_DCM.cpp +++ b/libraries/AP_AHRS/AP_AHRS_DCM.cpp @@ -1031,7 +1031,7 @@ bool AP_AHRS_DCM::airspeed_estimate(float *airspeed_ret) const return ret; } -void AP_AHRS_DCM::set_home(const Location &loc) +bool AP_AHRS_DCM::set_home(const Location &loc) { _home = loc; _home_is_set = true; @@ -1042,6 +1042,8 @@ void AP_AHRS_DCM::set_home(const Location &loc) // send new home and ekf origin to GCS gcs().send_home(); gcs().send_ekf_origin(); + + return true; } // a relative ground position to home in meters, Down diff --git a/libraries/AP_AHRS/AP_AHRS_DCM.h b/libraries/AP_AHRS/AP_AHRS_DCM.h index 8d6f7d634c..fe1752c7a9 100644 --- a/libraries/AP_AHRS/AP_AHRS_DCM.h +++ b/libraries/AP_AHRS/AP_AHRS_DCM.h @@ -96,7 +96,7 @@ public: bool use_compass() override; - void set_home(const Location &loc) override; + bool set_home(const Location &loc) override WARN_IF_UNUSED; void estimate_wind(void); // is the AHRS subsystem healthy?