Library containing Crazyflie 2.0 controller classes: - Attitude estimator - Horizontal estimator - Vertical estimator - Attitude controller - Horizontal controller - Vertical controller - Mixer
HorizontaEstimator/HorizontalEstimator.h@24:7b9e3beb61d5, 2018-12-06 (annotated)
- Committer:
- fbob
- Date:
- Thu Dec 06 16:44:40 2018 +0000
- Revision:
- 24:7b9e3beb61d5
- Parent:
- 19:83b357d6806e
Adjust
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fbob | 8:d05fe9f8bfb6 | 1 | #ifndef HorizontalEstimator_h |
fbob | 8:d05fe9f8bfb6 | 2 | #define HorizontalEstimator_h |
fbob | 8:d05fe9f8bfb6 | 3 | |
fbob | 8:d05fe9f8bfb6 | 4 | #include "mbed.h" |
fbob | 8:d05fe9f8bfb6 | 5 | #include "Parameters.h" |
fbob | 8:d05fe9f8bfb6 | 6 | #include "PMW3901.h" |
fbob | 8:d05fe9f8bfb6 | 7 | |
fbob | 8:d05fe9f8bfb6 | 8 | // Vertical estimator class |
fbob | 8:d05fe9f8bfb6 | 9 | class HorizontalEstimator |
fbob | 8:d05fe9f8bfb6 | 10 | { |
fbob | 8:d05fe9f8bfb6 | 11 | public: |
fbob | 8:d05fe9f8bfb6 | 12 | // Class constructor |
fbob | 8:d05fe9f8bfb6 | 13 | HorizontalEstimator(); |
fbob | 8:d05fe9f8bfb6 | 14 | // Initialize class |
fbob | 8:d05fe9f8bfb6 | 15 | void init(); |
fbob | 17:f682b4a5686d | 16 | // Predict horizontal velocity from model |
fbob | 12:9fed6f656f88 | 17 | void predict(); |
fbob | 18:60516a4cba27 | 18 | // Correct horizontal velocity with measurement |
fbob | 18:60516a4cba27 | 19 | void correct(float phi, float theta, float p, float q, float z); |
fbob | 19:83b357d6806e | 20 | // Horizontal positions (m) and velocities (m/s) estimations |
fbob | 18:60516a4cba27 | 21 | float x, y, u, v; |
fbob | 8:d05fe9f8bfb6 | 22 | private: |
fbob | 8:d05fe9f8bfb6 | 23 | // Flow sensor object |
fbob | 8:d05fe9f8bfb6 | 24 | PMW3901 flow; |
fbob | 19:83b357d6806e | 25 | // Last horizontal position (m) measurements |
fbob | 18:60516a4cba27 | 26 | float x_m_last, y_m_last; |
fbob | 8:d05fe9f8bfb6 | 27 | |
fbob | 8:d05fe9f8bfb6 | 28 | }; |
fbob | 8:d05fe9f8bfb6 | 29 | |
fbob | 8:d05fe9f8bfb6 | 30 | #endif |