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
trackablemeasure.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 _TRACKABLE_MEASURE_H
25 #define _TRACKABLE_MEASURE_H
26 
27 #include "complexmeasure.h"
28 #include "trackable.h"
29 #include <list>
30 #include "position.h"
31 
32 /**
33  * NOTE: SPEED and ANGSPEED is not implemented yet!
34  */
35 enum TrackMode {
36  POS, /// takes the position for the measure
37  SPEED, /// takes the speed for the measure
38  ANGSPEED /// takes the angular speed for the measure
39 };
40 
41 /// defines which dimensions should be count.
42 enum Dimensions { X = 1, Y = 2, Z = 4 };
43 
44 
46 
47 public:
48 
49  /**
50  * creates a new TrackableMeasure. The position of the Trackables in the
51  * given list is counted in a fequency list. The possible positions are
52  * given by the cornerPointList, which contains the cornerPoints of the
53  * arena where the trackables are placed.
54  * the complex measure ist then based on the frequency list
55  * @param trackableList the list of the Trackables
56  * @param cornerPointList the list with the cornerPoints of the arena
57  * @param dimensions which dimensions do you like to count? Note that
58  * the needed memory is (numberBins^ndim), but calculation costs are O(1)
59  * @param cmode which type of complex measure should be evaluated?
60  * @param numberBins number of bins used for discretisation
61  */
62  TrackableMeasure(std::list<Trackable*> trackableList,const char* measureName ,ComplexMeasureMode cmode,std::list<Position> cornerPointList, short dimensions, int numberBins);
63 
64  //virtual ~TrackableMeasure();
65 
66  /**
67  * defined by AbstractMeasure. This method is called from StatisticTools
68  for updating the measure in every simStep (ODE).
69  */
70  virtual void step();
71 
72 
73 protected:
74  std::list<Trackable*> trackableList;
77 
78  virtual double findRange(std::list<Position> positionList,short dim, bool min);
79 
80  virtual void addDimension(short dim, std::list<Position> cornerPointList);
81 
82 };
83 
84 #endif
Definition: complexmeasure.h:47
Definition: trackablemeasure.h:42
TrackMode
NOTE: SPEED and ANGSPEED is not implemented yet!
Definition: trackablemeasure.h:35
std::list< Trackable * > trackableList
Definition: trackablemeasure.h:74
Definition: trackablemeasure.h:36
virtual void step()
defined by AbstractMeasure.
Definition: trackablemeasure.cpp:74
Definition: trackablemeasure.h:45
Definition: trackablemeasure.h:42
virtual double findRange(std::list< Position > positionList, short dim, bool min)
Definition: trackablemeasure.cpp:49
TrackMode tmode
Definition: trackablemeasure.h:76
virtual void addDimension(short dim, std::list< Position > cornerPointList)
Definition: trackablemeasure.cpp:41
TrackableMeasure(std::list< Trackable * > trackableList, const char *measureName, ComplexMeasureMode cmode, std::list< Position > cornerPointList, short dimensions, int numberBins)
creates a new TrackableMeasure.
Definition: trackablemeasure.cpp:29
Dimensions
defines which dimensions should be count.
Definition: trackablemeasure.h:42
takes the speed for the measure
Definition: trackablemeasure.h:38
Definition: trackablemeasure.h:42
ComplexMeasureMode
measure modes of complex measures.
Definition: complexmeasure.h:34
int numberBins
Definition: complexmeasure.h:89
ComplexMeasureMode cmode
Definition: trackablemeasure.h:75
takes the position for the measure
Definition: trackablemeasure.h:37
double min(const matrix::Matrix &v)
returns the smallest element
Definition: controller_misc.cpp:307