summaryrefslogtreecommitdiff
path: root/i/marvin/src/ai/ai.cc
diff options
context:
space:
mode:
authorhaller2006-05-24 20:51:29 +0000
committerhaller2006-05-24 20:51:29 +0000
commita6f4b5ecbc52fc438a6c48a8d3a0ef20f34dec90 (patch)
treea6ffa59657a98320d22e5158e52d3240bf986d7a /i/marvin/src/ai/ai.cc
parent7fcd40ef44f7df3db0d26eaef5ee108307aa1881 (diff)
* TestAI qui compile
* Ajout du Makefile.defs du répertoire ai * Ajout d'une fonction getFd dans Motor
Diffstat (limited to 'i/marvin/src/ai/ai.cc')
-rw-r--r--i/marvin/src/ai/ai.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/i/marvin/src/ai/ai.cc b/i/marvin/src/ai/ai.cc
index 1adcf5e..bbf3158 100644
--- a/i/marvin/src/ai/ai.cc
+++ b/i/marvin/src/ai/ai.cc
@@ -22,10 +22,17 @@
// Email: <nicolas@boiteameuh.org>
// }}}
#include "ai.hh"
+#include "config/config.hh"
+#include "timer/timer.hh"
+
+/// Fonction callback useless
+static void
+callback (void)
+{}
//constructeur
Ai::Ai (const Config & config)
- : motor_(config), es_(config), log_ ("Ai"),
+ :es_(config), log_ ("Ai"),
schedulableMotor_(callback, motor_.getFd()),
schedulableEs_(callback, es_.getFd()),
round_duration_ (config.get<int> ("ai.round_duration")),
@@ -114,7 +121,7 @@ Ai::waitJack (bool out)
{
do
{
- udpate ();
+ update ();
}
while (es_.isJackOut () != out);
}
@@ -156,21 +163,21 @@ void Ai::progHomoloRobal(void)
/// PAF BEGIN!!! (lancer le timer)
Timer::startRound();
/// on avance un poil parce que le mur c'est mal
- move(400, 0);
+ motor_.move(400, 0);
/// On tourne XXX
- rotate(-M_PI/4);
+ motor_.rotate(-M_PI/4);
/// On cherche au moins une balle (sinon c'est con)
- barilletLancement();
+ es_.barilletLancement();
/// XXX Avancer d'une certaine facon pour choper des balles
/// XXX Ouais ba y'a encore ddes truc à faire là
/// On cherche un tru (repositionnement??)
- motor_.lockGoodHole();
+ // XXX motor_.lockGoodHole();
motor_.findHole();
/// On trouve un trou, chouette
/// Aspirer le trou
es_.extraitBalle();
/// mettre une baballe
- es_.deposeBlanche();
+ // XXX es_.deposeBlanche();
/// Tourner 3 fois en chantant du Mickael Jackson
/// Again....
/// Fin du match