experiments/include/marxbotsensors.h

00001 /********************************************************************************
00002  *  FARSA Experimentes Library                                                  *
00003  *  Copyright (C) 2007-2012                                                     *
00004  *  Gianluca Massera <emmegian@yahoo.it>                                        *
00005  *  Stefano Nolfi <stefano.nolfi@istc.cnr.it>                                   *
00006  *  Tomassino Ferrauto <tomassino.ferrauto@istc.cnr.it>                         *
00007  *                                                                              *
00008  *  This program is free software; you can redistribute it and/or modify        *
00009  *  it under the terms of the GNU General Public License as published by        *
00010  *  the Free Software Foundation; either version 2 of the License, or           *
00011  *  (at your option) any later version.                                         *
00012  *                                                                              *
00013  *  This program is distributed in the hope that it will be useful,             *
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of              *
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
00016  *  GNU General Public License for more details.                                *
00017  *                                                                              *
00018  *  You should have received a copy of the GNU General Public License           *
00019  *  along with this program; if not, write to the Free Software                 *
00020  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  *
00021  ********************************************************************************/
00022 
00023 #ifndef MARXBOTSENSORS_H
00024 #define MARXBOTSENSORS_H
00025 
00026 #include "experimentsconfig.h"
00027 #include "neuroninterfaces.h"
00028 #include "world.h"
00029 #include "robots.h"
00030 #include "phybox.h"
00031 #include "phycylinder.h"
00032 
00033 namespace farsa {
00034 
00053 class MarXbotSensor : public Sensor
00054 {
00055 public:
00067     MarXbotSensor(ConfigurationParameters& params, QString prefix);
00068 
00072     virtual ~MarXbotSensor();
00073 
00082     virtual void save(ConfigurationParameters& params, QString prefix);
00083 
00090     static void describe(QString type);
00091 
00092 protected:
00100     virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
00101 
00105     QString m_marxbotResource;
00106 
00111     QString m_neuronsIteratorResource;
00112 };
00113 
00125 class FARSA_EXPERIMENTS_API MarXbotProximityIRSensor : public MarXbotSensor
00126 {
00127 public:
00135     MarXbotProximityIRSensor(ConfigurationParameters& params, QString prefix);
00136 
00140     virtual ~MarXbotProximityIRSensor();
00141 
00150     virtual void save(ConfigurationParameters& params, QString prefix);
00151 
00157     static void describe(QString type);
00158 
00163     virtual void update();
00164 
00170     virtual int size();
00171 
00172 private:
00180     virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
00181 
00185     PhyMarXbot* m_robot;
00186 
00190     NeuronsIterator* m_neuronsIterator;
00191 };
00192 
00204 class FARSA_EXPERIMENTS_API MarXbotGroundBottomIRSensor : public MarXbotSensor
00205 {
00206 public:
00214     MarXbotGroundBottomIRSensor(ConfigurationParameters& params, QString prefix);
00215 
00219     virtual ~MarXbotGroundBottomIRSensor();
00220 
00229     virtual void save(ConfigurationParameters& params, QString prefix);
00230 
00236     static void describe(QString type);
00237 
00242     virtual void update();
00243 
00249     virtual int size();
00250 
00251 private:
00259     virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
00260 
00264     PhyMarXbot* m_robot;
00265 
00269     NeuronsIterator* m_neuronsIterator;
00270 };
00271 
00284 class FARSA_EXPERIMENTS_API MarXbotGroundAroundIRSensor : public MarXbotSensor
00285 {
00286 public:
00294     MarXbotGroundAroundIRSensor(ConfigurationParameters& params, QString prefix);
00295 
00299     virtual ~MarXbotGroundAroundIRSensor();
00300 
00309     virtual void save(ConfigurationParameters& params, QString prefix);
00310 
00316     static void describe(QString type);
00317 
00322     virtual void update();
00323 
00329     virtual int size();
00330 
00331 private:
00339     virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
00340 
00344     PhyMarXbot* m_robot;
00345 
00349     NeuronsIterator* m_neuronsIterator;
00350 };
00351 
00352 }
00353 
00354 #endif