MRPT  1.9.9
PbMapLocaliser.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-2019, 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 
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 #pragma once
17 
18 #include <mrpt/config.h>
19 
20 #if MRPT_HAS_PCL
21 
23 #include <mrpt/pbmap/PbMap.h>
25 #include <thread>
26 
27 namespace mrpt::pbmap
28 {
29 /*! This class is used to explore the PbMap (or other previously acquired
30  * PbMaps)
31  * to find places observed previously (it has uses in e.g. place recognition or
32  * relocalization).
33  * PbMapLocaliser run its own thread, which is created at initialization.
34  *
35  * \ingroup mrpt_pbmap_grp
36  */
38 {
39  public:
40  /*!Constructor.*/
41  PbMapLocaliser(PbMap& mPbM, const std::string& config_file);
43 
44  /*!Vector to store the name of previous PbMaps (previous places).*/
45  std::vector<std::string> previousPbMapNames;
46 
47  /*!Vector of vectors containing previous PbMaps.*/
48  std::vector<PbMap> previousPbMaps;
49 
50  ///*!Vector to store the index of the floor plane for the previous PbMaps
51  ///(-1 indicates that the floor was not detected).*/ // Mover a la clase
52  /// PbMapLocaliser y montarlo en un define
53  // std::vector<int> vFloors;
54 
55  /*!Number of planes of our search space.*/
57 
58  /*!observedPlanes is a list containing the current observed planes.*/
59  std::vector<unsigned> vQueueObservedPlanes;
60 
61  /*!List of places where the system has been localised, keeping also the
62  * 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
81  * correspondences.*/ // Cambiar
82  // nombre
83  std::map<std::string, std::pair<int, double>> planeRecognitionLUT;
84 
85  /*!Search the subgraph defined by a plane (neighborhood of 1-connected
86  * planes) in the rest of the PbMap or PbMaps aquired till the moment.*/ // Cambiar nombre
87  bool searchPlaneContext(Plane& searchPlane);
88 
89  /*!Search the 2nd order neighbors.*/
91 
92  double getAreaMatch();
93 
94  /*!Best previous PbMap correspondence.*/
95  unsigned bestMap;
96 
97  /*!Best correspondence between pair of planes.*/
98  std::map<unsigned, unsigned> bestMatch;
99 
100  /*!Score of the matched places.*/ // Cambiar nombre o Quitar!
101  double score;
102 
103  protected:
104  /*!This executes the PbMapLocaliser's thread*/
105  void run();
106 
107  /*!PbMapLocaliser's thread handle*/
108  std::thread pbMapLocaliser_hd;
109 
110  /*!PbMapLocaliser's exit thread*/
111  bool stop_pbMapLocaliser();
112 
113  /*!PbMapLocaliser's stop controller*/
115 
116  /*!PbMapLocaliser's stop var*/
118 };
119 } // namespace mrpt::pbmap
120 #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:43
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr alignedModelPtr
GLsizei const GLchar ** string
Definition: glext.h:4116
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:44
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: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019