abstractrobot.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Robot Group Leipzig                             *
00003  *    martius@informatik.uni-leipzig.de                                    *
00004  *    fhesse@informatik.uni-leipzig.de                                     *
00005  *    der@informatik.uni-leipzig.de                                        *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  *                                                                         *
00022  *   $Log: abstractrobot.h,v $
00023  *   Revision 1.4  2007/11/06 14:57:30  martius
00024  *   motor and sensor type moved into class
00025  *
00026  *   Revision 1.3  2006/08/04 15:16:12  martius
00027  *   documentation
00028  *
00029  *   Revision 1.2  2006/07/14 12:23:57  martius
00030  *   selforg becomes HEAD
00031  *
00032  *   Revision 1.1.2.2  2006/06/25 16:51:35  martius
00033  *   configureable has name and revision
00034  *   a robot is configureable by default
00035  *
00036  *   Revision 1.1.2.1  2005/11/14 17:37:56  martius
00037  *   moved to selforg
00038  *
00039  *   Revision 1.11  2005/10/06 17:14:24  martius
00040  *   switched to stl lists
00041  *
00042  *   Revision 1.10  2005/09/22 12:24:36  martius
00043  *   removed global variables
00044  *   OdeHandle and GlobalData are used instead
00045  *   sensor prepared
00046  *
00047  *   Revision 1.9  2005/09/22 07:30:53  martius
00048  *   moved color and position into extra modules
00049  *
00050  *   Revision 1.8  2005/09/12 00:10:44  martius
00051  *   position operators are const
00052  *
00053  *   Revision 1.7  2005/08/30 16:53:53  martius
00054  *   Position struct has toArray and operators
00055  *
00056  *   Revision 1.6  2005/08/29 06:40:35  martius
00057  *   added virtual destructor
00058  *
00059  *   Revision 1.5  2005/08/22 20:32:45  martius
00060  *   robot has a name
00061  *
00062  *   Revision 1.4  2005/07/27 13:22:16  martius
00063  *   position and color have constructors
00064  *   ODEHandle
00065  *
00066  *   Revision 1.3  2005/07/18 14:47:41  martius
00067  *   world, space, contactgroup are not pointers anymore.
00068  *
00069  *   Revision 1.2  2005/07/07 09:27:11  martius
00070  *   isGeomInObjectList added
00071  *
00072  *   Revision 1.1  2005/06/15 14:20:04  martius
00073  *   moved into robots
00074  *                                                                 *
00075  ***************************************************************************/
00076 #ifndef __ABSTRACTROBOT_H
00077 #define __ABSTRACTROBOT_H
00078 
00079 #include <vector>
00080  
00081 #include "trackable.h"
00082 #include "configurable.h"
00083 #include "position.h"
00084 
00085 /**
00086  * Abstract class (interface) for robot in general
00087  * 
00088  * 
00089  */
00090 class AbstractRobot : public Trackable, public Configurable {
00091 public:
00092   typedef double sensor;
00093   typedef double motor;
00094 
00095   /**
00096    * Constructor
00097    * @param name name of the robot
00098    * @param revision revision number of the file (Hint: use CVS variable \verbatim $ID$ \endverbatim )
00099    */
00100   AbstractRobot(const std::string& name="abstractRobot", const std::string& revision = "$ID$")
00101     : Configurable(name, revision) {
00102   };
00103 
00104   virtual ~AbstractRobot(){}
00105 
00106   /** returns actual sensorvalues
00107       @param sensors sensors scaled to [-1,1] 
00108       @param sensornumber length of the sensor array
00109       @return number of actually written sensors
00110   */
00111   virtual int getSensors(sensor* sensors, int sensornumber)=0;
00112 
00113   /** sets actual motorcommands
00114       @param motors motors scaled to [-1,1] 
00115       @param motornumber length of the motor array
00116   */
00117   virtual void setMotors(const motor* motors, int motornumber)=0;
00118 
00119   /** returns number of sensors
00120   */
00121   virtual int getSensorNumber()=0;
00122 
00123   /** returns number of motors
00124   */
00125   virtual int getMotorNumber()=0;
00126 
00127   
00128 
00129 };
00130 
00131 #endif
00132  

Generated on Fri Oct 30 16:29:01 2009 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.4.7