From 385e3af27ef5703d989805e7d46282c92ea97447 Mon Sep 17 00:00:00 2001 From: jasonshort Date: Sat, 19 Feb 2011 03:57:53 +0000 Subject: [PATCH] Added accessors declination. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1677 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_Compass/Compass.cpp | 8 ++++++++ libraries/AP_Compass/Compass.h | 1 + 2 files changed, 9 insertions(+) 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