holon movement: recalculate max possible velocity

The velocity has been calculated by using the holon movement formulas in an excel spritesheetand and empirically tested to find a suitable value
pull/1/head
EmaMaker 2021-03-01 18:35:54 +01:00
parent 71cf8ff249
commit 7deaeff7c0
3 changed files with 8 additions and 2 deletions

View File

@ -18,6 +18,12 @@
#define UNLOCK_THRESH 800
#define MAX_VEL 310
#define MAX_VEL_EIGTH 248
#define MAX_VEL_HALF 155
#define MAX_VEL_3QUARTERS 232
#define MAX_VEL_QUARTER 78
class DriveController{
public:

View File

@ -58,7 +58,7 @@ void Striker::striker()
dir = dir + 360; //se sto nel quadrante negativo ricappotto
else
dir = dir;
drive->prepareDrive(dir, 100, 0);
drive->prepareDrive(dir, MAX_VEL_EIGTH, 0);
}
void Striker::storcimentoPorta()

View File

@ -118,7 +118,7 @@ void PositionSysCamera::CameraPID(){
dir = (dir+360) % 360;
int dist = sqrt(Outputx*Outputx + Outputy*Outputy);
int speed = map(dist*DIST_MULT, 0, MAX_DIST, 0, 350);
int speed = map(dist*DIST_MULT, 0, MAX_DIST, 0, MAX_VEL);
drive->prepareDrive(dir, speed, 0);