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 * ANY COMMERCIAL USE FORBIDDEN! * 00008 * * 00009 * $Log: invertnchannelcontroller_gnu.h,v $ 00010 * Revision 1.2 2005/10/27 15:02:06 fhesse 00011 * commercial use added 00012 * * 00013 * * 00014 ***************************************************************************/ 00015 00016 #ifndef __INVERTNCHANNELCONTROLLER_GNU_H 00017 #define __INVERTNCHANNELCONTROLLER_GNU_H 00018 00019 #include "invertnchannelcontroller.h" 00020 00021 #include "plotlog.h" 00022 using namespace matrix; 00023 00024 /** 00025 * child of InvertNChannelController (using it's functionality) 00026 * adds gnuplot windows for A, C, h and x, y 00027 * 00028 * Implements standart parameters: eps, rho, mu, stepnumber4avg, stepnumber4delay 00029 */ 00030 class InvertNChannelController_Gnu : public InvertNChannelController { 00031 00032 public: 00033 InvertNChannelController_Gnu(int _number_channels, int _buffersize); 00034 00035 virtual ~InvertNChannelController_Gnu(){} 00036 00037 00038 /// performs one step (includes learning). 00039 /// Calulates motor commands from sensor inputs. 00040 virtual void step(const sensor* , int number_sensors, motor* , int number_motors); 00041 00042 00043 /// performs one step without learning. Calulates motor commands from sensor inputs. 00044 virtual void stepNoLearning(const sensor* , int number_sensors, 00045 motor* , int number_motors); 00046 00047 00048 00049 protected: 00050 00051 PlotLog<std::string> plotlog; 00052 PlotLog<std::string> plotlog_x; 00053 PlotLog<std::string> plotlog_a; 00054 00055 /** 00056 * plotting sensorvalues x, motorvalues y, matrix A, matrix C and vector h 00057 * @param x actual sensorvalues (used for generation of motorcommand in actual timestep) 00058 * @param y actual motorcommand (generated in the actual timestep) 00059 */ 00060 virtual void plot(const sensor* x, const motor* y); 00061 00062 /** 00063 * converts integer to string 00064 * @param value interger to convert 00065 */ 00066 std::string intToStr(int value); 00067 00068 }; 00069 00070 #include "invertnchannelcontroller_gnu.hpp" 00071 #endif 00072 00073