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

HorizontalController/HorizontalController.h

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

File content as of revision 24:7b9e3beb61d5:

#ifndef HorizontalController_h
#define HorizontalController_h

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

// Horizontal controller class
class HorizontalController
{
  public:
    // Class constructor
    HorizontalController();
    // Control reference roll and pitch angles (rad) given reference horizontal positions (m) and current horizontal positions (m) and velocities (m/s)
    void control(float x_r, float y_r, float x, float y, float u, float v);
    // Reference roll and pitch angles (rad)
    float phi_r, theta_r;
  private:
    // Control acceleration given reference position (m) and current position (m) and velocity (m/s) with given controller gains
    float control_state_regulator(float position_r, float position, float velocity, float kp, float kd);  
};

#endif