experiments/include/marxbotmotors.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  *  Onofrio Gigliotta <onofrio.gigliotta@istc.cnr.it>                           *
00008  *                                                                              *
00009  *  This program is free software; you can redistribute it and/or modify        *
00010  *  it under the terms of the GNU General Public License as published by        *
00011  *  the Free Software Foundation; either version 2 of the License, or           *
00012  *  (at your option) any later version.                                         *
00013  *                                                                              *
00014  *  This program is distributed in the hope that it will be useful,             *
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of              *
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
00017  *  GNU General Public License for more details.                                *
00018  *                                                                              *
00019  *  You should have received a copy of the GNU General Public License           *
00020  *  along with this program; if not, write to the Free Software                 *
00021  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  *
00022  ********************************************************************************/
00023 
00024 #ifndef MARXBOTMOTORS_H
00025 #define MARXBOTMOTORS_H
00026 
00027 #include "experimentsconfig.h"
00028 #include "neuroninterfaces.h"
00029 #include "robots.h"
00030 #include "motors.h"
00031 
00032 namespace farsa {
00033 
00052 class MarXbotMotor : public Motor
00053 {
00054 public:
00066     MarXbotMotor(ConfigurationParameters& params, QString prefix);
00067 
00071     virtual ~MarXbotMotor();
00072 
00081     virtual void save(ConfigurationParameters& params, QString prefix);
00082 
00089     static void describe(QString type);
00090 
00091 protected:
00099     virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
00100 
00104     QString m_marxbotResource;
00105 
00110     QString m_neuronsIteratorResource;
00111 };
00112 
00124 class FARSA_EXPERIMENTS_API MarXbotWheelVelocityMotor : public MarXbotMotor
00125 {
00126 public:
00134     MarXbotWheelVelocityMotor(ConfigurationParameters& params, QString prefix);
00135 
00139     virtual ~MarXbotWheelVelocityMotor();
00140 
00149     virtual void save(ConfigurationParameters& params, QString prefix);
00150 
00156     static void describe(QString type);
00157 
00162     virtual void update();
00163 
00169     virtual int size();
00170 
00171 private:
00179     virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
00180 
00184     PhyMarXbot* m_robot;
00185 
00189     NeuronsIterator* m_neuronsIterator;
00190 };
00191 
00192 }
00193 
00194 #endif