Robot Simulator of the Robotics Group for Self-Organization of Control: trackablemeasure.h Source File

# trackablemeasure.h

Go to the documentation of this file.

    00001 /***************************************************************************
    00002  *   Copyright (C) 2005-2011 LpzRobots development team                    *
    00003  *    Georg Martius  <georg dot martius at web dot de>                     *
    00004  *    Frank Guettler <guettler at informatik dot uni-leipzig dot de        *
    00005  *    Frank Hesse    <frank at nld dot ds dot mpg dot de>                  *
    00006  *    Ralf Der       <ralfder at mis dot mpg dot de>                       *
    00007  *                                                                         *
    00008  *   This program is free software; you can redistribute it and/or modify  *
    00009  *   it under the terms of the GNU General Public License as published by  *
    00010  *   the Free Software Foundation; either version 2 of the License, or     *
    00011  *   (at your option) any later version.                                   *
    00012  *                                                                         *
    00013  *   This program is distributed in the hope that it will be useful,       *
    00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
    00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
    00016  *   GNU General Public License for more details.                          *
    00017  *                                                                         *
    00018  *   You should have received a copy of the GNU General Public License     *
    00019  *   along with this program; if not, write to the                         *
    00020  *   Free Software Foundation, Inc.,                                       *
    00021  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
    00022  *                                                                         *
    00023  ***************************************************************************/
    00024 #ifndef _TRACKABLE_MEASURE_H
    00025 #define _TRACKABLE_MEASURE_H
    00026
    00027 #include "complexmeasure.h"
    00028 #include "trackable.h"
    00029 #include <list>
    00030 #include "position.h"
    00031
    00032 /**
    00033  * NOTE: SPEED and ANGSPEED is not implemented yet!
    00034  */
    00035 enum TrackMode {
    00036     POS, /// takes the position for the measure
    00037     SPEED, /// takes the speed for the measure
    00038     ANGSPEED /// takes the angular speed for the measure
    00039 };
    00040
    00041 /// defines which dimensions should be count.
    00042 enum Dimensions { X = 1, Y = 2, Z = 4 };
    00043
    00044
    00045 class TrackableMeasure : public ComplexMeasure {
    00046
    00047 public:
    00048
    00049   /**
    00050    * creates a new TrackableMeasure. The position of the Trackables in the
    00051    * given list is counted in a fequency list. The possible positions are
    00052    * given by the cornerPointList, which contains the cornerPoints of the
    00053    * arena where the trackables are placed.
    00054    * the complex measure ist then based on the frequency list
    00055    * @param trackableList the list of the Trackables
    00056    * @param cornerPointList the list with the cornerPoints of the arena
    00057    * @param dimensions which dimensions do you like to count? Note that
    00058    * the needed memory is (numberBins^ndim), but calculation costs are O(1)
    00059    * @param cmode which type of complex measure should be evaluated?
    00060    * @param numberBins number of bins used for discretisation
    00061    */
    00062   TrackableMeasure(std::list<Trackable*> trackableList,const char* measureName  ,ComplexMeasureMode cmode,std::list<Position> cornerPointList, short dimensions, int numberBins);
    00063
    00064   //virtual ~TrackableMeasure();
    00065
    00066   /**
    00067    * defined by AbstractMeasure. This method is called from StatisticTools
    00068       for updating the measure in every simStep (ODE).
    00069    */
    00070   virtual void step();
    00071
    00072
    00073 protected:
    00074   std::list<Trackable*> trackableList;
    00075   ComplexMeasureMode    cmode;
    00076   TrackMode             tmode;
    00077
    00078   virtual double findRange(std::list<Position>  positionList,short dim, bool min);
    00079
    00080   virtual void addDimension(short dim, std::list<Position> cornerPointList);
    00081
    00082 };
    00083
    00084 #endif