00001 /*************************************************************************** 00002 * Copyright (C) 2005-2011 by * 00003 * Georg Martius <georg dot martius at web dot de> * 00004 * Frank Hesse <frank at nld dot ds dot mpg dot de> * 00005 * Ralf Der <ralfder at mis dot mpg dot de> * 00006 * * 00007 * ANY COMMERCIAL USE FORBIDDEN! * 00008 * LICENSE: * 00009 * This work is licensed under the Creative Commons * 00010 * Attribution-NonCommercial-ShareAlike 2.5 License. To view a copy of * 00011 * this license, visit http://creativecommons.org/licenses/by-nc-sa/2.5/ * 00012 * or send a letter to Creative Commons, 543 Howard Street, 5th Floor, * 00013 * San Francisco, California, 94105, USA. * 00014 * * 00015 * This program is distributed in the hope that it will be useful, * 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * 00018 * * 00019 ***************************************************************************/ 00020 00021 #ifndef __INVERTMOTORCONTROLLER_H 00022 #define __INVERTMOTORCONTROLLER_H 00023 00024 #include "homeokinbase.h" 00025 #include "controller_misc.h" 00026 #include <stdlib.h> 00027 #include <string.h> 00028 00029 00030 /** 00031 * Extended HomeokinBase class (still abstract) for robot controller work in motorspace 00032 * and use possibly many steps and adaptive learning rate 00033 * 00034 * Parameters like dampA, adaptrate, noiseY... 00035 */ 00036 class InvertMotorController : public HomeokinBase { 00037 public: 00038 InvertMotorController( unsigned short buffersize , 00039 const std::string& name, const std::string& revision) 00040 : HomeokinBase(buffersize,name, revision){ 00041 addParameterDef("dampA",&dampA,0 ); 00042 addParameterDef("adaptrate",&adaptRate,0.000); 00043 addParameterDef("nomupdate",&nomUpdate,0.005); 00044 addParameterDef("desens",&desens,0); 00045 addParameterDef("steps",&steps,1); 00046 addParameterDef("zetaupdate",&zetaupdate,0); 00047 addParameterDef("noiseY",&noiseY,0); 00048 addParameterDef("noiseB",&noiseB,0.001); 00049 addParameterDef("teacher",&teacher,5); 00050 addParameterDef("relativeE",&relativeE,0); 00051 } 00052 00053 protected: 00054 paramval desens; 00055 paramval steps; ///< number of timesteps is used for controller learning 00056 paramval zetaupdate; 00057 paramval dampA; ///< damping term for model (0: no damping, 0.1 high damping) 00058 parambool relativeE; ///< if not 0: a relative error signal is used (xsi is normalised in respect to |y|) 00059 00060 paramval adaptRate; ///< adaptation rate for learning rate adaptation 00061 paramval nomUpdate; ///< nominal update of controller in respect to matrix norm 00062 paramval noiseB; ///< size of the additional noise for model bias B 00063 paramval noiseY; ///< size of the additional noise for motor values 00064 paramval teacher; ///< factor for teaching signal 00065 00066 }; 00067 00068 #endif