Main MRPT website > C++ reference for MRPT 1.5.6
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 href="group__mrpt__pbmap__grp.html" >mrpt-pbmap</a>
13  */
14 
15 #ifndef __PBMAPLOCALISER_H
16 #define __PBMAPLOCALISER_H
17 
18 #include <mrpt/config.h>
19 
20 #if MRPT_HAS_PCL
21 
22 #include <mrpt/utils/utils_defs.h>
23 
24 #include <mrpt/system/threads.h>
25 
26 #include <mrpt/pbmap/PbMap.h>
30 
31 namespace mrpt {
32 namespace pbmap {
33 
34  /*! This class is used to explore the PbMap (or other previously acquired PbMaps)
35  * to find places observed previously (it has uses in e.g. place recognition or relocalization).
36  * PbMapLocaliser run its own thread, which is created at initialization.
37  *
38  * \ingroup mrpt_pbmap_grp
39  */
41  {
42  public:
43 
44  /*!Constructor.*/
45  PbMapLocaliser(PbMap &mPbM, const std::string &config_file);
46  ~PbMapLocaliser();
47 
48  /*!Vector to store the name of previous PbMaps (previous places).*/
49  std::vector<std::string> previousPbMapNames;
50 
51  /*!Vector of vectors containing previous PbMaps.*/
52  std::vector<PbMap> previousPbMaps;
53 
54  ///*!Vector to store the index of the floor plane for the previous PbMaps (-1 indicates that the floor was not detected).*/ // Mover a la clase PbMapLocaliser y montarlo en un define
55  // std::vector<int> vFloors;
56 
57  /*!Number of planes of our search space.*/
59 
60  /*!observedPlanes is a list containing the current observed planes.*/
61  std::vector<unsigned> vQueueObservedPlanes;
62 
63  /*!List of places where the system has been localised, keeping also the associated point cloud corresponding to the PbMap.*/ // Mover a la clase PbMapLocaliser
64  std::map<std::string, pcl::PointXYZ> foundPlaces;
65 
66  /*!Point cloud of recognized place.*/
67  pcl::PointCloud<pcl::PointXYZRGBA>::Ptr alignedModelPtr;
68 
69  std::map<unsigned, std::vector< std::pair<double,int> > > evalColor;
70 
71  private:
72 
73  /*!The current PbMap.*/
75 
76  /*!The matching object.*/
78 
79  /*!Load previous PbMaps to search for previous places.*/
80  void LoadPreviousPbMaps(std::string fileMaps);
81 
82  /*!List of places that have been matched, together with their plane correspondences.*/ // Cambiar nombre
83  std::map<std::string, std::pair<int,double> > planeRecognitionLUT;
84 
85  /*!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
86  bool searchPlaneContext(Plane &searchPlane);
87 
88  /*!Search the 2nd order neighbors.*/
89  void compareSubgraphNeighbors(SubgraphMatcher &matcher);
90 
91  double getAreaMatch();
92 
93  /*!Best previous PbMap correspondence.*/
94  unsigned bestMap;
95 
96  /*!Best correspondence between pair of planes.*/
97  std::map<unsigned, unsigned> bestMatch;
98 
99  /*!Score of the matched places.*/ // Cambiar nombre o Quitar!
100  double score;
101 
102  protected:
103 
104  /*!This executes the PbMapLocaliser's thread*/
105  void run();
106 
107  /*!PbMapLocaliser's thread handle*/
109 
110  /*!PbMapLocaliser's exit thread*/
111  bool stop_pbMapLocaliser();
112 
113  /*!PbMapLocaliser's stop controller*/
115 
116  /*!PbMapLocaliser's stop var*/
118  };
119 
120 } } // End of namespaces
121 
122 #endif
123 
124 #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
std::map< std::string, std::pair< int, double > > planeRecognitionLUT
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr alignedModelPtr
std::vector< unsigned > vQueueObservedPlanes
std::map< unsigned, unsigned > bestMatch
GLsizei const GLcharARB ** string
Definition: glew.h:3293
mrpt::system::TThreadHandle pbMapLocaliser_hd
This structure contains the information needed to interface the threads API on each platform: ...
Definition: threads.h:25
std::map< unsigned, std::vector< std::pair< double, int > > > evalColor
std::vector< PbMap > previousPbMaps
A class used to store a Plane-based Map (PbMap).
Definition: PbMap.h:45



Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018