barrel2masses.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 *************************************************************************** 00023 * * 00024 * cylinder like Robot inspired by Julius Popp's Adam. * 00025 * * 00026 * $Log: barrel2masses.h,v $ 00027 * Revision 1.2 2006/12/21 11:43:05 martius 00028 * commenting style for doxygen //< -> ///< 00029 * new sensors for spherical robots 00030 * 00031 * Revision 1.1 2006/12/01 16:21:15 martius 00032 * like sphere3masses, but with 2 masses and cylindric body 00033 * 00034 * 00035 * * 00036 ***************************************************************************/ 00037 00038 #ifndef __BARREL2MASSES_H 00039 #define __BARREL2MASSES_H 00040 00041 #include "primitive.h" 00042 #include "joint.h" 00043 #include "sliderservo.h" 00044 #include "oderobot.h" 00045 #include "raysensorbank.h" 00046 #include "sphererobot3masses.h" 00047 00048 namespace lpzrobots { 00049 00050 /* 00051 parameters for nice rolling modes: 00052 00053 Sphererobot3MassesConf conf = Sphererobot3Masses::getDefaultConf(); 00054 conf.pendularrange = 0.3; 00055 conf.motorsensor=false; 00056 conf.axisZsensor=true; 00057 conf.axisXYZsensor=false; 00058 conf.spheremass = 1; 00059 sphere1 = new Barrel2Masses ( odeHandle, osgHandle.changeColor(Color(0.0,0.0,1.0)), 00060 conf, "Barrel1", 0.2); 00061 sphere1->place ( osg::Matrix::rotate(M_PI/2, 1,0,0)); 00062 00063 controller = new InvertMotorNStep(); 00064 controller->setParam("steps", 2); 00065 controller->setParam("adaptrate", 0.0); 00066 controller->setParam("epsC", 0.03); 00067 controller->setParam("epsA", 0.05); 00068 controller->setParam("rootE", 3); 00069 controller->setParam("logaE", 0); 00070 00071 One2OneWiring* wiring = new One2OneWiring ( new ColorUniformNoise() ); 00072 00073 */ 00074 00075 /** 00076 A barrel-like robot with 2 internal masses, which can slide on their orthogonal axes. 00077 It is the small brother of the Sphererobot3Masses. 00078 This robot was inspired by Julius Popp (http://sphericalrobots.com) 00079 */ 00080 class Barrel2Masses : public Sphererobot3Masses 00081 { 00082 public: 00083 00084 /** 00085 * Constructor. It is configured with the configuration object of Sphererobot3Masses. 00086 Just two of the 3 axis are used. The worldZaxissensor and irAxis3 has no meaning here. 00087 **/ 00088 Barrel2Masses ( const OdeHandle& odeHandle, const OsgHandle& osgHandle, 00089 const Sphererobot3MassesConf& conf, const std::string& name, double transparency=0.5 ); 00090 00091 virtual ~Barrel2Masses(); 00092 00093 /** default configuration. It has no sensors. 00094 Use addSensor(new AxisOrientationSensor(ZProjectionXY) for example.*/ 00095 static Sphererobot3MassesConf getDefaultConf(){ 00096 Sphererobot3MassesConf c; 00097 c.diameter = 1; 00098 c.spheremass = .3;// 0.1 00099 c.pendularmass = 1.0; 00100 c.pendularrange = 0.25; // range of the slider from center in multiple of diameter [-range,range] 00101 c.motorsensor = false; 00102 c.irAxis1=false; 00103 c.irAxis2=false; 00104 c.irAxis3=false; 00105 c.drawIRs=true; 00106 c.irsensorscale=1.5; 00107 c.irCharacter=1; 00108 return c; 00109 } 00110 00111 virtual int getSensors ( sensor* sensors, int sensornumber ); 00112 00113 protected: 00114 00115 /// The cylinder (main body) lies on the ground, that it is rotating about the z-axis 00116 virtual void create(const osg::Matrix& pose); 00117 00118 }; 00119 00120 } 00121 00122 #endif

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