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
operator.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 __OPERATOR_H
25 #define __OPERATOR_H
26 
27 #include "globaldata.h"
28 
29 #include "pose.h"
30 
31 
32 namespace lpzrobots {
33  /**
34  An Operator observes an agent (robot) and manipulates it if necessary.
35  For instance if the robot is falled over the operator can flip it back.
36  This is an abstract base class and subclasses should overload at least
37  observe().
38  */
39 
40  class OdeAgent;
41 
42  class Operator : public Configurable {
43  public:
44  /** type of manipulation of the robot (for display) and or operation
45  RemoveOperator means that the operator should be removed
46  */
48  /// description of action (for visualization)
49  struct ManipDescr {
50  ManipDescr() : show(1), size(0.05,0.05,0.05){
51  }
52  short show;
57 
58  };
59 
60  Operator( const std::string& name, const std::string& revision)
61  : Configurable(name, revision)
62  {
63  }
64 
65  virtual ~Operator(){
66  }
67 
68  /** called every simulation step
69  @return what was done with the robot
70  */
71  virtual ManipType observe(OdeAgent* agent, GlobalData& global, ManipDescr& descr) = 0;
72 
73  };
74 
75 }
76 
77 #endif
ManipType
type of manipulation of the robot (for display) and or operation RemoveOperator means that the operat...
Definition: operator.h:47
Definition: operator.h:47
virtual ManipType observe(OdeAgent *agent, GlobalData &global, ManipDescr &descr)=0
called every simulation step
ManipDescr()
Definition: operator.h:50
Definition: pos.h:36
Operator(const std::string &name, const std::string &revision)
Definition: operator.h:60
description of action (for visualization)
Definition: operator.h:49
osg::Matrix Pose
Definition: pose.h:35
Pos pos
Definition: operator.h:53
Data structure holding all essential global information.
Definition: globaldata.h:57
virtual ~Operator()
Definition: operator.h:65
Specialised agent for ode robots.
Definition: odeagent.h:62
Abstact class for configurable objects.
Definition: configurable.h:81
Definition: operator.h:42
Definition: operator.h:47
Pose orientation
Definition: operator.h:55
Pos size
Definition: operator.h:56
Definition: operator.h:47
Pos posStart
Definition: operator.h:54
short show
Definition: operator.h:52
Definition: operator.h:47