one2onewiring.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  *   $Log: one2onewiring.h,v $
00023  *   Revision 1.3  2006/07/20 17:14:36  martius
00024  *   removed std namespace from matrix.h
00025  *   storable interface
00026  *   abstract model and invertablemodel as superclasses for networks
00027  *
00028  *   Revision 1.2  2006/07/14 12:24:02  martius
00029  *   selforg becomes HEAD
00030  *
00031  *   Revision 1.1.2.1  2005/11/16 11:24:28  martius
00032  *   moved to selforg
00033  *
00034  *   Revision 1.9  2005/10/28 12:05:54  martius
00035  *   new inspectable interface
00036  *
00037  *   Revision 1.8  2005/10/24 13:32:07  fhesse
00038  *   comments adjusted and in doxygen style
00039  *
00040  *   Revision 1.7  2005/10/06 17:11:37  martius
00041  *   switched to stl lists
00042  *
00043  *   Revision 1.6  2005/08/31 11:10:52  martius
00044  *   noise -> noisevals
00045  *
00046  *   Revision 1.5  2005/08/03 20:34:58  martius
00047  *   use if Inspectable interface
00048  *
00049  *   Revision 1.4  2005/07/21 15:14:47  martius
00050  *   wireSensors and wireMotors get constant fields
00051  *
00052  *   Revision 1.3  2005/07/18 14:44:27  martius
00053  *   noise moved into wiring
00054  *
00055  *   Revision 1.2  2005/07/18 10:15:03  martius
00056  *   noise is added here
00057  *
00058  *   Revision 1.1  2005/07/14 15:57:54  fhesse
00059  *   now agent contains controller, robot and wiring, plotting ability included, therefore plotagent can be removed; ono2onewiring replaces one2oneagent
00060  *                                            *
00061  *                                                                         *
00062  ***************************************************************************/
00063 #ifndef __ONE2ONEWIRING_H
00064 #define __ONE2ONEWIRING_H
00065 
00066 #include "abstractwiring.h"
00067 
00068 /** Implements one to one wireing of robot sensors to inputs of the controller 
00069     and controller outputs to robot motors. 
00070  */
00071 class One2OneWiring :public AbstractWiring{
00072 public:
00073   /** constructor
00074       @param noise NoiseGenerator that is used for adding noise to sensor values  
00075       @param plotNoise for plotting the noise values (to observe it from outside
00076       via getInternalParams() and guilogger) set it TRUE, for not plotting the noise set 
00077       it to FALSE.
00078    */
00079   One2OneWiring(NoiseGenerator* noise, bool plotNoise=false);
00080 
00081   /** destructor
00082    */
00083   virtual ~One2OneWiring();
00084 
00085   /** initializes the number of sensors and motors on robot side, calculate
00086       number of sensors and motors on controller side
00087    */
00088   virtual bool init(int robotsensornumber, int robotmotornumber);
00089 
00090   /** Realizes one to one wiring from robot sensors to controller sensors. 
00091       @param rsensors pointer to array of sensorvalues from robot 
00092       @param rsensornumber number of sensors from robot
00093       @param csensors pointer to array of sensorvalues for controller  
00094       @param csensornumber number of sensors to controller
00095       @param noise size of the noise added to the sensors
00096   */
00097   virtual bool wireSensors(const sensor* rsensors, int rsensornumber, 
00098                            sensor* csensors, int csensornumber,
00099                            double noise);
00100 
00101   /** Realizes one to one wiring from controller motor outputs to robot motors. 
00102       @param rmotors pointer to array of motorvalues for robot 
00103       @param rmotornumber number of robot motors 
00104       @param cmotors pointer to array of motorvalues from controller  
00105       @param cmotornumber number of motorvalues from controller
00106   */
00107   virtual bool wireMotors(motor* rmotors, int rmotornumber,
00108                           const motor* cmotors, int cmotornumber);
00109 
00110   /** Returns the list of the names of all internal parameters.
00111   */
00112   virtual std::list<iparamkey> getInternalParamNames() const;
00113 
00114   /** The list of the values of all internal parameters given by getInternalParams().
00115       (in the order given by getInternalParamNames())
00116    */
00117   virtual std::list<iparamval> getInternalParams() const;
00118 
00119 protected:
00120   /// TRUE for plotting noise values, FALSE for not plotting
00121   bool plotNoise; 
00122   /// for storing the noise values
00123   sensor* noisevals;
00124 
00125 };
00126 
00127 #endif

Generated on Mon Aug 7 16:40:14 2006 for Robotsystem of the Robot Group Leipzig by  doxygen 1.4.7