AHRS
Dependencies: Eigen
Diff: AHRS.h
- Revision:
- 17:f9eed26536d9
- Parent:
- 11:b010622c0748
- Child:
- 19:42ea6dd68185
diff -r 97c12f818b94 -r f9eed26536d9 AHRS.h --- a/AHRS.h Mon Sep 23 09:53:03 2019 +0000 +++ b/AHRS.h Mon Sep 23 14:19:23 2019 +0000 @@ -9,26 +9,35 @@ extern data_logger my_logger; -class AHRS{ +class AHRS +{ public: + AHRS(uint8_t,float,bool); + virtual ~AHRS(); - - float getRoll(uint8_t ft) { + + float getRoll(uint8_t ft) + { if(ft ==1) - return RPY_filter.get_est_state(0); + return RPY_filter.get_est_state(0); else - return Mahony_filter.getRollRadians(); + return Mahony_filter.getRollRadians(); } - float getPitch(uint8_t ft) { + + float getPitch(uint8_t ft) + { if(ft ==1) - return RPY_filter.get_est_state(1); + return RPY_filter.get_est_state(1); else - return Mahony_filter.getPitchRadians(); + return Mahony_filter.getPitchRadians(); } - float getYaw() { + + float getYaw() + { return 0.0; } + LSM9DS1 imu; Mahony Mahony_filter; ekf RPY_filter; @@ -38,26 +47,26 @@ LinearCharacteristics raw_ax2ax; LinearCharacteristics raw_ay2ay; LinearCharacteristics raw_az2az; - LinearCharacteristics int2magx; - LinearCharacteristics int2magy; - LinearCharacteristics int2magz; + LinearCharacteristics raw_mx2mx; + LinearCharacteristics raw_my2my; + LinearCharacteristics raw_mz2mz; float xyzUS[3]; float xyzAS[3]; float rxryrzUS[3]; float v_xyzOF[2]; float xyzOF[3]; float xyzLIDAR[3]; + float magnet_cal_0[3]; + private: + Signal signal; Thread thread; Ticker ticker; - Mutex mutex; // mutex to lock critical sections + Mutex mutex; // mutex to lock critical sections void sendSignal(); float local_time; void update(); matrix measurement; - //SPI spi; % old board with spi - -// PinName csAG; // for spi -// PinName csM; // " + };