AHRS

Dependencies:   Eigen

Dependents:   IndNav_QK3_T265

Committer:
altb2
Date:
Wed Jun 26 14:19:01 2019 +0000
Revision:
7:bfde7bd5fe31
Parent:
6:5824bd96b6cf
Child:
8:51062bb877f0
Rev2 EKF

Who changed what in which revision?

UserRevisionLine numberNew contents of line
altb 3:6811c0ce95f6 1 #include "Mahony.h"
altb 3:6811c0ce95f6 2 #include "MadgwickAHRS.h"
altb 3:6811c0ce95f6 3 #include "LinearCharacteristics.h"
altb2 4:3c21fb0c9e84 4 #include "LSM9DS1_i2c.h"
altb 3:6811c0ce95f6 5 #include "Signal.h"
altb2 4:3c21fb0c9e84 6 #include "ekf.h"
altb2 4:3c21fb0c9e84 7 #include "matrix.h"
altb2 6:5824bd96b6cf 8 #include "data_logger.h"
altb2 4:3c21fb0c9e84 9
altb2 6:5824bd96b6cf 10 extern data_logger my_logger;
altb 3:6811c0ce95f6 11
altb 3:6811c0ce95f6 12 class AHRS{
altb 3:6811c0ce95f6 13 public:
altb 3:6811c0ce95f6 14 AHRS(uint8_t,float);
altb 3:6811c0ce95f6 15 virtual ~AHRS();
altb 3:6811c0ce95f6 16
altb2 4:3c21fb0c9e84 17 float getRoll() {
altb2 5:eee47600b772 18 return RPY_filter.get_est_state(1);
altb 3:6811c0ce95f6 19 }
altb2 4:3c21fb0c9e84 20 float getPitch() {
altb2 5:eee47600b772 21 return RPY_filter.get_est_state(2);
altb 3:6811c0ce95f6 22 }
altb2 4:3c21fb0c9e84 23 float getYaw() {
altb2 6:5824bd96b6cf 24 return 0.0;
altb 3:6811c0ce95f6 25 }
altb 3:6811c0ce95f6 26 LSM9DS1 imu;
altb2 4:3c21fb0c9e84 27 //Mahony RPY_filter;
altb2 4:3c21fb0c9e84 28 ekf RPY_filter;
altb 3:6811c0ce95f6 29 LinearCharacteristics raw_gx2gx;
altb 3:6811c0ce95f6 30 LinearCharacteristics raw_gy2gy;
altb 3:6811c0ce95f6 31 LinearCharacteristics raw_gz2gz;
altb2 4:3c21fb0c9e84 32 LinearCharacteristics raw_ax2ax;
altb2 4:3c21fb0c9e84 33 LinearCharacteristics raw_ay2ay;
altb2 4:3c21fb0c9e84 34 LinearCharacteristics raw_az2az;
altb2 4:3c21fb0c9e84 35 LinearCharacteristics int2magx;
altb2 4:3c21fb0c9e84 36 LinearCharacteristics int2magy;
altb2 4:3c21fb0c9e84 37 LinearCharacteristics int2magz;
altb 3:6811c0ce95f6 38 private:
altb 3:6811c0ce95f6 39 Signal signal;
altb 3:6811c0ce95f6 40 Thread thread;
altb 3:6811c0ce95f6 41 Ticker ticker;
altb 3:6811c0ce95f6 42 Mutex mutex; // mutex to lock critical sections
altb 3:6811c0ce95f6 43 void sendSignal();
altb2 7:bfde7bd5fe31 44 float local_time;
altb 3:6811c0ce95f6 45 void update();
altb2 4:3c21fb0c9e84 46 matrix measurement;
altb2 4:3c21fb0c9e84 47 //SPI spi; % old board with spi
altb2 4:3c21fb0c9e84 48
altb2 4:3c21fb0c9e84 49 // PinName csAG; // for spi
altb2 4:3c21fb0c9e84 50 // PinName csM; // "
altb 3:6811c0ce95f6 51 };