Yuri De Stefani / CrazyflieController_final
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AttitudeController.h Source File

AttitudeController.h

00001 #ifndef AttitudeController_h
00002 #define AttitudeController_h
00003 
00004 #include "mbed.h"
00005 #include "Library.h"
00006 
00007 class AttitudeController
00008 {
00009     public :
00010         // Class constructor
00011         AttitudeController () ;
00012         // Control torques given reference angles and current angles and angular velocities
00013             void control(float phi_r, float theta_r, float psi_r, float phi, float theta, float psi);
00014         // Torques (N.m)
00015         float tau_phi, tau_theta, tau_psi;
00016         
00017     private :
00018     // Control torque of a single axis given reference angles and current angles and angular velocities ( with given gains and /or time constants and moments of inertia )
00019         float single_axis_control(float angle_r, float angle, float K_angle, float K_rate , float I, float last_erro_angle);
00020         
00021         float last_erro_phi, last_erro_theta, last_erro_psi;
00022         
00023         float last_erro;
00024 };
00025 # endif
00026