Implemented first Hangar-Service
Dependencies: CalibrateMagneto QuaternionMath
Fork of SML2 by
Diff: SensorFusion.h
- Revision:
- 46:fd5a62296b12
- Parent:
- 43:6251c0169f4f
--- a/SensorFusion.h Wed May 27 11:45:00 2015 +0000 +++ b/SensorFusion.h Wed May 27 13:01:43 2015 +0000 @@ -16,10 +16,14 @@ public: virtual void sensorTick(float dt, Vector3 fused, Vector3 accel, Vector3 magneto, Vector3 gyro, Quaternion q) {} }; - - void setDelegate(Delegate &d) { delegate = &d; } - virtual bool start() { return false; } + void setDelegate(Delegate &d) { + delegate = &d; + } + + virtual bool start() { + return false; + } virtual void stop() {} protected: @@ -37,16 +41,16 @@ virtual void sensorUpdate(Vector3 gyro_degrees); virtual bool start(); virtual void stop(); - + protected: Accelerometer accel; Gyroscope gyro; float const deltat, beta; - + LowPassFilter lowpassX; LowPassFilter lowpassY; LowPassFilter lowpassZ; - + void updateFilter(float ax, float ay, float az, float gx, float gy, float gz); }; @@ -57,7 +61,7 @@ virtual void sensorUpdate(Vector3 gyro_degrees); virtual bool start(); virtual void stop(); - + protected: Magnetometer magneto; void updateFilter(float ax, float ay, float az, float gx, float gy, float gz, float mx, float my, float mz);