Robotsystem from Robot Group Leipzig: invertcontroller.h Source File

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# invertcontroller.h

Go to the documentation of this file.

    00001 #ifndef __INVERTCONTROLLER_H
    00002 #define __INVERTCONTROLLER_H
    00003
    00004 #include "abstractcontroller.h"
    00005 #include <stdlib.h>
    00006 #include <string.h>
    00007
    00008 /**
    00009  * Abstract class (interface) for robot controller that use direct matrix inversion and
    00010  * simple one layer networks.
    00011  *
    00012  * Implements standart parameters: eps, rho, mu, stepnumber4avg, stepnumber4delay
    00013  */
    00014 class InvertController : public AbstractController {
    00015 public:
    00016   InvertController(){
    00017      eps=0.3;
    00018      rho=0.0;
    00019      s4delay=1;
    00020      s4avg=1;
    00021      delta=0.01;
    00022      factor_a=1.0;
    00023      desens=0.0; // name form desensitization
    00024      number_it=0;
    00025      epsilon_it= 0;
    00026      damping_c=0.0;
    00027   }
    00028
    00029   virtual paramval getParam(const paramkey& key) const{
    00030     if(key == "eps") return eps;
    00031     else if(key == "rho") return rho;
    00032     else if(key == "desens") return desens;
    00033     else if(key == "s4delay") return s4delay;
    00034     else if(key == "s4avg") return s4avg;
    00035     else if(key == "factor_a") return factor_a;
    00036     else if(key == "number_it") return number_it;
    00037     else if(key == "epsilon_it") return epsilon_it;
    00038     else if(key == "delta") return delta;
    00039     else if(key == "damping_c") return damping_c;
    00040     else  return AbstractController::getParam(key) ;
    00041   }
    00042
    00043   virtual bool setParam(const paramkey& key, paramval val){
    00044     if(key == "eps") eps=val;
    00045     else if(key == "rho") rho=val;
    00046     else if(key == "desens") desens=val;
    00047     else if(key == "s4delay") s4delay=val;
    00048     else if(key == "s4avg") s4avg=val;
    00049     else if(key == "factor_a") factor_a=val;
    00050     else if(key == "number_it") number_it=val;
    00051     else if(key == "epsilon_it") epsilon_it=val;
    00052     else if(key == "delta") delta=val;
    00053     else if(key == "damping_c") damping_c=val;
    00054     else return AbstractController::setParam(key, val);
    00055     //    else fprintf(stderr, "parameter %s unknown\n", key);
    00056     return true;
    00057   }
    00058
    00059   virtual paramlist getParamList() const{
    00060     paramlist list;
    00061     list.push_back(pair<paramkey, paramval> ("eps", eps));
    00062     list.push_back(pair<paramkey, paramval> ("rho", rho));
    00063     list.push_back(pair<paramkey, paramval> ("desens", desens));
    00064     list.push_back(pair<paramkey, paramval> ("s4delay", s4delay));
    00065     list.push_back(pair<paramkey, paramval> ("s4avg", s4avg));
    00066     list.push_back(pair<paramkey, paramval> ("factor_a", factor_a));
    00067     list.push_back(pair<paramkey, paramval> ("number_it", number_it));
    00068     list.push_back(pair<paramkey, paramval> ("epsilon_it", epsilon_it));
    00069     list.push_back(pair<paramkey, paramval> ("delta", delta));
    00070     list.push_back(pair<paramkey, paramval> ("damping_c", damping_c));
    00071
    00072     return list;
    00073   }
    00074
    00075 protected:
    00076   paramval eps;
    00077   paramval rho;
    00078   paramval desens;
    00079   paramval s4delay;
    00080   paramval s4avg;
    00081   paramval factor_a;
    00082   paramval number_it;
    00083   paramval epsilon_it;
    00084   paramval delta;
    00085   paramval damping_c;
    00086
    00087 };
    00088
    00089 #endif