![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Testing ekf implementation for Quadro_1.
EKF_RP.h@7:bcbcc23983de, 2019-10-20 (annotated)
- Committer:
- pmic
- Date:
- Sun Oct 20 13:16:13 2019 +0000
- Revision:
- 7:bcbcc23983de
- Parent:
- 6:f9569a07aff5
- Child:
- 13:2e03d9c03409
EKF_RPY (8 states) first time succesfully running.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pmic | 0:a0e9705be9c4 | 1 | #ifndef EKF_RP_H_ |
pmic | 0:a0e9705be9c4 | 2 | #define EKF_RP_H_ |
pmic | 0:a0e9705be9c4 | 3 | |
pmic | 0:a0e9705be9c4 | 4 | #include <mbed.h> |
pmic | 6:f9569a07aff5 | 5 | #include "Eigen/Dense.h" |
pmic | 0:a0e9705be9c4 | 6 | |
pmic | 0:a0e9705be9c4 | 7 | using namespace Eigen; |
pmic | 0:a0e9705be9c4 | 8 | |
pmic | 0:a0e9705be9c4 | 9 | class EKF_RP |
pmic | 0:a0e9705be9c4 | 10 | { |
pmic | 0:a0e9705be9c4 | 11 | public: |
pmic | 0:a0e9705be9c4 | 12 | |
pmic | 0:a0e9705be9c4 | 13 | EKF_RP(float Ts); |
pmic | 0:a0e9705be9c4 | 14 | |
pmic | 0:a0e9705be9c4 | 15 | virtual ~EKF_RP(); |
pmic | 0:a0e9705be9c4 | 16 | |
pmic | 0:a0e9705be9c4 | 17 | void reset(); |
pmic | 0:a0e9705be9c4 | 18 | float get_est_state(uint8_t i); |
pmic | 0:a0e9705be9c4 | 19 | void update(float gyro_x, float gyro_y, float accel_x, float accel_y); |
pmic | 0:a0e9705be9c4 | 20 | |
pmic | 0:a0e9705be9c4 | 21 | private: |
pmic | 0:a0e9705be9c4 | 22 | |
pmic | 0:a0e9705be9c4 | 23 | float s1; |
pmic | 0:a0e9705be9c4 | 24 | float c1; |
pmic | 0:a0e9705be9c4 | 25 | float s2; |
pmic | 0:a0e9705be9c4 | 26 | float c2; |
pmic | 0:a0e9705be9c4 | 27 | |
pmic | 0:a0e9705be9c4 | 28 | float g; |
pmic | 0:a0e9705be9c4 | 29 | float kv; |
pmic | 0:a0e9705be9c4 | 30 | float Ts; |
pmic | 0:a0e9705be9c4 | 31 | float rho; |
pmic | 0:a0e9705be9c4 | 32 | Matrix <float, 2, 1> var_gy; |
pmic | 0:a0e9705be9c4 | 33 | Matrix <float, 6, 1> var_fx; |
pmic | 0:a0e9705be9c4 | 34 | |
pmic | 0:a0e9705be9c4 | 35 | Matrix <float, 2, 1> u; |
pmic | 0:a0e9705be9c4 | 36 | Matrix <float, 2, 1> y; |
pmic | 0:a0e9705be9c4 | 37 | Matrix <float, 6, 1> x; |
pmic | 0:a0e9705be9c4 | 38 | Matrix <float, 6, 6> F; |
pmic | 0:a0e9705be9c4 | 39 | Matrix <float, 2, 6> H; |
pmic | 0:a0e9705be9c4 | 40 | Matrix <float, 6, 6> Q; |
pmic | 0:a0e9705be9c4 | 41 | Matrix <float, 2, 2> R; |
pmic | 0:a0e9705be9c4 | 42 | Matrix <float, 6, 6> P; |
pmic | 0:a0e9705be9c4 | 43 | Matrix <float, 6, 2> K; |
pmic | 0:a0e9705be9c4 | 44 | Matrix <float, 6, 6> I; |
pmic | 0:a0e9705be9c4 | 45 | |
pmic | 0:a0e9705be9c4 | 46 | void update_angles(); |
pmic | 4:e50e18eac72b | 47 | void calc_F(); |
pmic | 4:e50e18eac72b | 48 | void calc_H(); |
pmic | 0:a0e9705be9c4 | 49 | void initialize_R(); |
pmic | 0:a0e9705be9c4 | 50 | void initialize_Q(); |
pmic | 4:e50e18eac72b | 51 | void calc_Q(); |
pmic | 0:a0e9705be9c4 | 52 | |
pmic | 0:a0e9705be9c4 | 53 | Matrix <float, 6, 1> fxd(); |
pmic | 0:a0e9705be9c4 | 54 | Matrix <float, 2, 1> gy(); |
pmic | 0:a0e9705be9c4 | 55 | |
pmic | 0:a0e9705be9c4 | 56 | }; |
pmic | 0:a0e9705be9c4 | 57 | |
pmic | 0:a0e9705be9c4 | 58 | #endif |