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

HorizontaEstimator/HorizontalEstimator.h

Committer:
fbob
Date:
2018-12-06
Revision:
24:7b9e3beb61d5
Parent:
19:83b357d6806e

File content as of revision 24:7b9e3beb61d5:

#ifndef HorizontalEstimator_h
#define HorizontalEstimator_h

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

// Vertical estimator class
class HorizontalEstimator
{
  public:
    // Class constructor
    HorizontalEstimator();
    // Initialize class
    void init();
    // Predict horizontal velocity from model
    void predict();
    // Correct horizontal velocity with measurement
    void correct(float phi, float theta, float p, float q, float z);
    // Horizontal positions (m) and velocities (m/s) estimations
    float x, y, u, v;
  private:
    // Flow sensor object
    PMW3901 flow;
    // Last horizontal position (m) measurements
    float x_m_last, y_m_last;
    
};

#endif