AHRS
Dependencies: Eigen
Diff: Mahony.h
- Revision:
- 3:6811c0ce95f6
- Parent:
- 1:36bbe04e1f6f
diff -r 36bbe04e1f6f -r 6811c0ce95f6 Mahony.h --- a/Mahony.h Fri Oct 26 05:56:25 2018 +0000 +++ b/Mahony.h Tue Dec 04 15:49:48 2018 +0000 @@ -26,18 +26,19 @@ float integralFBx, integralFBy, integralFBz; // integral error terms scaled by Ki float invSampleFreq; float roll, pitch, yaw; - char anglesComputed; static float invSqrt(float x); - void computeAngles(); + //------------------------------------------------------------------------------------------- // Function declarations public: - Mahony(); + Mahony(float); void begin(float sampleFrequency) { invSampleFreq = 1.0f / sampleFrequency; } 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); + char anglesComputed; + void computeAngles(); float getRoll() { if (!anglesComputed) computeAngles(); return roll * 57.29578f;