2019/09/13ver

Dependencies:   SerialMultiByte QEI omni_wheel PID R1370MeasuringWheel IRsensor ikarashiMDC_2byte_ver Eigen

Revision:
0:3ad208cbea5f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/S-ShapeModel/position_controller.h	Fri Sep 13 02:19:03 2019 +0000
@@ -0,0 +1,38 @@
+#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
+