wheelie.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 * frankguettler@gmx.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 * $Log: wheelie.h,v $ 00024 * Revision 1.3 2006/07/20 17:19:45 martius 00025 * removed using namespace std from matrix.h 00026 * 00027 * Revision 1.2 2006/07/14 12:23:43 martius 00028 * selforg becomes HEAD 00029 * 00030 * Revision 1.1.2.3 2006/06/25 16:57:17 martius 00031 * abstractrobot is configureable 00032 * name and revision 00033 * 00034 * Revision 1.1.2.2 2006/06/20 07:18:29 robot3 00035 * -added cvs log 00036 * -changed some behaviour of wheelie 00037 * 00038 * * 00039 ***************************************************************************/ 00040 #ifndef __WHEELIE_H 00041 #define __WHEELIE_H 00042 00043 #include "defaultWheelie.h" 00044 #include "hingeservo.h" 00045 00046 namespace lpzrobots { 00047 00048 /** 00049 * This is a class, which models an annular robot. 00050 * It consists of a number of equal elements, each linked 00051 * by a joint powered by 1 servo 00052 **/ 00053 class Wheelie : public DefaultWheelie 00054 { 00055 private: 00056 std::vector <HingeServo*> hingeServos; 00057 00058 public: 00059 Wheelie(const OdeHandle& odeHandle, const OsgHandle& osgHandle, 00060 const WheelieConf& conf, const std::string& name); 00061 00062 virtual ~Wheelie(); 00063 00064 /** 00065 *Reads the actual motor commands from an array, 00066 *an sets all motors of the snake to this values. 00067 *It is an linear allocation. 00068 *@param motors pointer to the array, motor values are scaled to [-1,1] 00069 *@param motornumber length of the motor array 00070 **/ 00071 virtual void setMotors ( const motor* motors, int motornumber ); 00072 00073 /** 00074 *Writes the sensor values to an array in the memory. 00075 *@param sensors pointer to the array 00076 *@param sensornumber length of the sensor array 00077 *@return number of actually written sensors 00078 **/ 00079 virtual int getSensors ( sensor* sensors, int sensornumber ); 00080 00081 /** returns number of sensors 00082 */ 00083 virtual int getSensorNumber() { assert(created); return hingeServos.size(); } 00084 00085 /** returns number of motors 00086 */ 00087 virtual int getMotorNumber(){ assert(created); return hingeServos.size(); } 00088 00089 virtual bool setParam(const paramkey& key, paramval val); 00090 00091 private: 00092 virtual void create(const osg::Matrix& pose); 00093 virtual void destroy(); 00094 }; 00095 00096 } 00097 00098 #endif

Generated on Tue Jan 16 02:14:38 2007 for Robotsystem of the Robot Group Leipzig by doxygen 1.3.8