Yuri De Stefani / CrazyflieController_final
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers HorizontalController.h Source File

HorizontalController.h

00001 #ifndef HorizontalController_h
00002 #define HorizontalController_h
00003 #include "mbed.h"
00004 #include "Library.h"
00005 // Horizontal controller class
00006 class HorizontalController
00007 {
00008     public :
00009         // Class constructor
00010         HorizontalController () ;
00011         // Control reference roll and pitch angles given reference horizontal positions and current horizontal positions and velocities
00012         void control ( float x_r , float y_r , float x, float y, float u, float v);
00013         // Reference roll and pitch angles ( rad)
00014         float phi_r , theta_r ;
00015     private :
00016         // Control acceleration given reference position and current position and velocity with given controller gains
00017         float control_single ( float pos_r , float pos , float vel , float kp_hori , float kd_hori);
00018         // Last horizontal positions error (m)
00019         float x_e_last , y_e_last ;
00020         float pos_e_last;
00021 };
00022 # endif