Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
forceboostwiring.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2011 LpzRobots development team *
3  * Georg Martius <georg dot martius at web dot de> *
4  * Frank Guettler <guettler at informatik dot uni-leipzig dot de *
5  * Frank Hesse <frank at nld dot ds dot mpg dot de> *
6  * Ralf Der <ralfder at mis dot mpg dot de> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22  * *
23  ***************************************************************************/
24 #ifndef __FORCEBOOSTWIRING_H
25 #define __FORCEBOOSTWIRING_H
26 
27 #include "abstractwiring.h"
28 #include "matrix.h"
29 #include "configurable.h"
30 
31 /** Implements one to one wiring that integrates the mismatch
32  between motor commands (understood as target values) and
33  sensor values and adds them to the controller output
34  If more sensors than motors are used it uses just the first m sensors.
35  */
37 public:
38  /** constructor
39  @param noise NoiseGenerator that is used for adding noise to sensor values
40  @param plotMode see AbstractWiring
41  @param boost factor for mismatch integration
42  @param exportBoostError whether to export force boost error to inspectables
43  (guilogger)
44  */
45  ForceBoostWiring(NoiseGenerator* noise, double boost=0, bool exportBoostError=false,
46  int plotMode=Controller, const std::string& name = "ForceBoostWiring");
47 
48  /** destructor
49  */
50  virtual ~ForceBoostWiring();
51 
52  virtual void reset();
53 protected:
54 
55  /** initializes the number of sensors and motors on robot side, calculate
56  number of sensors and motors on controller side
57  */
58  virtual bool initIntern();
59 
60  /** Realizes one to one wiring from robot sensors to controller sensors.
61  @param rsensors pointer to array of sensorvalues from robot
62  @param rsensornumber number of sensors from robot
63  @param csensors pointer to array of sensorvalues for controller
64  @param csensornumber number of sensors to controller
65  @param noise size of the noise added to the sensors
66  */
67  virtual bool wireSensorsIntern(const sensor* rsensors, int rsensornumber,
68  sensor* csensors, int csensornumber,
69  double noise);
70 
71  /** Realizes one to one wiring from controller motor outputs to robot motors.
72  @param rmotors pointer to array of motorvalues for robot
73  @param rmotornumber number of robot motors
74  @param cmotors pointer to array of motorvalues from controller
75  @param cmotornumber number of motorvalues from controller
76  */
77  virtual bool wireMotorsIntern(motor* rmotors, int rmotornumber,
78  const motor* cmotors, int cmotornumber);
79 
80 
81 protected:
82  double boost;
85 };
86 
87 #endif
Matrix type.
Definition: matrix.h:65
int rmotornumber
number of motors at robot side
Definition: abstractwiring.h:182
virtual void reset()
reset internal state
Definition: forceboostwiring.cpp:89
int csensornumber
number of sensors at controller side
Definition: abstractwiring.h:187
matrix::Matrix error
Definition: forceboostwiring.h:83
int plotMode
using plotTypes this variables defines what is plotted
Definition: abstractwiring.h:168
ForceBoostWiring(NoiseGenerator *noise, double boost=0, bool exportBoostError=false, int plotMode=Controller, const std::string &name="ForceBoostWiring")
constructor
Definition: forceboostwiring.cpp:35
iparamkey name
Definition: inspectable.h:251
virtual bool wireMotorsIntern(motor *rmotors, int rmotornumber, const motor *cmotors, int cmotornumber)
Realizes one to one wiring from controller motor outputs to robot motors.
Definition: forceboostwiring.cpp:71
Abstract wiring-object between controller and robot.
Definition: abstractwiring.h:39
matrix::Matrix sens
Definition: forceboostwiring.h:84
Abstact class for configurable objects.
Definition: configurable.h:81
double motor
Definition: abstractwiring.h:42
double boost
Definition: forceboostwiring.h:82
Definition: abstractwiring.h:44
int cmotornumber
number of motors at controller side
Definition: abstractwiring.h:192
int rsensornumber
number of sensors at robot side
Definition: abstractwiring.h:177
double sensor
Definition: abstractwiring.h:41
Implements one to one wiring that integrates the mismatch between motor commands (understood as targe...
Definition: forceboostwiring.h:36
virtual bool initIntern()
initializes the number of sensors and motors on robot side, calculate number of sensors and motors on...
Definition: forceboostwiring.cpp:47
virtual ~ForceBoostWiring()
destructor
Definition: forceboostwiring.cpp:43
virtual bool wireSensorsIntern(const sensor *rsensors, int rsensornumber, sensor *csensors, int csensornumber, double noise)
Realizes one to one wiring from robot sensors to controller sensors.
Definition: forceboostwiring.cpp:58
Interface and basic class for noise generator.
Definition: noisegenerator.h:37