summaryrefslogtreecommitdiff
path: root/2005
diff options
context:
space:
mode:
authorhaller2005-04-22 21:13:26 +0000
committerhaller2005-04-22 21:13:26 +0000
commitc1caec3e393909b6c60e65e7c603cfde4a2bf78b (patch)
tree54c165f7c41abe821a50d604493e6dfde7bcda40 /2005
parent701de1aa1f9985f66c3af4e26ffe09c471b9a889 (diff)
Début de définition d'interface pour la classe Ai
Diffstat (limited to '2005')
-rw-r--r--2005/i/robert/src/ai/ai.cc25
-rw-r--r--2005/i/robert/src/ai/ai.hh69
2 files changed, 94 insertions, 0 deletions
diff --git a/2005/i/robert/src/ai/ai.cc b/2005/i/robert/src/ai/ai.cc
new file mode 100644
index 0000000..3e81151
--- /dev/null
+++ b/2005/i/robert/src/ai/ai.cc
@@ -0,0 +1,25 @@
+// ai.cc
+// robert - programme du robot 2005. {{{
+//
+// Copyright (C) 2005 Nicolas Haller
+//
+// Robot APB Team/Efrei 2005.
+// Web: http://assos.efrei.fr/robot/
+// Email: robot AT efrei DOT fr
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// }}}
+
diff --git a/2005/i/robert/src/ai/ai.hh b/2005/i/robert/src/ai/ai.hh
new file mode 100644
index 0000000..94b001e
--- /dev/null
+++ b/2005/i/robert/src/ai/ai.hh
@@ -0,0 +1,69 @@
+#ifndef ai_hh
+#define ai_hh
+// ai.hh
+// robert - programme du robot 2005. {{{
+//
+// Copyright (C) 2005 Nicolas Haller
+//
+// Robot APB Team/Efrei 2005.
+// Web: http://assos.efrei.fr/robot/
+// Email: robot AT efrei DOT fr
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// }}}
+
+/// Intelligence (encore plus heu...) artificielle
+class Ai
+{
+ private:
+ // Modules de controle du robot
+ Motor motor_;
+ // Gpio gpio_; // XXX
+ // Paramètre de Ai
+ const int roundDuration_;
+ // Etat du robot
+ bool enMouvement;
+
+ public:
+ /// Constructeur
+ Ai(const Config & config);
+ // Initialise le robot.
+ void init (void);
+ /// Arrète le robot.
+ void stop (void);
+ /// Lance le robot.
+ void run (int strat);
+ protected:
+ /// Lance le robot.
+ void run0 (void);
+ void run1 (void);
+ /// Attend.
+ void wait (int t);
+ // Attend le jack entré (false) ou sorti (true).
+ void waitJack (bool out);
+ /// Rejoint un point.
+ void goTo (double x, double y);
+ /// Recale contre une bordure.
+ void recale (void);
+ /// Recale et ajuste en X contre une bordure.
+ void recaleX (double x, double a);
+ /// Mouvement basic.
+ void basic (double v, double d);
+ /// Rotation.
+ void rotation (double a);
+};
+
+#endif // ai_hh