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 ** Started on Mon Oct 15 18:01:12 2007 Georg Martius 00023 ** Last update Mon Oct 15 18:01:12 2007 Georg Martius 00024 * * 00025 * DESCRIPTION * 00026 * * 00027 * $Log: motor.h,v $ 00028 * Revision 1.1 2007/11/07 13:17:40 martius 00029 * motors in a general sense (like sound, light,...) 00030 * 00031 * 00032 * * 00033 ***************************************************************************/ 00034 #ifndef MOTOR_H_ 00035 # define MOTOR_H_ 00036 00037 namespace lpzrobots { 00038 00039 /** 00040 Abstact base class for attachable motors 00041 */ 00042 class Motor{ 00043 public: 00044 Motor() { 00045 } 00046 virtual ~Motor() {}; 00047 00048 /** initialises motor with body of robot 00049 */ 00050 virtual void init(Primitive* own)=0; 00051 00052 /// return the dimensionality of this motor 00053 virtual int getMotorNumber() const =0; 00054 00055 /** performs the actions, This is usually called in 00056 doInternalStuff() from the robot */ 00057 virtual bool act(GlobalData& globaldata) = 0; 00058 00059 /** sends the action commands to the motor. 00060 It returns the number of used values. (should be equal to 00061 getMotorNumber) 00062 */ 00063 virtual int set(const motor* values, int length) = 0; 00064 }; 00065 } 00066 00067 #endif /* !MOTOR_H_ */