one2onewiring.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005-2011 LpzRobots development team                    *
00003  *    Georg Martius  <georg dot martius at web dot de>                     *
00004  *    Frank Guettler <guettler at informatik dot uni-leipzig dot de        *
00005  *    Frank Hesse    <frank at nld dot ds dot mpg dot de>                  *
00006  *    Ralf Der       <ralfder at mis dot mpg dot de>                       *
00007  *                                                                         *
00008  *   This program is free software; you can redistribute it and/or modify  *
00009  *   it under the terms of the GNU General Public License as published by  *
00010  *   the Free Software Foundation; either version 2 of the License, or     *
00011  *   (at your option) any later version.                                   *
00012  *                                                                         *
00013  *   This program is distributed in the hope that it will be useful,       *
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00016  *   GNU General Public License for more details.                          *
00017  *                                                                         *
00018  *   You should have received a copy of the GNU General Public License     *
00019  *   along with this program; if not, write to the                         *
00020  *   Free Software Foundation, Inc.,                                       *
00021  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00022  *                                                                         *
00023  ***************************************************************************/
00024 #ifndef __ONE2ONEWIRING_H
00025 #define __ONE2ONEWIRING_H
00026 
00027 #include "abstractwiring.h"
00028 
00029 /** Implements one to one wiring of robot sensors to inputs of the controller 
00030     and controller outputs to robot motors. 
00031  */
00032 class One2OneWiring :public AbstractWiring{
00033 public:
00034   /** constructor
00035       @param noise NoiseGenerator that is used for adding noise to sensor values  
00036       @param plotMode see AbstractWiring 
00037       @param blind number of blind channels
00038         (additional sensors and motors coupled directly)
00039    */
00040   One2OneWiring(NoiseGenerator* noise, int plotMode=Controller, int blind=0, const std::string& name = "One2OneWiring");
00041 
00042   /** destructor
00043    */
00044   virtual ~One2OneWiring();
00045 
00046 protected:
00047 
00048   /** initializes the number of sensors and motors on robot side, calculate
00049       number of sensors and motors on controller side
00050    */
00051   virtual bool initIntern();
00052 
00053   /** Realizes one to one wiring from robot sensors to controller sensors. 
00054       @param rsensors pointer to array of sensorvalues from robot 
00055       @param rsensornumber number of sensors from robot
00056       @param csensors pointer to array of sensorvalues for controller  
00057       @param csensornumber number of sensors to controller
00058       @param noise size of the noise added to the sensors
00059   */
00060   virtual bool wireSensorsIntern(const sensor* rsensors, int rsensornumber, 
00061                            sensor* csensors, int csensornumber,
00062                            double noise);
00063 
00064   /** Realizes one to one wiring from controller motor outputs to robot motors. 
00065       @param rmotors pointer to array of motorvalues for robot 
00066       @param rmotornumber number of robot motors 
00067       @param cmotors pointer to array of motorvalues from controller  
00068       @param cmotornumber number of motorvalues from controller
00069   */
00070   virtual bool wireMotorsIntern(motor* rmotors, int rmotornumber,
00071                           const motor* cmotors, int cmotornumber);
00072 
00073 
00074 protected:
00075   int blind; /// number of blind channels
00076   /// blind motor values
00077   motor* blindmotors;
00078 
00079 };
00080 
00081 #endif
Generated on Thu Jun 28 14:45:37 2012 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.6.3