Main MRPT website > C++ reference for MRPT 1.9.9
PbMapLocaliser.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 /* Plane-based Map (PbMap) library
11  * Construction of plane-based maps and localization in it from RGBD Images.
12  * Writen by Eduardo Fernandez-Moral. See docs for <a
13  * href="group__mrpt__pbmap__grp.html" >mrpt-pbmap</a>
14  */
15 
16 #ifndef __PBMAPLOCALISER_H
17 #define __PBMAPLOCALISER_H
18 
19 #include <mrpt/config.h>
20 
21 #if MRPT_HAS_PCL
22 
23 #include <mrpt/utils/utils_defs.h>
24 
25 #include <mrpt/pbmap/PbMap.h>
28 #include <thread>
29 
30 namespace mrpt
31 {
32 namespace pbmap
33 {
34 /*! This class is used to explore the PbMap (or other previously acquired
35  * PbMaps)
36  * to find places observed previously (it has uses in e.g. place recognition or
37  * relocalization).
38  * PbMapLocaliser run its own thread, which is created at initialization.
39  *
40  * \ingroup mrpt_pbmap_grp
41  */
43 {
44  public:
45  /*!Constructor.*/
46  PbMapLocaliser(PbMap& mPbM, const std::string& config_file);
48 
49  /*!Vector to store the name of previous PbMaps (previous places).*/
50  std::vector<std::string> previousPbMapNames;
51 
52  /*!Vector of vectors containing previous PbMaps.*/
53  std::vector<PbMap> previousPbMaps;
54 
55  ///*!Vector to store the index of the floor plane for the previous PbMaps
56  ///(-1 indicates that the floor was not detected).*/ // Mover a la clase
57  /// PbMapLocaliser y montarlo en un define
58  // std::vector<int> vFloors;
59 
60  /*!Number of planes of our search space.*/
62 
63  /*!observedPlanes is a list containing the current observed planes.*/
64  std::vector<unsigned> vQueueObservedPlanes;
65 
66  /*!List of places where the system has been localised, keeping also the associated point cloud corresponding to the PbMap.*/ // Mover a la clase PbMapLocaliser
67  std::map<std::string, pcl::PointXYZ> foundPlaces;
68 
69  /*!Point cloud of recognized place.*/
70  pcl::PointCloud<pcl::PointXYZRGBA>::Ptr alignedModelPtr;
71 
72  std::map<unsigned, std::vector<std::pair<double, int>>> evalColor;
73 
74  private:
75  /*!The current PbMap.*/
77 
78  /*!The matching object.*/
80 
81  /*!Load previous PbMaps to search for previous places.*/
82  void LoadPreviousPbMaps(std::string fileMaps);
83 
84  /*!List of places that have been matched, together with their plane correspondences.*/ // Cambiar nombre
85  std::map<std::string, std::pair<int, double>> planeRecognitionLUT;
86 
87  /*!Search the subgraph defined by a plane (neighborhood of 1-connected planes) in the rest of the PbMap or PbMaps aquired till the moment.*/ // Cambiar nombre
88  bool searchPlaneContext(Plane& searchPlane);
89 
90  /*!Search the 2nd order neighbors.*/
92 
93  double getAreaMatch();
94 
95  /*!Best previous PbMap correspondence.*/
96  unsigned bestMap;
97 
98  /*!Best correspondence between pair of planes.*/
99  std::map<unsigned, unsigned> bestMatch;
100 
101  /*!Score of the matched places.*/ // Cambiar nombre o Quitar!
102  double score;
103 
104  protected:
105  /*!This executes the PbMapLocaliser's thread*/
106  void run();
107 
108  /*!PbMapLocaliser's thread handle*/
109  std::thread pbMapLocaliser_hd;
110 
111  /*!PbMapLocaliser's exit thread*/
112  bool stop_pbMapLocaliser();
113 
114  /*!PbMapLocaliser's stop controller*/
116 
117  /*!PbMapLocaliser's stop var*/
119 };
120 }
121 } // End of namespaces
122 
123 #endif
124 
125 #endif
std::vector< std::string > previousPbMapNames
std::map< std::string, pcl::PointXYZ > foundPlaces
A class used to store a planar feature (Plane for short).
Definition: Plane.h:48
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr alignedModelPtr
GLsizei const GLchar ** string
Definition: glext.h:4101
std::vector< unsigned > vQueueObservedPlanes
std::map< unsigned, unsigned > bestMatch
bool searchPlaneContext(Plane &searchPlane)
! Searches the input plane in the rest of planes of the map taking into account the neighboring relat...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void compareSubgraphNeighbors(SubgraphMatcher &matcher)
std::map< unsigned, std::vector< std::pair< double, int > > > evalColor
void LoadPreviousPbMaps(std::string fileMaps)
std::vector< PbMap > previousPbMaps
A class used to store a Plane-based Map (PbMap).
Definition: pbmap/PbMap.h:49
PbMapLocaliser(PbMap &mPbM, const std::string &config_file)
std::map< std::string, std::pair< int, double > > planeRecognitionLUT
*PbMapLocaliser y montarlo en un define *size_t totalPrevPlanes



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019