AHRS

Dependencies:   Eigen

Dependents:   IndNav_QK3_T265

Revision:
4:3c21fb0c9e84
Parent:
3:6811c0ce95f6
Child:
5:eee47600b772
--- a/AHRS.h	Tue Dec 04 15:49:48 2018 +0000
+++ b/AHRS.h	Fri May 03 13:46:40 2019 +0000
@@ -1,31 +1,38 @@
 #include "Mahony.h"
 #include "MadgwickAHRS.h"
 #include "LinearCharacteristics.h"
-#include "LSM9DS1.h"
+#include "LSM9DS1_i2c.h"
 #include "Signal.h"
+#include "ekf.h"
+#include "matrix.h"
+
 
 class AHRS{
 public:
     AHRS(uint8_t,float);
     virtual ~AHRS();
     
-    float getRollRadians() {
-        if (!RPY_filter.anglesComputed) RPY_filter.computeAngles();
-        return RPY_filter.getRoll();
+    float getRoll() {
+        return 0.0;//RPY_filter.getRoll();
     }
-    float getPitchRadians() {
-        if (!RPY_filter.anglesComputed) RPY_filter.computeAngles();
-        return RPY_filter.getPitch();
+    float getPitch() {
+        return 0.0;//RPY_filter.getPitch();
     }
-    float getYawRadians() {
-        if (!RPY_filter.anglesComputed) RPY_filter.computeAngles();
-        return RPY_filter.getYaw();
+    float getYaw() {
+        return 0.0;//RPY_filter.getYaw();
     }
     LSM9DS1 imu;
-    Mahony RPY_filter;
+    //Mahony RPY_filter;
+    ekf RPY_filter;
     LinearCharacteristics raw_gx2gx;
     LinearCharacteristics raw_gy2gy;
     LinearCharacteristics raw_gz2gz;
+    LinearCharacteristics raw_ax2ax;
+    LinearCharacteristics raw_ay2ay;
+    LinearCharacteristics raw_az2az;
+    LinearCharacteristics int2magx;     
+    LinearCharacteristics int2magy;
+    LinearCharacteristics int2magz;
 private:
     Signal signal;
     Thread thread;
@@ -33,13 +40,9 @@
     Mutex mutex;      // mutex to lock critical sections 
     void sendSignal();
     void update();
-    LinearCharacteristics raw_ax2ax;
-    LinearCharacteristics raw_ay2ay;
-    LinearCharacteristics raw_az2az;
-    LinearCharacteristics int2magx;     
-    LinearCharacteristics int2magy;
-    LinearCharacteristics int2magz;
-    SPI spi;
-    DigitalOut csAG;         // for spi
-    DigitalOut csM;           //  "
+    matrix measurement;
+    //SPI spi;      % old board with spi
+    
+//    PinName csAG;         // for spi
+//    PinName csM;           //  "
 };