From 56e637ec77fc6c220009663dcc35712e399bfd5d Mon Sep 17 00:00:00 2001 From: dufourj Date: Fri, 26 May 2006 08:12:24 +0000 Subject: Général : - commit du programme d'après premier match. --- i/marvin/src/ai/ai.cc | 63 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 14 deletions(-) (limited to 'i/marvin/src/ai/ai.cc') diff --git a/i/marvin/src/ai/ai.cc b/i/marvin/src/ai/ai.cc index ac06157..19f3cca 100644 --- a/i/marvin/src/ai/ai.cc +++ b/i/marvin/src/ai/ai.cc @@ -132,7 +132,6 @@ Ai::waitJack (bool out) void Ai::prepare (void) { - es_.lcdPrint(""); es_.lcdPrint(""); es_.lcdPrint("Prepa match..."); es_.lcdPrint("Inserer Jack"); @@ -146,8 +145,8 @@ Ai::prepare (void) // Set actual position motor_.getAsserv().setPos(0,0,0); es_.barilletInit(); - es_.lcdPrint("Virer le jack..."); - es_.lcdPrint("PRET POUR MATCH"); + es_.lcdPrint("Barillet pret ?"); + es_.lcdPrint("Virer le jack !"); while (!update ()); // We first wait for the jack to be put inside waitJack (true); @@ -166,7 +165,7 @@ Ai::afterMatch(void) { // On attend de mettre le jack après le match es_.lcdPrint("FIN DU MATCH"); - es_.lcdPrint("Inserer jack..."); +// es_.lcdPrint("Inserer jack..."); while (!update()); waitJack(false); // On vide le barillet @@ -260,7 +259,8 @@ void Ai::progHomoloRobal(void) void Ai::progMatch(void) { - bool isFinish; + init (); +// bool isFinish; /// On prépare le robot prepare(); /// Faire des crêpes... @@ -270,21 +270,56 @@ Ai::progMatch(void) temporisation (1000); es_.barilletLancement(); while (!update ()); + log_ ("match") << "Totem activator"; + es_.totemActivator (true); /// En avant guingamp + log_ ("match") << "Eloignement du bord"; motorMove(480,0); /// On tourner de -90° - motorMove(432,432); + log_ ("match") << "Petite rotation de 90°"; + motorMove(216,-216); /// On dit bonjour au mur - if(motorMove(900, 0)) - motorMove(200, 0); + log_ ("match") << "Va à l'opposé"; + if (!motorMove (1000, 0)) + { + log_ ("match") << "Un mur ! Reculons"; + motorMove (-70, 0); + } +// motorMove(200, 0); /// On tourne bizarrement mais de 90° - motorMove(-72,-72); - motorMove(360,-360); + log_ ("match") << "On tourne à 90° en deux fois"; + motorMove(-36,36); + motorMove(190, 190); /// On avance un peu - motorMove(150,0); - // On tourne de 90° - motorMove(432,-432); - motorMove(1400,0); +// log_ ("match") << "On recule un peu"; +// motorMove (-110, 0); +// // On tourne de 90° +// log_ ("match") << "On tourne vers le totem"; +// motorMove (216, 216); +// log_ ("match") << "On avance"; +// motorMove (950, 0); +// log_ ("match") << "Petite rotation de 90° droite"; +// motorMove (316, -316); +// motorMove (800, 0); +// motorBasicFindHole (); + log_ ("match") << "On avance de l'autre coté"; + motorMove (1320, 0); + log_ ("match") << "On recule un peu"; + motorMove (-420, 0); + log_ ("match") << "On tourne"; + motorMove (150, 150); + motorBasicFindHole (); + es_.dropWhiteBall(); + while (!update ()); + temporisation (3000); + es_.deposeBalle (); + while (!update ()); + motorBasicFindHole (); + es_.dropWhiteBall(); + while (!update ()); + temporisation (3000); + es_.deposeBalle (); + afterMatch(); } -- cgit v1.2.3