Library containing Crazyflie 2.0 controller classes: - Attitude estimator - Horizontal estimator - Vertical estimator - Attitude controller - Horizontal controller - Vertical controller - Mixer
HorizontalController/HorizontalController.h@21:169cc2b1d2ff, 2018-10-24 (annotated)
- Committer:
- fbob
- Date:
- Wed Oct 24 14:24:56 2018 +0000
- Revision:
- 21:169cc2b1d2ff
- Parent:
- 17:f682b4a5686d
2s flight
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fbob | 8:d05fe9f8bfb6 | 1 | #ifndef HorizontalController_h |
fbob | 8:d05fe9f8bfb6 | 2 | #define HorizontalController_h |
fbob | 8:d05fe9f8bfb6 | 3 | |
fbob | 8:d05fe9f8bfb6 | 4 | #include "mbed.h" |
fbob | 8:d05fe9f8bfb6 | 5 | #include "Parameters.h" |
fbob | 8:d05fe9f8bfb6 | 6 | |
fbob | 21:169cc2b1d2ff | 7 | // Horizontal controller class |
fbob | 8:d05fe9f8bfb6 | 8 | class HorizontalController |
fbob | 8:d05fe9f8bfb6 | 9 | { |
fbob | 8:d05fe9f8bfb6 | 10 | public: |
fbob | 8:d05fe9f8bfb6 | 11 | // Class constructor |
fbob | 8:d05fe9f8bfb6 | 12 | HorizontalController(); |
fbob | 21:169cc2b1d2ff | 13 | // Control reference roll and pitch angles (rad) given reference horizontal positions (m) and current horizontal positions (m) and velocities (m/s) |
fbob | 21:169cc2b1d2ff | 14 | void control(float x_r, float y_r, float x, float y, float u, float v); |
fbob | 21:169cc2b1d2ff | 15 | // Reference roll and pitch angles (rad) |
fbob | 8:d05fe9f8bfb6 | 16 | float phi_r, theta_r; |
fbob | 8:d05fe9f8bfb6 | 17 | private: |
fbob | 21:169cc2b1d2ff | 18 | // Control acceleration given reference position (m) and current position (m) and velocity (m/s) with given controller gains |
fbob | 21:169cc2b1d2ff | 19 | float control_state_regulator(float position_r, float position, float velocity, float kp, float kd); |
fbob | 8:d05fe9f8bfb6 | 20 | }; |
fbob | 8:d05fe9f8bfb6 | 21 | |
fbob | 8:d05fe9f8bfb6 | 22 | #endif |