Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SerialMultiByte QEI omni_wheel PID R1370MeasuringWheel IRsensor ikarashiMDC_2byte_ver Eigen
position_controller.h
00001 #ifndef POSITION_CONTROLLER_H 00002 #define POSITION_CONTROLLER_H 00003 00004 #include "mbed.h" 00005 #include "Geometry.h" 00006 //#define M_PI 3.141592653589793238462643383219502884 00007 00008 class PositionController { 00009 public : 00010 PositionController(double accDistance_, double decDistance_, double initialVelocity_, double terminalVelocity_, float maxVelocity_); 00011 00012 void compute(int positionX, int positionY); 00013 void targetXY(int targetX_, int targetY_); 00014 double getVelocityX(); 00015 double getVelocityY(); 00016 private : 00017 00018 double generateSineWave(double x, double initV, double termV, double start, double length); 00019 00020 double accDistance; 00021 double decDistance; 00022 double accTrue; 00023 double decTrue; 00024 double initialVelocity; 00025 double terminalVelocity; 00026 float maxVelocity; 00027 double target; 00028 int targetX; 00029 int targetY; 00030 double radians; 00031 double velocity[2]; 00032 00033 bool enoughDistance; 00034 00035 double getVelocity(int position); 00036 }; 00037 #endif 00038
Generated on Sun Jul 24 2022 22:03:37 by
1.7.2