kheperamotors.h
1 /********************************************************************************
2  * FARSA Experimentes Library *
3  * Copyright (C) 2007-2012 *
4  * Gianluca Massera <emmegian@yahoo.it> *
5  * Stefano Nolfi <stefano.nolfi@istc.cnr.it> *
6  * Tomassino Ferrauto <tomassino.ferrauto@istc.cnr.it> *
7  * Onofrio Gigliotta <onofrio.gigliotta@istc.cnr.it> *
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17  * GNU General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU General Public License *
20  * along with this program; if not, write to the Free Software *
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
22  ********************************************************************************/
23 
24 #ifndef KHEPERAMOTORS_H
25 #define KHEPERAMOTORS_H
26 
27 #include "experimentsconfig.h"
28 #include "neuroninterfaces.h"
29 #include "robots.h"
30 #include "motors.h"
31 
32 namespace farsa {
33 
52 class FARSA_EXPERIMENTS_API KheperaMotor : public Motor
53 {
54 public:
66  KheperaMotor(ConfigurationParameters& params, QString prefix);
67 
71  virtual ~KheperaMotor();
72 
81  virtual void save(ConfigurationParameters& params, QString prefix);
82 
89  static void describe(QString type);
90 
91 protected:
99  virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
100 
105 
111 };
112 
124 class FARSA_EXPERIMENTS_API KheperaWheelVelocityMotor : public KheperaMotor
125 {
126 public:
134  KheperaWheelVelocityMotor(ConfigurationParameters& params, QString prefix);
135 
139  virtual ~KheperaWheelVelocityMotor();
140 
149  virtual void save(ConfigurationParameters& params, QString prefix);
150 
156  static void describe(QString type);
157 
162  virtual void update();
163 
169  virtual int size();
170 
171 private:
179  virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
180 
184  PhyKhepera* m_robot;
185 
189  NeuronsIterator* m_neuronsIterator;
190 };
191 
192 }
193 
194 #endif