Eigen
Dependencies: Eigen
Dependents: optWingforHAPS_Eigen hexaTest_Eigen
solaESKF.hpp@61:5e5c4fe12440, 2021-11-16 (annotated)
- Committer:
- NaotoMorita
- Date:
- Tue Nov 16 13:56:44 2021 +0000
- Revision:
- 61:5e5c4fe12440
- Parent:
- 60:f4b4231a8d3f
- Child:
- 62:5519d34eb6e8
axis modified
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 | 60:f4b4231a8d3f | 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 | 59:03fe5e16a33c | 23 | |
NaotoMorita | 44:7d82e63b6a86 | 24 | |
NaotoMorita | 44:7d82e63b6a86 | 25 | Matrix errState; |
NaotoMorita | 44:7d82e63b6a86 | 26 | Matrix Phat; |
NaotoMorita | 44:7d82e63b6a86 | 27 | Matrix Q; |
NaotoMorita | 44:7d82e63b6a86 | 28 | |
NaotoMorita | 47:2467de40951f | 29 | void setDiag(Matrix& mat, float val); |
NaotoMorita | 47:2467de40951f | 30 | void setBlockDiag(Matrix& mat, float val,int startIndex, int endIndex); |
NaotoMorita | 47:2467de40951f | 31 | |
NaotoMorita | 47:2467de40951f | 32 | public: |
NaotoMorita | 47:2467de40951f | 33 | |
NaotoMorita | 44:7d82e63b6a86 | 34 | solaESKF(); |
NaotoMorita | 44:7d82e63b6a86 | 35 | |
NaotoMorita | 47:2467de40951f | 36 | Matrix getPihat(); |
NaotoMorita | 47:2467de40951f | 37 | Matrix getVihat(); |
NaotoMorita | 47:2467de40951f | 38 | Matrix getQhat(); |
NaotoMorita | 47:2467de40951f | 39 | Matrix getAccBias(); |
NaotoMorita | 47:2467de40951f | 40 | Matrix getGyroBias(); |
NaotoMorita | 47:2467de40951f | 41 | Matrix getGravity(); |
NaotoMorita | 47:2467de40951f | 42 | Matrix getErrState(); |
NaotoMorita | 47:2467de40951f | 43 | |
NaotoMorita | 47:2467de40951f | 44 | void setPhatPosition(float val); |
NaotoMorita | 47:2467de40951f | 45 | void setPhatVelocity(float val); |
NaotoMorita | 47:2467de40951f | 46 | void setPhatAngleError(float val); |
NaotoMorita | 47:2467de40951f | 47 | void setPhatAccBias(float val); |
NaotoMorita | 47:2467de40951f | 48 | void setPhatGyroBias(float val); |
NaotoMorita | 47:2467de40951f | 49 | void setPhatGravity(float val); |
NaotoMorita | 47:2467de40951f | 50 | void setQVelocity(float val); |
NaotoMorita | 47:2467de40951f | 51 | void setQAngleError(float val); |
NaotoMorita | 47:2467de40951f | 52 | void setQAccBias(float val); |
NaotoMorita | 47:2467de40951f | 53 | void setQGyroBias(float val); |
NaotoMorita | 47:2467de40951f | 54 | |
NaotoMorita | 44:7d82e63b6a86 | 55 | void updateNominal(Matrix acc,Matrix gyro, float att_dt); |
NaotoMorita | 44:7d82e63b6a86 | 56 | void updateErrState(Matrix acc,Matrix gyro, float att_dt); |
NaotoMorita | 59:03fe5e16a33c | 57 | void updateGPS(Matrix posgps,float palt,Matrix velgps,Matrix R); |
NaotoMorita | 61:5e5c4fe12440 | 58 | //void updateImuConstraints(Matrix acc,Matrix mag,Matrix R); |
NaotoMorita | 61:5e5c4fe12440 | 59 | void updateAcc(Matrix acc,Matrix R); |
NaotoMorita | 61:5e5c4fe12440 | 60 | void updateMag(Matrix mag,Matrix R); |
NaotoMorita | 44:7d82e63b6a86 | 61 | void fuseErr2Nominal(); |
NaotoMorita | 44:7d82e63b6a86 | 62 | |
NaotoMorita | 44:7d82e63b6a86 | 63 | void computeDcm(Matrix& dcm, Matrix quat); |
NaotoMorita | 44:7d82e63b6a86 | 64 | void setQhat(float ex,float ey,float ez); |
NaotoMorita | 44:7d82e63b6a86 | 65 | void setGravity(float gx,float gy,float gz); |
NaotoMorita | 44:7d82e63b6a86 | 66 | |
NaotoMorita | 58:93ba28cf5cb3 | 67 | void setPihat(float pi_x, float pi_y); |
osaka | 51:a5af3b280d23 | 68 | |
NaotoMorita | 44:7d82e63b6a86 | 69 | Matrix computeAngles(); |
NaotoMorita | 44:7d82e63b6a86 | 70 | Matrix quatmultiply(Matrix p, Matrix q); |
NaotoMorita | 44:7d82e63b6a86 | 71 | |
NaotoMorita | 44:7d82e63b6a86 | 72 | }; |
NaotoMorita | 44:7d82e63b6a86 | 73 | |
NaotoMorita | 56:c10f1168bd4a | 74 | #endif |
NaotoMorita | 56:c10f1168bd4a | 75 | |
NaotoMorita | 56:c10f1168bd4a | 76 | //void updateGPSVelocity(Matrix velgps,Matrix R); |
NaotoMorita | 56:c10f1168bd4a | 77 | //void updateGPSPosition(Matrix posgps,Matrix R); |
NaotoMorita | 56:c10f1168bd4a | 78 | //void updateGyroConstraints(Matrix gyro,Matrix R); |
NaotoMorita | 56:c10f1168bd4a | 79 | //void updateMag(Matrix mag,Matrix R); |
NaotoMorita | 59:03fe5e16a33c | 80 | //void updateAccConstraints(Matrix acc,float palt,Matrix R); |
NaotoMorita | 59:03fe5e16a33c | 81 | //void updateGPSVelocity(Matrix velgps,Matrix mag,Matrix R); |
NaotoMorita | 59:03fe5e16a33c | 82 | //void updateGPSPosition(Matrix posgps,float palt,Matrix R); |
NaotoMorita | 61:5e5c4fe12440 | 83 | // |