00001 #ifndef Compass_h 00002 #define Compass_h 00003 00004 #include <inttypes.h> 00005 #include "../AP_Math/AP_Math.h" 00006 00007 class Compass 00008 { 00009 public: 00010 int mag_x; 00011 int mag_y; 00012 int mag_z; 00013 float heading; 00014 float heading_x; 00015 float heading_y; 00016 unsigned long last_update; 00017 00018 virtual bool init(int initialise_wire_lib = 1) = 0; 00019 virtual void read() = 0; 00020 virtual void calculate(float roll, float pitch) = 0; 00021 virtual void set_orientation(const Matrix3f &rotation_matrix) = 0; 00022 virtual void set_offsets(int x, int y, int z) = 0; 00023 virtual void set_declination(float radians) = 0; 00024 }; 00025 #endif