Library containing Crazyflie 2.0 controller classes: - Attitude estimator - Horizontal estimator - Vertical estimator - Attitude controller - Horizontal controller - Vertical controller - Mixer

Committer:
fbob
Date:
Thu Dec 06 16:44:40 2018 +0000
Revision:
24:7b9e3beb61d5
Parent:
21:169cc2b1d2ff
Adjust

Who changed what in which revision?

UserRevisionLine numberNew 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