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-10-18
Revision:
19:83b357d6806e
Parent:
17:f682b4a5686d
Child:
21:169cc2b1d2ff

File content as of revision 19:83b357d6806e:

#ifndef AttitudeController_h
#define AttitudeController_h

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

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 time constants (s) and moment of inertia (kg.m^2)
    float control_single(float angle_r, float angle, float rate, float T_angle, float T_rate, float I);
    // Control torque (N.m) given reference angle (rad) and current angle (rad) and angular velocity (rad/s) with given time constants (s) and moment of inertia (kg.m^2)
    float control_single_regulator(float angle_r, float angle, float rate, float K_angle, float K_rate, float I);
};

#endif