summaryrefslogtreecommitdiff
path: root/i/marvin/src/ai
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/ai')
-rw-r--r--i/marvin/src/ai/ai.cc31
1 files changed, 29 insertions, 2 deletions
diff --git a/i/marvin/src/ai/ai.cc b/i/marvin/src/ai/ai.cc
index 986f53b..53f191e 100644
--- a/i/marvin/src/ai/ai.cc
+++ b/i/marvin/src/ai/ai.cc
@@ -84,7 +84,9 @@ Ai::stop (void)
bool
Ai::sync (void)
{
- return es_.sync () && motor_.sync ();
+ bool motor = motor_.sync ();
+ bool es = es_.sync ();
+ return es && motor;
}
/// Wait for something to happened
@@ -144,6 +146,9 @@ Ai::prepare (void)
// Ok the match begin ! Go go go !
Timer::startRound ();
es_.setOthersStat (0);
+ // Shut up fucking beach !
+ es_.setOthersStat (0);
+ es_.setOthersStat (0);
while (!update ());
}
@@ -172,10 +177,17 @@ void Ai::progHomoloRobal(void)
es_.barilletLancement();
while (!update ());
/// on avance un poil parce que le mur c'est mal
+ std::cout << "Move !" << std::endl;
motorMove(500, 0);
+ std::cout << "Rotate !" << std::endl;
motorRotate(-0.54);
+ std::cout << "Move !" << std::endl;
motorMove(1200, 0);
- motorRotate(M_PI);
+ std::cout << "Rotate !" << std::endl;
+ motorRotate(1.40);
+ motorMove(500, 0);
+// temporisation (100);
+ std::cout << "Find hole !" << std::endl;
motorFindHole ();
/// On tourne XXX
@@ -195,6 +207,21 @@ void Ai::progHomoloRobal(void)
/// mettre une baballe
es_.dropWhiteBall();
while (!update ());
+ temporisation (3000);
+ es_.deposeBalle ();
+ while (!update ());
+ temporisation (3000);
+ motorMove(300, 0);
+
+ std::cout << "Find hole !" << std::endl;
+ motorFindHole ();
+ es_.dropWhiteBall();
+ while (!update ());
+ temporisation (3000);
+ es_.deposeBalle ();
+ while (!update ());
+ temporisation (3000);
+ motorMove(300, 0);
/// Tourner 3 fois en chantant du Mickael Jackson
/// Again....
/// Fin du match