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-2018, 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/pbmap/PbMap.h>
26 #include <thread>
27 
28 namespace mrpt::pbmap
29 {
30 /*! This class is used to explore the PbMap (or other previously acquired
31  * PbMaps)
32  * to find places observed previously (it has uses in e.g. place recognition or
33  * relocalization).
34  * PbMapLocaliser run its own thread, which is created at initialization.
35  *
36  * \ingroup mrpt_pbmap_grp
37  */
39 {
40  public:
41  /*!Constructor.*/
42  PbMapLocaliser(PbMap& mPbM, const std::string& config_file);
44 
45  /*!Vector to store the name of previous PbMaps (previous places).*/
46  std::vector<std::string> previousPbMapNames;
47 
48  /*!Vector of vectors containing previous PbMaps.*/
49  std::vector<PbMap> previousPbMaps;
50 
51  ///*!Vector to store the index of the floor plane for the previous PbMaps
52  ///(-1 indicates that the floor was not detected).*/ // Mover a la clase
53  /// PbMapLocaliser y montarlo en un define
54  // std::vector<int> vFloors;
55 
56  /*!Number of planes of our search space.*/
58 
59  /*!observedPlanes is a list containing the current observed planes.*/
60  std::vector<unsigned> vQueueObservedPlanes;
61 
62  /*!List of places where the system has been localised, keeping also the associated point cloud corresponding to the PbMap.*/ // Mover a la clase PbMapLocaliser
63  std::map<std::string, pcl::PointXYZ> foundPlaces;
64 
65  /*!Point cloud of recognized place.*/
66  pcl::PointCloud<pcl::PointXYZRGBA>::Ptr alignedModelPtr;
67 
68  std::map<unsigned, std::vector<std::pair<double, int>>> evalColor;
69 
70  private:
71  /*!The current PbMap.*/
73 
74  /*!The matching object.*/
76 
77  /*!Load previous PbMaps to search for previous places.*/
78  void LoadPreviousPbMaps(std::string fileMaps);
79 
80  /*!List of places that have been matched, together with their plane correspondences.*/ // Cambiar nombre
81  std::map<std::string, std::pair<int, double>> planeRecognitionLUT;
82 
83  /*!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
84  bool searchPlaneContext(Plane& searchPlane);
85 
86  /*!Search the 2nd order neighbors.*/
88 
89  double getAreaMatch();
90 
91  /*!Best previous PbMap correspondence.*/
92  unsigned bestMap;
93 
94  /*!Best correspondence between pair of planes.*/
95  std::map<unsigned, unsigned> bestMatch;
96 
97  /*!Score of the matched places.*/ // Cambiar nombre o Quitar!
98  double score;
99 
100  protected:
101  /*!This executes the PbMapLocaliser's thread*/
102  void run();
103 
104  /*!PbMapLocaliser's thread handle*/
105  std::thread pbMapLocaliser_hd;
106 
107  /*!PbMapLocaliser's exit thread*/
108  bool stop_pbMapLocaliser();
109 
110  /*!PbMapLocaliser's stop controller*/
112 
113  /*!PbMapLocaliser's stop var*/
115 };
116 }
117 #endif
118 
119 #endif
120 
121 
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:44
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...
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:45
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: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020