S-curve acceleration / deceleration model generator (using FPU)
Diff: position_controller.h
- Revision:
- 3:65ae32169b33
- Parent:
- 2:2c5e4f521390
- Child:
- 4:4cc455e372c2
diff -r 2c5e4f521390 -r 65ae32169b33 position_controller.h --- a/position_controller.h Mon Aug 20 13:54:33 2018 +0900 +++ b/position_controller.h Sat Sep 15 05:05:27 2018 +0000 @@ -2,12 +2,14 @@ #define POSITION_CONTROLLER_H #include "mbed.h" +#define M_PI 3.141592653589793238462643383219502884 class PositionController { public : - PositionController(double accDistance_, double decDistance_, double initialVelocity_, double terminalVelocity_, float maxVelocity_, int targetX_, int targetY_); + 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 :