Library containing Crazyflie 2.0 controller classes: - Attitude estimator - Horizontal estimator - Vertical estimator - Attitude controller - Horizontal controller - Vertical controller - Mixer
VerticalEstimator/VerticalEstimator.h@9:15058b4fa090, 2018-09-28 (annotated)
- Committer:
- fbob
- Date:
- Fri Sep 28 15:08:41 2018 +0000
- Revision:
- 9:15058b4fa090
- Parent:
- 7:220ce3839be8
- Child:
- 11:fad579538b4c
Vertical estimator improvements
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fbob | 7:220ce3839be8 | 1 | #ifndef VerticalEstimator_h |
fbob | 7:220ce3839be8 | 2 | #define VerticalEstimator_h |
fbob | 7:220ce3839be8 | 3 | |
fbob | 7:220ce3839be8 | 4 | #include "mbed.h" |
fbob | 7:220ce3839be8 | 5 | #include "Parameters.h" |
fbob | 7:220ce3839be8 | 6 | #include "VL53L0X.h" |
fbob | 7:220ce3839be8 | 7 | |
fbob | 7:220ce3839be8 | 8 | // Vertical estimator class |
fbob | 7:220ce3839be8 | 9 | class VerticalEstimator |
fbob | 7:220ce3839be8 | 10 | { |
fbob | 7:220ce3839be8 | 11 | public: |
fbob | 7:220ce3839be8 | 12 | // Class constructor |
fbob | 7:220ce3839be8 | 13 | VerticalEstimator(); |
fbob | 7:220ce3839be8 | 14 | // Initialize class |
fbob | 7:220ce3839be8 | 15 | void init(); |
fbob | 9:15058b4fa090 | 16 | // Estimate vertical position and velocity |
fbob | 7:220ce3839be8 | 17 | void estimate(float phi, float theta); |
fbob | 9:15058b4fa090 | 18 | // Vertical position (m) and velocity (m/s) estimation |
fbob | 9:15058b4fa090 | 19 | float z, w; |
fbob | 7:220ce3839be8 | 20 | private: |
fbob | 7:220ce3839be8 | 21 | // Range sensor object |
fbob | 7:220ce3839be8 | 22 | VL53L0X range; |
fbob | 9:15058b4fa090 | 23 | // Measure vertical position and velocity |
fbob | 9:15058b4fa090 | 24 | void measure(float phi, float theta); |
fbob | 9:15058b4fa090 | 25 | // Predict vertical position and velocity |
fbob | 9:15058b4fa090 | 26 | void predict(); |
fbob | 9:15058b4fa090 | 27 | // Vertical position (m) and velocity (m/s) measurement |
fbob | 9:15058b4fa090 | 28 | float z_m, w_m; |
fbob | 9:15058b4fa090 | 29 | // Vertical position (m) and velocity (m/s) prediction |
fbob | 9:15058b4fa090 | 30 | float z_p, w_p; |
fbob | 7:220ce3839be8 | 31 | }; |
fbob | 7:220ce3839be8 | 32 | |
fbob | 7:220ce3839be8 | 33 | #endif |