abstractrobot.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005-2011 LpzRobots development team                    *
00003  *    Georg Martius  <georg dot martius at web dot de>                     *
00004  *    Frank Guettler <guettler at informatik dot uni-leipzig dot de        *
00005  *    Frank Hesse    <frank at nld dot ds dot mpg dot de>                  *
00006  *    Ralf Der       <ralfder at mis dot mpg dot de>                       *
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                         *
00020  *   Free Software Foundation, Inc.,                                       *
00021  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00022  *                                                                         *
00023  ***************************************************************************/
00024 #ifndef __ABSTRACTROBOT_H
00025 #define __ABSTRACTROBOT_H
00026 
00027 #include <vector>
00028  
00029 #include "trackable.h"
00030 #include "configurable.h"
00031 #include "position.h"
00032 
00033 /**
00034  * Abstract class (interface) for robot in general
00035  * 
00036  * 
00037  */
00038 class AbstractRobot : public Trackable, public Configurable {
00039 public:
00040   typedef double sensor;
00041   typedef double motor;
00042 
00043   /**
00044    * Constructor
00045    * @param name name of the robot
00046    * @param revision revision number of the file (Hint: use CVS variable \verbatim $ID$ \endverbatim )
00047    */
00048   AbstractRobot(const std::string& name="abstractRobot", const std::string& revision = "$ID$")
00049     : Configurable(name, revision) {
00050   };
00051 
00052   virtual ~AbstractRobot(){}
00053 
00054   /** returns actual sensorvalues
00055       @param sensors sensors scaled to [-1,1] 
00056       @param sensornumber length of the sensor array
00057       @return number of actually written sensors
00058   */
00059   virtual int getSensors(sensor* sensors, int sensornumber)=0;
00060 
00061   /** sets actual motorcommands
00062       @param motors motors scaled to [-1,1] 
00063       @param motornumber length of the motor array
00064   */
00065   virtual void setMotors(const motor* motors, int motornumber)=0;
00066 
00067   /** returns number of sensors
00068   */
00069   virtual int getSensorNumber()=0;
00070 
00071   /** returns number of motors
00072   */
00073   virtual int getMotorNumber()=0;
00074 
00075   virtual std::string getTrackableName() const {return getName();}
00076 
00077 };
00078 
00079 #endif
00080  
Generated on Thu Jun 28 14:45:35 2012 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.6.3