diff --git a/libraries/AP_Compass/Compass.cpp b/libraries/AP_Compass/Compass.cpp index 6090089c9c..538516dec4 100644 --- a/libraries/AP_Compass/Compass.cpp +++ b/libraries/AP_Compass/Compass.cpp @@ -54,6 +54,14 @@ Compass::set_declination(float radians) _declination.set_and_save(radians); } +float +Compass::get_declination() +{ + return _declination.get(); +} + + + void Compass::calculate(float roll, float pitch) { diff --git a/libraries/AP_Compass/Compass.h b/libraries/AP_Compass/Compass.h index f10d902447..af0414576a 100644 --- a/libraries/AP_Compass/Compass.h +++ b/libraries/AP_Compass/Compass.h @@ -107,6 +107,7 @@ public: /// @param radians Local field declination. /// virtual void set_declination(float radians); + float get_declination(); protected: AP_Var_group _group; ///< storage group holding the compass' calibration data