MRPT  2.0.3
CDetectorDoorCrossing.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
14 #include <mrpt/obs/CRawlog.h>
15 #include <mrpt/obs/CSensoryFrame.h>
16 #include <mrpt/poses/CPose2D.h>
18 
19 namespace mrpt::detectors
20 {
21 /**
22  *
23  * \sa CPointsMap \ingroup mrpt_slam_grp
24  */
26 {
27  public:
28  /** The constructor. See options for customizing the default parameters.
29  */
31 
32  /** In this structure parameters can be changed to customize the
33  * behaviour of this algorithm.
34  */
35  struct TOptions
36  {
37  TOptions() = default;
38  /** The window size, in (action,observations) pairs;min. value is 2.
39  */
40  unsigned int windowSize{5};
41  float gridResolution{0.2f};
42  } options;
43 
44  /** A structure used as output in this method.
45  * \sa process
46  */
48  {
49  TDoorCrossingOutParams() = default;
50 
51  /** If this is false, all other output fields must not be
52  * taken into account since there is not yet enough information
53  * to fill the required observations window size.
54  */
55  bool enoughInformation{false};
56 
57  /** The likelihood of having just entering a new room, in
58  * the range [0,1]
59  */
61 
62  /** The gain in information produced by the last observation, in "bits".
63  */
64  float informationGain{0};
65 
66  /** The cumulative turning of the robot in radians for the movements in
67  * the "window"
68  */
70 
72  };
73 
74  /** The main method, where a new action/observation pair is added to the
75  * list.
76  * Here the list of old observations is updated, and a value with the
77  * probability
78  * of having pass a door is returned.
79  * \param in_poseChange The odometry (or any other meanway) based change in
80  * the robot pose since last observation to this one.
81  * \param in_sf The observations.
82  * \param out_estimation The estimation results.
83  *
84  * \sa TDoorCrossingOutParams
85  */
86  void process(
87  mrpt::obs::CActionRobotMovement2D& in_poseChange,
89  TDoorCrossingOutParams& out_estimation);
90 
91  /** Reset the detector, i.e. it erases all previous observations.
92  */
93  void clear();
94 
95  private:
96  /** The last observations and consecutive actions are stored here:
97  * Indexes (0,1) is the earlier (act,obs) pair, and the lastest pair
98  * is in indexes ((M-1)*2,(M-1)*2-1).
99  * Always contains (Action, Observation) pairs, in that order.
100  */
102 
103  /** Entropy of current, and last "map patchs". */
105  bool lastEntropyValid{false};
106 };
107 
108 } // namespace mrpt::detectors
mrpt::obs::CRawlog
This class stores a rawlog (robotic datasets) in one of two possible formats:
Definition: CRawlog.h:65
COccupancyGridMap2D.h
mrpt::detectors::CDetectorDoorCrossing
Definition: CDetectorDoorCrossing.h:25
mrpt::detectors
Definition: CCascadeClassifierDetection.h:14
mrpt::detectors::CDetectorDoorCrossing::TDoorCrossingOutParams::TDoorCrossingOutParams
TDoorCrossingOutParams()=default
mrpt::detectors::CDetectorDoorCrossing::process
void process(mrpt::obs::CActionRobotMovement2D &in_poseChange, mrpt::obs::CSensoryFrame &in_sf, TDoorCrossingOutParams &out_estimation)
The main method, where a new action/observation pair is added to the list.
Definition: CDetectorDoorCrossing.cpp:48
mrpt::detectors::CDetectorDoorCrossing::lastEntropy
mrpt::maps::COccupancyGridMap2D::TEntropyInfo lastEntropy
Definition: CDetectorDoorCrossing.h:104
mrpt::detectors::CDetectorDoorCrossing::TDoorCrossingOutParams
A structure used as output in this method.
Definition: CDetectorDoorCrossing.h:47
mrpt::detectors::CDetectorDoorCrossing::TOptions::gridResolution
float gridResolution
Definition: CDetectorDoorCrossing.h:41
mrpt::obs::CActionRobotMovement2D
Represents a probabilistic 2D movement of the robot mobile base.
Definition: CActionRobotMovement2D.h:30
CPose2D.h
mrpt::detectors::CDetectorDoorCrossing::TOptions
In this structure parameters can be changed to customize the behaviour of this algorithm.
Definition: CDetectorDoorCrossing.h:35
mrpt::detectors::CDetectorDoorCrossing::CDetectorDoorCrossing
CDetectorDoorCrossing()
The constructor.
Definition: CDetectorDoorCrossing.cpp:25
mrpt::detectors::CDetectorDoorCrossing::lastObs
mrpt::obs::CRawlog lastObs
The last observations and consecutive actions are stored here: Indexes (0,1) is the earlier (act,...
Definition: CDetectorDoorCrossing.h:101
mrpt::obs::CSensoryFrame
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:51
CActionRobotMovement2D.h
COutputLogger.h
mrpt::detectors::CDetectorDoorCrossing::clear
void clear()
Reset the detector, i.e.
Definition: CDetectorDoorCrossing.cpp:39
mrpt::detectors::CDetectorDoorCrossing::TDoorCrossingOutParams::informationGain
float informationGain
The gain in information produced by the last observation, in "bits".
Definition: CDetectorDoorCrossing.h:64
mrpt::detectors::CDetectorDoorCrossing::TDoorCrossingOutParams::enoughInformation
bool enoughInformation
If this is false, all other output fields must not be taken into account since there is not yet enoug...
Definition: CDetectorDoorCrossing.h:55
mrpt::detectors::CDetectorDoorCrossing::options
struct mrpt::detectors::CDetectorDoorCrossing::TOptions options
mrpt::detectors::CDetectorDoorCrossing::entropy
mrpt::maps::COccupancyGridMap2D::TEntropyInfo entropy
Entropy of current, and last "map patchs".
Definition: CDetectorDoorCrossing.h:104
mrpt::maps::CSimplePointsMap
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
Definition: CSimplePointsMap.h:30
mrpt::detectors::CDetectorDoorCrossing::TDoorCrossingOutParams::pointsMap
mrpt::maps::CSimplePointsMap pointsMap
Definition: CDetectorDoorCrossing.h:71
mrpt::system::COutputLogger
Versatile class for consistent logging and management of output messages.
Definition: system/COutputLogger.h:117
mrpt::maps::COccupancyGridMap2D::TEntropyInfo
Used for returning entropy related information.
Definition: COccupancyGridMap2D.h:441
CSensoryFrame.h
mrpt::detectors::CDetectorDoorCrossing::TDoorCrossingOutParams::cumulativeTurning
float cumulativeTurning
The cumulative turning of the robot in radians for the movements in the "window".
Definition: CDetectorDoorCrossing.h:69
mrpt::detectors::CDetectorDoorCrossing::TDoorCrossingOutParams::doorCrossingLikelihood
float doorCrossingLikelihood
The likelihood of having just entering a new room, in the range [0,1].
Definition: CDetectorDoorCrossing.h:60
mrpt::detectors::CDetectorDoorCrossing::TOptions::TOptions
TOptions()=default
CSimplePointsMap.h
mrpt::detectors::CDetectorDoorCrossing::lastEntropyValid
bool lastEntropyValid
Definition: CDetectorDoorCrossing.h:105
CRawlog.h
mrpt::detectors::CDetectorDoorCrossing::TOptions::windowSize
unsigned int windowSize
The window size, in (action,observations) pairs;min.
Definition: CDetectorDoorCrossing.h:40



Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Thu May 21 21:53:32 UTC 2020