shortcircuit.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: shortcircuit.h,v $ 00023 * Revision 1.5 2006/12/11 18:24:37 martius 00024 * memory freed 00025 * 00026 * Revision 1.4 2006/07/14 12:23:42 martius 00027 * selforg becomes HEAD 00028 * 00029 * Revision 1.3.4.6 2006/03/30 12:34:57 martius 00030 * documentation updated 00031 * 00032 * Revision 1.3.4.5 2006/01/10 21:46:34 martius 00033 * collcallbak 00034 * 00035 * Revision 1.3.4.4 2006/01/10 20:32:58 martius 00036 * moved to osg 00037 * 00038 * Revision 1.3.4.3 2005/11/16 11:26:53 martius 00039 * moved to selforg 00040 * 00041 * Revision 1.3.4.2 2005/11/15 12:29:27 martius 00042 * new selforg structure and OdeAgent, OdeRobot ... 00043 * 00044 * Revision 1.3.4.1 2005/11/14 17:37:18 martius 00045 * moved to selforg 00046 * 00047 * Revision 1.3 2005/09/22 12:24:37 martius 00048 * removed global variables 00049 * OdeHandle and GlobalData are used instead 00050 * sensor prepared 00051 * 00052 * Revision 1.2 2005/07/18 14:47:41 martius 00053 * world, space, contactgroup are not pointers anymore. 00054 * 00055 * Revision 1.1 2005/07/06 16:03:37 martius 00056 * dummy robot that connects motors with sensors 00057 * 00058 ***************************************************************************/ 00059 #ifndef __SHORTCIRCUIT_H 00060 #define __SHORTCIRCUIT_H 00061 00062 00063 #include "oderobot.h" 00064 00065 namespace lpzrobots { 00066 00067 /** 00068 * 00069 */ 00070 class ShortCircuit : public OdeRobot{ 00071 public: 00072 ShortCircuit(const OdeHandle& odeHandle, const OsgHandle& osgHandle, int sensornumber, int motornumber); 00073 00074 ~ShortCircuit(); 00075 00076 virtual void update() {} 00077 00078 /** sets the pose of the vehicle 00079 @param pose desired 4x4 pose matrix 00080 */ 00081 virtual void place(const osg::Matrix& pose) {} 00082 00083 /** returns actual sensorvalues 00084 @param sensors sensors scaled to [-1,1] 00085 @param sensornumber length of the sensor array 00086 @return number of actually written sensors 00087 */ 00088 virtual int getSensors(sensor* sensors, int sensornumber); 00089 00090 /** sets actual motorcommands 00091 @param motors motors scaled to [-1,1] 00092 @param motornumber length of the motor array 00093 */ 00094 virtual void setMotors(const motor* motors, int motornumber); 00095 00096 /** returns number of sensors 00097 */ 00098 virtual int getSensorNumber() {return sensorno; } 00099 00100 /** returns number of motors 00101 */ 00102 virtual int getMotorNumber() {return motorno; } 00103 00104 /** this function is called in each timestep. It should perform robot-internal checks, 00105 like space-internal collision detection, sensor resets/update etc. 00106 @param globalData structure that contains global data from the simulation environment 00107 */ 00108 virtual void doInternalStuff(const GlobalData& globalData) {} 00109 00110 virtual bool collisionCallback(void *data, dGeomID o1, dGeomID o2) { return false;} 00111 00112 protected: 00113 /** the main object of the robot, which is used for position and speed tracking */ 00114 virtual Primitive* getMainPrimitive() const { return 0; } 00115 00116 protected: 00117 int sensorno; //number of sensors 00118 int motorno; // number of motors 00119 motor* motors; 00120 } ; 00121 00122 } 00123 00124 #endif 00125

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