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
axisorientationsensor.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 __AXISORIENTATIONSENSOR_H
25 #define __AXISORIENTATIONSENSOR_H
26 
27 #include "sensor.h"
28 
29 namespace lpzrobots {
30 
31  /** Class for sensing the axis orienation of a primitive (robot)
32  */
33  class AxisOrientationSensor : public Sensor {
34  public:
35  /// Sensor mode
36  enum Mode { /** Z axis (of robot) in word coordinates (relative to body center)
37  (Dimensions select components of this vector) */
39  ZProjection, ///< z-component of each axis (Dimension select components of this vector)
40  Axis ///< for each dimension one orienation vector, i.e. for X | Y | Z it is a 3x3 rotation matrix
41  };
42 
43  /**
44  @param mode how to measure the axis orientation
45  @param dimensions bit mask for the dimensions to sense. Default: X | Y | Z (all dimensions)
46  @see Sensor::Dimensions
47  @see Mode
48  */
49  AxisOrientationSensor(Mode mode, short dimensions = X | Y | Z );
51 
52  virtual void init(Primitive* own, Joint* joint = 0);
53  virtual int getSensorNumber() const;
54 
55  virtual bool sense(const GlobalData& globaldata);
56  virtual std::list<sensor> getList() const;
57  virtual int get(sensor* sensors, int length) const;
58 
59  private:
60  Mode mode;
61  short dimensions;
62  Primitive* own;
63  };
64 
65 
66 }
67 
68 #endif
virtual bool sense(const GlobalData &globaldata)
performs sense action
Definition: axisorientationsensor.cpp:58
Mode
Sensor mode.
Definition: axisorientationsensor.h:36
Definition: sensor.h:46
Definition: sensor.h:46
Definition: axis.h:36
virtual void init(Primitive *own, Joint *joint=0)
initialises sensor with a body of robot and optionally with a joint.
Definition: axisorientationsensor.cpp:39
Definition: joint.h:41
Class for sensing the axis orienation of a primitive (robot)
Definition: axisorientationsensor.h:33
AxisOrientationSensor(Mode mode, short dimensions=X|Y|Z)
Definition: axisorientationsensor.cpp:33
double sensor
Definition: types.h:29
virtual int getSensorNumber() const
returns the number of sensors values produced by this sensor
Definition: axisorientationsensor.cpp:43
Abstract class for sensors that can be plugged into a robot.
Definition: sensor.h:43
Interface class for primitives represented in the physical and graphical world.
Definition: primitive.h:80
Data structure holding all essential global information.
Definition: globaldata.h:57
Z axis (of robot) in word coordinates (relative to body center) (Dimensions select components of this...
Definition: axisorientationsensor.h:38
virtual std::list< sensor > getList() const
returns a list of sensor values (usually in the range [-1,1] ) This function should be overloaded...
Definition: axisorientationsensor.cpp:60
virtual ~AxisOrientationSensor()
Definition: axisorientationsensor.h:50
Definition: sensor.h:46
z-component of each axis (Dimension select components of this vector)
Definition: axisorientationsensor.h:39