enki/robots/s-bot/Sbot.h

Go to the documentation of this file.
00001 /*
00002     Enki - a fast 2D robot simulator
00003     Copyright (C) 1999-2008 Stephane Magnenat <stephane at magnenat dot net>
00004     Copyright (C) 2004-2005 Markus Waibel <markus dot waibel at epfl dot ch>
00005     Copyright (c) 2004-2005 Antoine Beyeler <abeyeler at ab-ware dot com>
00006     Copyright (C) 2005-2006 Laboratory of Intelligent Systems, EPFL, Lausanne
00007     Copyright (C) 2006-2008 Laboratory of Robotics Systems, EPFL, Lausanne
00008     See AUTHORS for details
00009 
00010     This program is free software; the authors of any publication 
00011     arising from research using this software are asked to add the 
00012     following reference:
00013     Enki - a fast 2D robot simulator
00014     http://lis.epfl.ch/enki
00015     Stephane Magnenat <stephane at magnenat dot net>,
00016     Markus Waibel <markus dot waibel at epfl dot ch>
00017     Laboratory of Intelligent Systems, EPFL, Lausanne.
00018 
00019     You can redistribute this program and/or modify
00020     it under the terms of the GNU General Public License as published by
00021     the Free Software Foundation; either version 2 of the License, or
00022     (at your option) any later version.
00023 
00024     This program is distributed in the hope that it will be useful,
00025     but WITHOUT ANY WARRANTY; without even the implied warranty of
00026     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00027     GNU General Public License for more details.
00028 
00029     You should have received a copy of the GNU General Public License
00030     along with this program; if not, write to the Free Software
00031     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00032 */
00033 
00034 #ifndef __ENKI_SBOT_H
00035 #define __ENKI_SBOT_H
00036 
00037 #include <enki/robots/DifferentialWheeled.h>
00038 #include <enki/interactions/CircularCam.h>
00039 #include <enki/interactions/Microphone.h>
00040 #include <enki/interactions/ActiveSoundSource.h>
00041 #include <enki/robots/s-bot/SbotObject.h>
00042 
00047 namespace Enki
00048 {
00050 
00053     class SbotGlobalSound : public GlobalInteraction
00054     {
00055     protected:
00057         static unsigned worldFrequenciesState;
00058         
00059     public:
00061         unsigned frequenciesState;
00062         
00063     public:
00065         SbotGlobalSound (Robot *me) { this->owner = me; }
00067         virtual void init() { worldFrequenciesState = 0; }
00069         virtual void step(double dt, World *w) { worldFrequenciesState |= frequenciesState; }
00071         static unsigned getWorldFrequenciesState(void);
00072     };
00073 
00074 
00076 
00080     class SbotMicrophone : public FourWayMic
00081     {
00082     public:
00088         SbotMicrophone(Robot *owner, double micDist, double range,
00089                        MicrophoneResponseModel micModel, unsigned channels) :
00090             FourWayMic(owner, micDist, range, micModel, channels) {}
00092         void objectStep(double dt, PhysicalObject *po, World *w);
00093     };
00094 
00096 
00099     class Sbot : public DifferentialWheeled
00100     {
00101     public:
00103         OmniCam camera;
00105         SbotGlobalSound globalSound;
00106 
00107     public:
00109         Sbot();
00111         ~Sbot() {}
00112     };
00113 
00114 
00116 
00119     class FeedableSbot : public Sbot
00120     {
00121     public:
00123         double energy;
00125         double dEnergy;
00127         double lastDEnergy;
00128 
00130         FeedableSbot() { energy=0; dEnergy=0; lastDEnergy=0; }
00132         virtual void controlStep(double dt) ;
00133     };
00134 
00135 
00139 
00140     class SoundSbot : public FeedableSbot
00141     {
00142     public:
00144         SbotMicrophone mic;
00146         ActiveSoundSource speaker;
00147         virtual void step(double dt);
00148 
00149     public:
00151         SoundSbot();
00152     };
00153 }
00154 #endif
00155 

Generated on Sun Mar 1 03:10:09 2009 for Enki by  doxygen 1.5.1