From c1caec3e393909b6c60e65e7c603cfde4a2bf78b Mon Sep 17 00:00:00 2001 From: haller Date: Fri, 22 Apr 2005 21:13:26 +0000 Subject: Début de définition d'interface pour la classe Ai --- 2005/i/robert/src/ai/ai.cc | 25 +++++++++++++++++ 2005/i/robert/src/ai/ai.hh | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 2005/i/robert/src/ai/ai.cc create mode 100644 2005/i/robert/src/ai/ai.hh (limited to '2005/i/robert') 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 -- cgit v1.2.3