Main MRPT website > C++ reference
MRPT logo
CDetectorDoorCrossing.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://www.mrpt.org/ |
5  | |
6  | Copyright (C) 2005-2012 University of Malaga |
7  | |
8  | This software was written by the Machine Perception and Intelligent |
9  | Robotics Lab, University of Malaga (Spain). |
10  | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11  | |
12  | This file is part of the MRPT project. |
13  | |
14  | MRPT is free software: you can redistribute it and/or modify |
15  | it under the terms of the GNU General Public License as published by |
16  | the Free Software Foundation, either version 3 of the License, or |
17  | (at your option) any later version. |
18  | |
19  | MRPT is distributed in the hope that it will be useful, |
20  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22  | GNU General Public License for more details. |
23  | |
24  | You should have received a copy of the GNU General Public License |
25  | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26  | |
27  +---------------------------------------------------------------------------+ */
28 #ifndef CDetectorDoorCrossing_H
29 #define CDetectorDoorCrossing_H
30 
32 #include <mrpt/slam/CRawlog.h>
33 #include <mrpt/poses/CPose2D.h>
38 
39 #include <mrpt/slam/link_pragmas.h>
40 
41 namespace mrpt
42 {
43 namespace slam
44 {
45 
46  /**
47  *
48  * \sa CPointsMap \ingroup mrpt_slam_grp
49  */
51  {
52  public:
53  /** The constructor. See options for customizing the default parameters.
54  *
55  */
57 
58  /** In this structure parameters can be changed to customize the
59  * behaviour of this algorithm.
60  */
62  {
63  TOptions() : windowSize(5), gridResolution(0.2f) //, gridUpdateFactor(0.5)
64  {
65  }
66 
67  /** The window size, in (action,observations) pairs;min. value is 2.
68  */
69  unsigned int windowSize;
70 
71  float gridResolution; //,gridUpdateFactor;
72 
73  } options;
74 
75 
76  /** A structure used as output in this method.
77  * \sa process
78  */
80  {
82  enoughtInformation(false),
83  doorCrossingLikelihood(0),
84  informationGain(0),
85  cumulativeTurning(0),
86  pointsMap()
87  {
88  };
89 
90  /** If this is false, all other output fields must not be
91  * taken into account since there is not yet enought information
92  * to fill the required observations window size.
93  */
94  bool enoughtInformation;
95 
96  /** The likelihood of having just entering a new room, in
97  * the range [0,1]
98  */
100 
101  /** The gain in information produced by the last observation, in "bits".
102  */
104 
105  /** The cumulative turning of the robot in radians for the movements in the "window"
106  */
108 
110  };
111 
112  /** The main method, where a new action/observation pair is added to the list.
113  * Here the list of old observations is updated, and a value with the probability
114  * of having pass a door is returned.
115  * \param in_poseChange The odometry (or any other meanway) based change in the robot pose since last observation to this one.
116  * \param in_sf The observations.
117  * \param out_estimation The estimation results.
118  *
119  * \sa TDoorCrossingOutParams
120  */
121  void process(
122  CActionRobotMovement2D &in_poseChange,
123  CSensoryFrame &in_sf,
124  TDoorCrossingOutParams &out_estimation
125  );
126 
127  /** Reset the detector, i.e. it erases all previous observations.
128  */
129  void clear();
130 
131  private:
132  /** The last observations and consecutive actions are stored here:
133  * Indexes (0,1) is the earlier (act,obs) pair, and the lastest pair
134  * is in indexes ((M-1)*2,(M-1)*2-1).
135  * Always contains (Action, Observation) pairs, in that order.
136  */
138 
139  /** Entropy of current, and last "map patchs".
140  */
143 
144 
145 
146  };
147 
148  } // End of namespace
149 } // End of namespace
150 
151 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013