00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
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