An fully working IMU-Filter and Sensor drivers for the 10DOF-Board over I2C. All in one simple class. Include, calibrate sensors, call read, get angles. (3D Visualisation code for Python also included) Sensors: L3G4200D, ADXL345, HMC5883, BMP085
Diff: IMU/IMU_Filter/IMU_Filter.h
- Revision:
- 4:f62337b907e5
- Parent:
- 0:3e7450f1a938
diff -r 6dbefedce7fe -r f62337b907e5 IMU/IMU_Filter/IMU_Filter.h --- a/IMU/IMU_Filter/IMU_Filter.h Tue Aug 27 22:18:25 2013 +0000 +++ b/IMU/IMU_Filter/IMU_Filter.h Thu Aug 29 13:52:30 2013 +0000 @@ -1,3 +1,26 @@ +//===================================================================================================== +// ALGORITHM COPIED FROM http://www.x-io.co.uk/open-source-imu-and-ahrs-algorithms/ +// Algorithm Author: S.O.H. Madgwick +// Algorithm Date: 25th August 2010 +//===================================================================================================== +// Description: +// +// Quaternion implementation of the 'DCM filter' [Mayhony et al]. Incorporates the magnetic distortion +// compensation algorithms from my filter [Madgwick] which eliminates the need for a reference +// direction of flux (bx bz) to be predefined and limits the effect of magnetic distortions to yaw +// axis only. +// +// User must define 'halfT' as the (sample period / 2), and the filter gains 'Kp' and 'Ki'. +// +// Global variables 'q0', 'q1', 'q2', 'q3' are the quaternion elements representing the estimated +// orientation. See my report for an overview of the use of quaternions in this application. +// +// User must call 'AHRSupdate()' every sample period and parse calibrated gyroscope ('gx', 'gy', 'gz'), +// accelerometer ('ax', 'ay', 'ay') and magnetometer ('mx', 'my', 'mz') data. Gyroscope units are +// radians/second, accelerometer and magnetometer units are irrelevant as the vector is normalised. +// +//===================================================================================================== + // by MaEtUgR #ifndef IMU_FILTER_H