From bc0b19ccf181a7b4e62a7ae1772391cacb25f279 Mon Sep 17 00:00:00 2001 From: u-siri-ous Date: Sat, 14 Mar 2020 19:43:51 +0100 Subject: [PATCH] started thinking about goalie, to be tested, dunno if it works --- src/strategy_roles/goalie.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/strategy_roles/goalie.cpp b/src/strategy_roles/goalie.cpp index 4085f83..cbcc3d7 100644 --- a/src/strategy_roles/goalie.cpp +++ b/src/strategy_roles/goalie.cpp @@ -30,19 +30,23 @@ int dir, degrees2; void Goalie::goalie(int plusang) { if(ball->distance < CATCH_DIST) drive->prepareDrive(ball->angle, 350, 0); else{ - if(ball->angle > 345 || ball->angle < 15) plusang *= 0.15; +/* if(ball->angle > 345 || ball->angle < 15) plusang *= 0.15; + FRONT */ + if (ball->angle > 345 && ball->angle < 15) plusang *= 0.15; if(ball->angle > 180) degrees2 = ball->angle - 360; else degrees2 = ball->angle; if(degrees2 > 0) dir = ball->angle + plusang; //45 con 8 ruote - else dir = ball->angle - plusang; //45 con 8 ruote + else dir = ball->angle - plusang; //45 con 8 ruote if(dir < 0) dir = dir + 360; else dir = dir; storcimentoPorta(); - if(ball->distance > TILT_DIST && (ball->angle > 340 || ball->angle < 20)) drive->prepareDrive(dir, 350, cstorc); - else { + if(ball->distance > TILT_DIST && (ball->angle > 340 || ball->angle < 20)){ + plusang -= 20; + drive->prepareDrive(dir, 350, cstorc); + } else { drive->prepareDrive(dir, 350, 0); cstorc = 0; }