2010-08-29 20:03:49 -03:00
|
|
|
#ifndef Compass_h
|
|
|
|
#define Compass_h
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
2010-12-12 10:02:21 -04:00
|
|
|
#include "../AP_Math/AP_Math.h"
|
2010-08-29 20:03:49 -03:00
|
|
|
|
|
|
|
class Compass
|
|
|
|
{
|
|
|
|
public:
|
2010-12-02 01:54:02 -04:00
|
|
|
int mag_x;
|
|
|
|
int mag_y;
|
|
|
|
int mag_z;
|
2010-08-29 20:03:49 -03:00
|
|
|
float heading;
|
2010-12-02 01:54:02 -04:00
|
|
|
float heading_x;
|
|
|
|
float heading_y;
|
|
|
|
unsigned long last_update;
|
2010-12-02 01:13:12 -04:00
|
|
|
|
2010-12-28 19:31:58 -04:00
|
|
|
virtual bool init(int initialise_wire_lib = 1) = 0;
|
|
|
|
virtual void read() = 0;
|
|
|
|
virtual void calculate(float roll, float pitch) = 0;
|
|
|
|
virtual void set_orientation(const Matrix3f &rotation_matrix) = 0;
|
|
|
|
virtual void set_offsets(int x, int y, int z) = 0;
|
|
|
|
virtual void set_declination(float radians) = 0;
|
2010-08-29 20:03:49 -03:00
|
|
|
};
|
2010-12-02 01:13:12 -04:00
|
|
|
#endif
|