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: odeconfig.h,v $ 00023 * Revision 1.20 2009/08/10 14:48:34 der 00024 * calcDrawInterval gets a double 00025 * 00026 * Revision 1.19 2009/08/05 16:13:06 martius 00027 * added framerate to adjust 00028 * 00029 * Revision 1.18 2008/04/23 07:17:16 martius 00030 * makefiles cleaned 00031 * new also true realtime factor displayed, 00032 * warning if out of sync 00033 * drawinterval in full speed is 10 frames, independent of the speed 00034 * 00035 * Revision 1.17 2007/07/30 14:13:17 martius 00036 * drawBoundings moved to osgHandle 00037 * 00038 * Revision 1.16 2007/06/08 15:37:22 martius 00039 * random seed into OdeConfig -> logfiles 00040 * 00041 * Revision 1.15 2007/01/25 14:09:50 martius 00042 * use new configurable addParameter feature 00043 * 00044 * Revision 1.14 2006/08/04 15:07:46 martius 00045 * documentation 00046 * 00047 * Revision 1.13 2006/07/14 11:57:23 martius 00048 * selforg becomes HEAD 00049 * 00050 * Revision 1.12.4.8 2006/06/29 16:32:44 robot3 00051 * implementation of odeconfig moved to odeconfig.cpp 00052 * 00053 * Revision 1.12.4.7 2006/05/08 12:12:36 robot3 00054 * changes from Revision 1.40.4.27 reverted 00055 * 00056 * Revision 1.12.4.6 2006/04/27 16:17:38 robot3 00057 * implemented some functions for motionblurcallback 00058 * 00059 * Revision 1.12.4.5 2006/03/28 09:55:12 robot3 00060 * -main: fixed snake explosion bug 00061 * -odeconfig.h: inserted cameraspeed 00062 * -camermanipulator.cpp: fixed setbyMatrix, 00063 * updateFactor 00064 * 00065 * Revision 1.12.4.4 2006/02/08 16:14:28 martius 00066 * no namespace using 00067 * 00068 * Revision 1.12.4.3 2006/01/10 15:08:15 martius 00069 * controlinterval is 1 by default 00070 * 00071 * Revision 1.12.4.2 2005/12/06 10:13:23 martius 00072 * openscenegraph integration started 00073 * 00074 * Revision 1.12.4.1 2005/11/14 17:37:00 martius 00075 * changed makefile structure to have and include directory 00076 * mode to selforg 00077 * 00078 * Revision 1.12 2005/11/09 13:29:19 martius 00079 * GPL'ised 00080 * 00081 ***************************************************************************/ 00082 #ifndef __ODECONFIG_H 00083 #define __ODECONFIG_H 00084 00085 #include <selforg/configurable.h> 00086 #include "odehandle.h" 00087 00088 namespace lpzrobots { 00089 00090 /** 00091 The class $name holds the configurable parameters of the simulation environment. 00092 */ 00093 class OdeConfig : public Configurable { 00094 public: 00095 00096 // creates new instance of OdeConfig with default values 00097 OdeConfig(); 00098 00099 virtual ~OdeConfig() {} 00100 00101 virtual paramlist getParamList() const; 00102 00103 virtual paramval getParam(const paramkey& key) const; 00104 00105 virtual bool setParam(const paramkey& key, paramval val); 00106 00107 virtual void setOdeHandle(const OdeHandle& odeHandle); 00108 00109 virtual void setVideoRecordingMode(bool mode); 00110 00111 virtual void calcAndSetDrawInterval(double Hz, double rtf); 00112 00113 private: 00114 /// calculates the draw interval with simStepSize and realTimeFactor so that we have the Hz frames/sec 00115 int calcDrawInterval(double Hz, double rtf); 00116 00117 public: 00118 bool videoRecordingMode; 00119 double simStepSize; 00120 double motionPersistence; 00121 int drawInterval; 00122 int controlInterval; 00123 double noise; 00124 double gravity; 00125 double cameraSpeed; 00126 long randomSeed; 00127 OdeHandle odeHandle; 00128 00129 double realTimeFactor; 00130 double fps; 00131 }; 00132 00133 } 00134 00135 #endif