summaryrefslogtreecommitdiff
path: root/i/marvin/src/ai/test_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/test_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/test_ai.cc')
-rw-r--r--i/marvin/src/ai/test_ai.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/i/marvin/src/ai/test_ai.cc b/i/marvin/src/ai/test_ai.cc
index 9412277..b4f3882 100644
--- a/i/marvin/src/ai/test_ai.cc
+++ b/i/marvin/src/ai/test_ai.cc
@@ -35,4 +35,46 @@ class TestAI : public Tester
{
// Update ?
}
+ public:
+ TestAI(int argc, char ** argv)
+ :Tester(argc, argv), ai_(config_)
+ {}
+ void preRun (void)
+ {
+ Interpreter &interpreter = getInterpreter();
+ // Add functions
+ interpreter.add("init", Interpreter::memFunc(ai_, &Ai::init),
+ "Initialise le robal(void)");
+ interpreter.add("stop", Interpreter::memFunc(ai_, &Ai::stop),
+ "Stop le robal(void)");
+ interpreter.add("tempo", Interpreter::memFunc(ai_,
+ &Ai::temporisation),
+ "On temporise(int msec)");
+ interpreter.add("jack", Interpreter::memFunc(ai_, &Ai::waitJack),
+ "On attend que le jack sorte/rentre(bool sorte)");
+ interpreter.add("sensors", Interpreter::memFunc(ai_,
+ &Ai::referenceSensors),
+ "Initialise les capteurs RVB(void)");
+ interpreter.add("homologation", Interpreter::memFunc(ai_,
+ &Ai::progHomoloRobal),
+ "Programme d'homologation du robal");
+ }
+ void postRun(void)
+ {
+ // On init le robal histoire de ...
+ ai_.init();
+ }
+};
+
+int main (int argc, char **argv)
+{
+ try
+ {
+ TestAI ta(argc, argv);
+ ta.run ();
+ }
+ catch (const std::exception &e)
+ {
+ std::cerr << e.what () << std::endl;
+ }
}