From b45c36c90b39421a757fb907f34fba58838cc050 Mon Sep 17 00:00:00 2001 From: dufourj Date: Thu, 25 May 2006 16:36:21 +0000 Subject: Homologation coupe. --- i/marvin/src/ai/ai.cc | 31 +++++++++++++++++++++++++++++-- i/marvin/src/es/es.cc | 14 +++++++------- i/marvin/src/proto/proto.cc | 2 +- 3 files changed, 37 insertions(+), 10 deletions(-) (limited to 'i/marvin') 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 diff --git a/i/marvin/src/es/es.cc b/i/marvin/src/es/es.cc index e8b5f72..4d541ef 100644 --- a/i/marvin/src/es/es.cc +++ b/i/marvin/src/es/es.cc @@ -554,8 +554,8 @@ void Es::receive(char command, const Proto::Frame & frame) colorModeBlue_ = true; else colorModeBlue_ = false; - log_ ("Others", Log::debug) << "Color mode " << (colorModeBlue_ ? "Blue" : "Red") - << (jackIn_ ? ", jack in..." : ", jack out !!!"); +// log_ ("Others", Log::debug) << "Color mode " << (colorModeBlue_ ? "Blue" : "Red") +// << (jackIn_ ? ", jack in..." : ", jack out !!!"); } break; /* LCD */ @@ -620,27 +620,27 @@ Es::newBallFront(void) switch (positionBarillet_) { case avant0: - stockBarillet[0] = colorSeen(frontBallRVB_)==whiteColor_?white:black; + stockBarillet[0] = colorSeen(frontBallRVB_)==whiteColor_?white:white; positionBarillet_ = avant4; log_ ("Es::Barillet", Log::debug) << "trou 0:" << ((stockBarillet[0] == white)?"white":"pas white"); break; case avant1: - stockBarillet[1] = colorSeen(frontBallRVB_)==whiteColor_?white:black; + stockBarillet[1] = colorSeen(frontBallRVB_)==whiteColor_?white:white; positionBarillet_ = avant0; log_ ("Es::Barillet", Log::debug) << "trou 1:" << ((stockBarillet[1] == white)?"white":"pas white"); break; case avant2: - stockBarillet[2] = colorSeen(frontBallRVB_)==whiteColor_?white:black; + stockBarillet[2] = colorSeen(frontBallRVB_)==whiteColor_?white:white; positionBarillet_ = avant1; log_ ("Es::Barillet", Log::debug) << "trou 2:" << ((stockBarillet[2] == white)?"white":"pas white"); break; case avant3: - stockBarillet[3] = colorSeen(frontBallRVB_)==whiteColor_?white:black; + stockBarillet[3] = colorSeen(frontBallRVB_)==whiteColor_?white:white; positionBarillet_ = avant2; log_ ("Es::Barillet", Log::debug) << "trou 3:" << ((stockBarillet[3] == white)?"white":"pas white"); break; case avant4: - stockBarillet[4] = colorSeen(frontBallRVB_)==whiteColor_?white:black; + stockBarillet[4] = colorSeen(frontBallRVB_)==whiteColor_?white:white; positionBarillet_ = avant3; log_ ("Es::Barillet", Log::debug) << "trou 4:" << ((stockBarillet[4] == white)?"white":"pas white"); break; diff --git a/i/marvin/src/proto/proto.cc b/i/marvin/src/proto/proto.cc index 4380f07..1bc560f 100644 --- a/i/marvin/src/proto/proto.cc +++ b/i/marvin/src/proto/proto.cc @@ -288,7 +288,7 @@ Proto::getFrame(void) // On renvoie en mettant le compteur à 0, la commande sera // renvoyer de retour à sync // log_("Erreur de reception", Log::debug) -// << "commande inconnue" << ""; +// << "commande inconnue" << ""; tLastSend_ = 0; revState_ = 0; return false; -- cgit v1.2.3