diff --git a/libraries/AP_AHRS/AP_AHRS_DCM.cpp b/libraries/AP_AHRS/AP_AHRS_DCM.cpp index 4458c89d3b..cb357a4f28 100644 --- a/libraries/AP_AHRS/AP_AHRS_DCM.cpp +++ b/libraries/AP_AHRS/AP_AHRS_DCM.cpp @@ -1003,6 +1003,12 @@ void AP_AHRS_DCM::set_home(const Location &loc) _home.options = 0; } +// a relative ground position to home in meters, Down +void AP_AHRS_DCM::get_relative_position_D_home(float &posD) const +{ + posD = -_baro.get_altitude(); +} + /* check if the AHRS subsystem is healthy */ diff --git a/libraries/AP_AHRS/AP_AHRS_DCM.h b/libraries/AP_AHRS/AP_AHRS_DCM.h index c5303d7c85..eae9b357b3 100644 --- a/libraries/AP_AHRS/AP_AHRS_DCM.h +++ b/libraries/AP_AHRS/AP_AHRS_DCM.h @@ -100,6 +100,8 @@ public: return _wind; } + void get_relative_position_D_home(float &posD) const override; + // return an airspeed estimate if available. return true // if we have an estimate bool airspeed_estimate(float *airspeed_ret) const;