Eigen
Dependencies: Eigen
Dependents: optWingforHAPS_Eigen hexaTest_Eigen
solaESKF.hpp@74:f5fe7fecbd3c, 2021-11-22 (annotated)
- Committer:
- NaotoMorita
- Date:
- Mon Nov 22 09:51:36 2021 +0000
- Revision:
- 74:f5fe7fecbd3c
- Parent:
- 73:5770a0d470c0
- Child:
- 75:e2c825cdc511
mag fuse OK
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
NaotoMorita | 44:7d82e63b6a86 | 1 | #ifndef __solaESKF_HPP__ |
NaotoMorita | 44:7d82e63b6a86 | 2 | #define __solaESKF_HPP__ |
NaotoMorita | 44:7d82e63b6a86 | 3 | |
NaotoMorita | 44:7d82e63b6a86 | 4 | #include "Matrix.h" |
NaotoMorita | 54:cd514d9d4b19 | 5 | #include "MatrixMath.h" |
NaotoMorita | 54:cd514d9d4b19 | 6 | #include <cmath> |
NaotoMorita | 44:7d82e63b6a86 | 7 | |
NaotoMorita | 44:7d82e63b6a86 | 8 | #define M_PI 3.141592f |
NaotoMorita | 44:7d82e63b6a86 | 9 | |
NaotoMorita | 71:56c32be982b8 | 10 | extern Serial twelite; |
NaotoMorita | 44:7d82e63b6a86 | 11 | |
NaotoMorita | 44:7d82e63b6a86 | 12 | class solaESKF |
NaotoMorita | 44:7d82e63b6a86 | 13 | { |
NaotoMorita | 44:7d82e63b6a86 | 14 | private: |
NaotoMorita | 44:7d82e63b6a86 | 15 | |
NaotoMorita | 44:7d82e63b6a86 | 16 | int nState; |
NaotoMorita | 44:7d82e63b6a86 | 17 | Matrix pihat; |
NaotoMorita | 44:7d82e63b6a86 | 18 | Matrix vihat; |
NaotoMorita | 44:7d82e63b6a86 | 19 | Matrix qhat; |
NaotoMorita | 44:7d82e63b6a86 | 20 | Matrix accBias; |
NaotoMorita | 44:7d82e63b6a86 | 21 | Matrix gyroBias; |
NaotoMorita | 44:7d82e63b6a86 | 22 | Matrix gravity; |
NaotoMorita | 74:f5fe7fecbd3c | 23 | |
NaotoMorita | 62:5519d34eb6e8 | 24 | |
NaotoMorita | 62:5519d34eb6e8 | 25 | |
NaotoMorita | 44:7d82e63b6a86 | 26 | Matrix errState; |
NaotoMorita | 44:7d82e63b6a86 | 27 | Matrix Phat; |
NaotoMorita | 44:7d82e63b6a86 | 28 | Matrix Q; |
NaotoMorita | 62:5519d34eb6e8 | 29 | |
NaotoMorita | 47:2467de40951f | 30 | void setDiag(Matrix& mat, float val); |
NaotoMorita | 47:2467de40951f | 31 | void setBlockDiag(Matrix& mat, float val,int startIndex, int endIndex); |
NaotoMorita | 62:5519d34eb6e8 | 32 | |
NaotoMorita | 47:2467de40951f | 33 | public: |
NaotoMorita | 62:5519d34eb6e8 | 34 | |
NaotoMorita | 44:7d82e63b6a86 | 35 | solaESKF(); |
NaotoMorita | 62:5519d34eb6e8 | 36 | |
NaotoMorita | 47:2467de40951f | 37 | Matrix getPihat(); |
NaotoMorita | 47:2467de40951f | 38 | Matrix getVihat(); |
NaotoMorita | 47:2467de40951f | 39 | Matrix getQhat(); |
NaotoMorita | 47:2467de40951f | 40 | Matrix getAccBias(); |
NaotoMorita | 47:2467de40951f | 41 | Matrix getGyroBias(); |
NaotoMorita | 47:2467de40951f | 42 | Matrix getGravity(); |
NaotoMorita | 47:2467de40951f | 43 | Matrix getErrState(); |
NaotoMorita | 62:5519d34eb6e8 | 44 | |
NaotoMorita | 47:2467de40951f | 45 | void setPhatPosition(float val); |
NaotoMorita | 47:2467de40951f | 46 | void setPhatVelocity(float val); |
NaotoMorita | 47:2467de40951f | 47 | void setPhatAngleError(float val); |
NaotoMorita | 47:2467de40951f | 48 | void setPhatAccBias(float val); |
NaotoMorita | 47:2467de40951f | 49 | void setPhatGyroBias(float val); |
NaotoMorita | 47:2467de40951f | 50 | void setPhatGravity(float val); |
NaotoMorita | 47:2467de40951f | 51 | void setQVelocity(float val); |
NaotoMorita | 47:2467de40951f | 52 | void setQAngleError(float val); |
NaotoMorita | 47:2467de40951f | 53 | void setQAccBias(float val); |
NaotoMorita | 47:2467de40951f | 54 | void setQGyroBias(float val); |
NaotoMorita | 47:2467de40951f | 55 | |
NaotoMorita | 44:7d82e63b6a86 | 56 | void updateNominal(Matrix acc,Matrix gyro, float att_dt); |
NaotoMorita | 44:7d82e63b6a86 | 57 | void updateErrState(Matrix acc,Matrix gyro, float att_dt); |
NaotoMorita | 59:03fe5e16a33c | 58 | void updateGPS(Matrix posgps,float palt,Matrix velgps,Matrix R); |
NaotoMorita | 74:f5fe7fecbd3c | 59 | void updateGPSPosition(Matrix posgps,float palt,Matrix R); |
NaotoMorita | 61:5e5c4fe12440 | 60 | void updateAcc(Matrix acc,Matrix R); |
NaotoMorita | 74:f5fe7fecbd3c | 61 | void updateHeading(float a,Matrix R); |
NaotoMorita | 44:7d82e63b6a86 | 62 | void fuseErr2Nominal(); |
NaotoMorita | 44:7d82e63b6a86 | 63 | |
NaotoMorita | 44:7d82e63b6a86 | 64 | void computeDcm(Matrix& dcm, Matrix quat); |
NaotoMorita | 44:7d82e63b6a86 | 65 | void setQhat(float ex,float ey,float ez); |
NaotoMorita | 44:7d82e63b6a86 | 66 | void setGravity(float gx,float gy,float gz); |
NaotoMorita | 44:7d82e63b6a86 | 67 | |
NaotoMorita | 58:93ba28cf5cb3 | 68 | void setPihat(float pi_x, float pi_y); |
osaka | 51:a5af3b280d23 | 69 | |
NaotoMorita | 44:7d82e63b6a86 | 70 | Matrix computeAngles(); |
NaotoMorita | 44:7d82e63b6a86 | 71 | Matrix quatmultiply(Matrix p, Matrix q); |
NaotoMorita | 44:7d82e63b6a86 | 72 | |
NaotoMorita | 44:7d82e63b6a86 | 73 | }; |
NaotoMorita | 44:7d82e63b6a86 | 74 | |
NaotoMorita | 56:c10f1168bd4a | 75 | #endif |
NaotoMorita | 56:c10f1168bd4a | 76 | |
NaotoMorita | 56:c10f1168bd4a | 77 | //void updateGPSVelocity(Matrix velgps,Matrix R); |
NaotoMorita | 56:c10f1168bd4a | 78 | //void updateGPSPosition(Matrix posgps,Matrix R); |
NaotoMorita | 56:c10f1168bd4a | 79 | //void updateGyroConstraints(Matrix gyro,Matrix R); |
NaotoMorita | 56:c10f1168bd4a | 80 | //void updateMag(Matrix mag,Matrix R); |
NaotoMorita | 59:03fe5e16a33c | 81 | //void updateAccConstraints(Matrix acc,float palt,Matrix R); |
NaotoMorita | 59:03fe5e16a33c | 82 | //void updateGPSVelocity(Matrix velgps,Matrix mag,Matrix R); |
NaotoMorita | 59:03fe5e16a33c | 83 | //void updateGPSPosition(Matrix posgps,float palt,Matrix R); |
NaotoMorita | 61:5e5c4fe12440 | 84 | // |