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
oneactivemultipassivecontroller.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 __ONEACTIVEMULTIPASSIVECONTROLLER_H
25 #define __ONEACTIVEMULTIPASSIVECONTROLLER_H
26 
28 
29 /**
30  * class (interface) for using multiple controller, the first one is
31  * the active one, which generates motor values. The other controllers
32  * are passive and cannot affect the motor values.
33  *
34  */
36 public:
37 
38  /// contructor (hint: use $ID$ for revision)
39  OneActiveMultiPassiveController(AbstractController* controller, const std::string& name = "1ActXPassController", const std::string& revision = "$ID$");
40 
42 
43 /****************************************************************************/
44 /* AbstractMultiController should implement the following classes: */
45 /* AbstractController, Configurable, Inspectable, Storeable */
46 /****************************************************************************/
47 
48 
49 /****************************************************************************/
50 /* BEGIN methods of AbstractController */
51 /****************************************************************************/
52 
53  /** initialisation of the controller with the given sensor/ motornumber
54  * Must NORMALLY be called before use. For all multicontroller
55  * call first AbstractMultiController::init(sensornumber,motornumber)
56  * if you overwrite this method
57  */
58  virtual void init(int sensornumber, int motornumber, RandGen* randGen = 0);
59 
60 
61  /** performs one step (includes learning).
62  Calculates motor commands from sensor inputs.
63  @param sensors sensors inputs scaled to [-1,1]
64  @param sensornumber length of the sensor array
65  @param motors motors outputs. MUST have enough space for motor values!
66  @param motornumber length of the provided motor array
67  */
68  virtual void step(const sensor* sensors, int sensornumber,
69  motor* motors, int motornumber);
70 
71  /** performs one step without learning.
72  @see step
73  */
74  virtual void stepNoLearning(const sensor* sensors , int sensornumber,
75  motor* motors, int motornumber);
76 
77 
78 /****************************************************************************/
79 /* END methods of AbstractController */
80 /****************************************************************************/
81 
82 
83 
84 /****************************************************************************/
85 /* BEGIN methods of Configurable */
86 /****************************************************************************/
87 
88 /****************************************************************************/
89 /* END methods of Configurable */
90 /****************************************************************************/
91 
92 
93 
94 /****************************************************************************/
95 /* BEGIN methods of Inspectable */
96 /****************************************************************************/
97 
98 /****************************************************************************/
99 /* END methods of Inspectable */
100 /****************************************************************************/
101 
102 
103 
104 /****************************************************************************/
105 /* BEGIN methods of Storeable */
106 /****************************************************************************/
107 
108 /****************************************************************************/
109 /* END methods of Storeable */
110 /****************************************************************************/
111 
112 
113 protected:
115 };
116 
117 #endif
virtual ~OneActiveMultiPassiveController()
Definition: oneactivemultipassivecontroller.cpp:32
Abstract class for robot controller (with some basic functionality).
Definition: abstractcontroller.h:46
Abstract class (interface) for using multiple controller.
Definition: abstractmulticontroller.h:41
iparamkey name
Definition: inspectable.h:251
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
AbstractController * controller
Definition: abstractcontrolleradapter.h:158
double sensor
Definition: abstractcontroller.h:48
virtual void init(int sensornumber, int motornumber, RandGen *randGen=0)
initialisation of the controller with the given sensor/ motornumber Must NORMALLY be called before us...
Definition: oneactivemultipassivecontroller.cpp:44
virtual void stepNoLearning(const sensor *sensors, int sensornumber, motor *motors, int motornumber)
performs one step without learning.
Definition: oneactivemultipassivecontroller.cpp:63
class (interface) for using multiple controller, the first one is the active one, which generates mot...
Definition: oneactivemultipassivecontroller.h:35
double motor
Definition: types.h:30
motor * passiveMotors
Definition: oneactivemultipassivecontroller.h:114
virtual void step(const sensor *sensors, int sensornumber, motor *motors, int motornumber)
performs one step (includes learning).
Definition: oneactivemultipassivecontroller.cpp:52
OneActiveMultiPassiveController(AbstractController *controller, const std::string &name="1ActXPassController", const std::string &revision="$ID$")
contructor (hint: use $ID$ for revision)
Definition: oneactivemultipassivecontroller.cpp:29