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

AttitudeController/AttitudeController.h

Committer:
fbob
Date:
2018-12-06
Revision:
24:7b9e3beb61d5
Parent:
21:169cc2b1d2ff

File content as of revision 24:7b9e3beb61d5:

#ifndef AttitudeController_h
#define AttitudeController_h

#include "mbed.h"
#include "Parameters.h"

// Attitude controller class
class AttitudeController
{
  public:
    // Class constructor
    AttitudeController();
    // Control torques (N.m) given reference angles (rad) and current angles (rad) and angular velocities (rad/s)
    void control(float phi_r, float theta_r, float psi_r, float phi, float theta, float psi, float p, float q, float r);
    // Torques (N.m)
    float tau_phi, tau_theta, tau_psi;
  private:
    // Control torque (N.m) given reference angle (rad) and current angle (rad) and angular velocity (rad/s) with given controller gains and moment of inertia (kg.m^2)
    float control_state_regulator(float angle_r, float angle, float rate, float kp, float kd, float I);
};

#endif