library for 9dof using madgwick's algorithm
Dependents: NerfGun_nRF24L01P_TX_9d0f
MadgwickAHRS.h
- Committer:
- b50559
- Date:
- 2015-08-13
- Revision:
- 0:756055ce357a
File content as of revision 0:756055ce357a:
//=====================================================================================================
// MadgwickAHRS.h
//=====================================================================================================
//
// Implementation of Madgwick's IMU and AHRS algorithms.
// See: http://www.x-io.co.uk/node/8#open_source_ahrs_and_imu_algorithms
//
// Date Author Notes
// 29/09/2011 SOH Madgwick Initial release
// 02/10/2011 SOH Madgwick Optimised for reduced CPU load
//
//=====================================================================================================
#ifndef MadgwickAHRS_h
#define MadgwickAHRS_h
//----------------------------------------------------------------------------------------------------
class MadgwickAHRS{
public:
MadgwickAHRS(float Freq);
//Function declarations
void update(float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz);
void updateIMU(float gx, float gy, float gz, float ax, float ay, float az);
void getEuler();
int16_t getRoll();
int16_t getPitch();
int16_t getYaw();
private:
// Variable declaration
float sampleFreq;
float roll;
float pitch;
float yaw;
};
#endif
//=====================================================================================================
// End of file
//=====================================================================================================