2019/09/13ver

Dependencies:   SerialMultiByte QEI omni_wheel PID R1370MeasuringWheel IRsensor ikarashiMDC_2byte_ver Eigen

lib/S-ShapeModel/position_controller.h

Committer:
skouki
Date:
2019-09-13
Revision:
0:76663617eca3

File content as of revision 0:76663617eca3:

#ifndef POSITION_CONTROLLER_H
#define POSITION_CONTROLLER_H

#include "mbed.h"
#include "Geometry.h"
//#define M_PI 3.141592653589793238462643383219502884

class PositionController {
    public :
        PositionController(double accDistance_, double decDistance_, double initialVelocity_, double terminalVelocity_, float maxVelocity_);

        void compute(int positionX, int positionY);
        void targetXY(int targetX_, int targetY_);
        double getVelocityX();
        double getVelocityY();
    private :

        double generateSineWave(double x, double initV, double termV, double start, double length);

        double accDistance;
        double decDistance;
        double accTrue;
        double decTrue;
        double initialVelocity;
        double terminalVelocity;
        float maxVelocity;
        double target;
        int targetX;
        int targetY;
        double radians;
        double velocity[2];

        bool enoughDistance;

        double getVelocity(int position);
};
#endif