Self_Riding_Bicycle_LQRgain
Dependencies: LSM9DS0_self_riding_bike_LQR mbed
SensorFusion.h@0:c2e43d17c8e4, 2018-08-20 (annotated)
- Committer:
- cpul5338
- Date:
- Mon Aug 20 13:21:31 2018 +0000
- Revision:
- 0:c2e43d17c8e4
self_riding_bike_LQR
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cpul5338 | 0:c2e43d17c8e4 | 1 | #ifndef SENSORFUSION_H_INCLUDED |
cpul5338 | 0:c2e43d17c8e4 | 2 | #define SENSORFUSION_H_INCLUDED |
cpul5338 | 0:c2e43d17c8e4 | 3 | |
cpul5338 | 0:c2e43d17c8e4 | 4 | #include "math.h" |
cpul5338 | 0:c2e43d17c8e4 | 5 | #define FTimer 1000.0f ///Hz |
cpul5338 | 0:c2e43d17c8e4 | 6 | #define sample_time 1.0f/FTimer |
cpul5338 | 0:c2e43d17c8e4 | 7 | #define Alpha FTimer/25.0f |
cpul5338 | 0:c2e43d17c8e4 | 8 | |
cpul5338 | 0:c2e43d17c8e4 | 9 | extern float axm, aym, azm, u1, u2, u3, mx, my, mz; |
cpul5338 | 0:c2e43d17c8e4 | 10 | extern float Ac[3]; |
cpul5338 | 0:c2e43d17c8e4 | 11 | |
cpul5338 | 0:c2e43d17c8e4 | 12 | extern float axm_f, axm_f_old, u3aym_f, u3aym_f_old, u2azm_f, u2azm_f_old; |
cpul5338 | 0:c2e43d17c8e4 | 13 | extern float aym_f, aym_f_old, u3axm_f, u3axm_f_old, u1azm_f, u1azm_f_old; |
cpul5338 | 0:c2e43d17c8e4 | 14 | extern float azm_f, azm_f_old, u2axm_f, u2axm_f_old, u1aym_f, u1aym_f_old; |
cpul5338 | 0:c2e43d17c8e4 | 15 | |
cpul5338 | 0:c2e43d17c8e4 | 16 | extern float x1_hat, x2_hat, x3_hat; |
cpul5338 | 0:c2e43d17c8e4 | 17 | extern float sinroll, cosroll, roll_angle, droll_angle, droll_angle_old; |
cpul5338 | 0:c2e43d17c8e4 | 18 | extern float sinpitch, cospitch, yaw_ref, yaw_angle, yaw_angle_old, dyaw_angle, dyaw_angle_old; |
cpul5338 | 0:c2e43d17c8e4 | 19 | |
cpul5338 | 0:c2e43d17c8e4 | 20 | //extern void CentrifugalAcce_Compensation(float velocity); |
cpul5338 | 0:c2e43d17c8e4 | 21 | extern float lpf(float input,float input_old,float frequency); |
cpul5338 | 0:c2e43d17c8e4 | 22 | extern void roll_fusion(float a_xm,float a_ym,float a_zm,float u_3,float u_1,float alpha); |
cpul5338 | 0:c2e43d17c8e4 | 23 | extern float Determinant(float x11, float x12, float x21, float x22); |
cpul5338 | 0:c2e43d17c8e4 | 24 | extern float absolute(float value); |
cpul5338 | 0:c2e43d17c8e4 | 25 | |
cpul5338 | 0:c2e43d17c8e4 | 26 | extern void Reset_data(void); |
cpul5338 | 0:c2e43d17c8e4 | 27 | |
cpul5338 | 0:c2e43d17c8e4 | 28 | #endif // SENSORFUSION_H_INCLUDED |