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-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
29 {
30 namespace pbmap
31 {
32 /*! This class is used to explore the PbMap (or other previously acquired
33  * PbMaps)
34  * to find places observed previously (it has uses in e.g. place recognition or
35  * relocalization).
36  * PbMapLocaliser run its own thread, which is created at initialization.
37  *
38  * \ingroup mrpt_pbmap_grp
39  */
41 {
42  public:
43  /*!Constructor.*/
44  PbMapLocaliser(PbMap& mPbM, const std::string& config_file);
46 
47  /*!Vector to store the name of previous PbMaps (previous places).*/
48  std::vector<std::string> previousPbMapNames;
49 
50  /*!Vector of vectors containing previous PbMaps.*/
51  std::vector<PbMap> previousPbMaps;
52 
53  ///*!Vector to store the index of the floor plane for the previous PbMaps
54  ///(-1 indicates that the floor was not detected).*/ // Mover a la clase
55  /// PbMapLocaliser y montarlo en un define
56  // std::vector<int> vFloors;
57 
58  /*!Number of planes of our search space.*/
60 
61  /*!observedPlanes is a list containing the current observed planes.*/
62  std::vector<unsigned> vQueueObservedPlanes;
63 
64  /*!List of places where the system has been localised, keeping also the associated point cloud corresponding to the PbMap.*/ // Mover a la clase PbMapLocaliser
65  std::map<std::string, pcl::PointXYZ> foundPlaces;
66 
67  /*!Point cloud of recognized place.*/
68  pcl::PointCloud<pcl::PointXYZRGBA>::Ptr alignedModelPtr;
69 
70  std::map<unsigned, std::vector<std::pair<double, int>>> evalColor;
71 
72  private:
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.*/
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  /*!This executes the PbMapLocaliser's thread*/
104  void run();
105 
106  /*!PbMapLocaliser's thread handle*/
107  std::thread pbMapLocaliser_hd;
108 
109  /*!PbMapLocaliser's exit thread*/
110  bool stop_pbMapLocaliser();
111 
112  /*!PbMapLocaliser's stop controller*/
114 
115  /*!PbMapLocaliser's stop var*/
117 };
118 }
119 } // End of namespaces
120 
121 #endif
122 
123 #endif
mrpt::pbmap::PbMapLocaliser::evalColor
std::map< unsigned, std::vector< std::pair< double, int > > > evalColor
Definition: PbMapLocaliser.h:70
mrpt::pbmap::PbMapLocaliser::LoadPreviousPbMaps
void LoadPreviousPbMaps(std::string fileMaps)
Definition: PbMapLocaliser.cpp:51
mrpt::pbmap::PbMapLocaliser::m_pbMapLocaliser_finished
bool m_pbMapLocaliser_finished
Definition: PbMapLocaliser.h:116
mrpt::pbmap::PbMapLocaliser
Definition: PbMapLocaliser.h:40
mrpt::pbmap::PbMapLocaliser::score
double score
Definition: PbMapLocaliser.h:100
mrpt::pbmap::PbMapLocaliser::searchPlaneContext
bool searchPlaneContext(Plane &searchPlane)
! Searches the input plane in the rest of planes of the map taking into account the neighboring relat...
Definition: PbMapLocaliser.cpp:201
ConsistencyTest.h
mrpt::pbmap::PbMapLocaliser::totalPrevPlanes
size_t totalPrevPlanes
Definition: PbMapLocaliser.h:59
mrpt::pbmap::PbMapLocaliser::mPbMap
PbMap & mPbMap
Definition: PbMapLocaliser.h:74
mrpt::pbmap::PbMapLocaliser::previousPbMaps
std::vector< PbMap > previousPbMaps
Definition: PbMapLocaliser.h:51
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::pbmap::PbMapLocaliser::planeRecognitionLUT
std::map< std::string, std::pair< int, double > > planeRecognitionLUT
Definition: PbMapLocaliser.h:83
mrpt::pbmap::PbMapLocaliser::m_pbMapLocaliser_must_stop
bool m_pbMapLocaliser_must_stop
Definition: PbMapLocaliser.h:113
mrpt::pbmap::PbMapLocaliser::bestMatch
std::map< unsigned, unsigned > bestMatch
Definition: PbMapLocaliser.h:97
mrpt::pbmap::PbMapLocaliser::getAreaMatch
double getAreaMatch()
Definition: PbMapLocaliser.cpp:183
mrpt::pbmap::PbMapLocaliser::PbMapLocaliser
PbMapLocaliser(PbMap &mPbM, const std::string &config_file)
Definition: PbMapLocaliser.cpp:33
mrpt::pbmap::PbMapLocaliser::previousPbMapNames
std::vector< std::string > previousPbMapNames
Definition: PbMapLocaliser.h:48
mrpt::pbmap::SubgraphMatcher
Definition: SubgraphMatcher.h:37
mrpt::pbmap::Plane
A class used to store a planar feature (Plane for short).
Definition: Plane.h:46
mrpt::pbmap::PbMapLocaliser::foundPlaces
std::map< std::string, pcl::PointXYZ > foundPlaces
Definition: PbMapLocaliser.h:65
mrpt::pbmap::PbMap
A class used to store a Plane-based Map (PbMap).
Definition: pbmap/PbMap.h:47
mrpt::pbmap::PbMapLocaliser::run
void run()
Definition: PbMapLocaliser.cpp:396
mrpt::pbmap::PbMapLocaliser::matcher
SubgraphMatcher matcher
Definition: PbMapLocaliser.h:77
SubgraphMatcher.h
mrpt::pbmap::PbMapLocaliser::pbMapLocaliser_hd
std::thread pbMapLocaliser_hd
Definition: PbMapLocaliser.h:107
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::pbmap::PbMapLocaliser::~PbMapLocaliser
~PbMapLocaliser()
Definition: PbMapLocaliser.cpp:540
PbMap.h
mrpt::pbmap::PbMapLocaliser::bestMap
unsigned bestMap
Definition: PbMapLocaliser.h:94
mrpt::pbmap::PbMapLocaliser::stop_pbMapLocaliser
bool stop_pbMapLocaliser()
Definition: PbMapLocaliser.cpp:529
mrpt::pbmap::PbMapLocaliser::compareSubgraphNeighbors
void compareSubgraphNeighbors(SubgraphMatcher &matcher)
Definition: PbMapLocaliser.cpp:92
mrpt::pbmap::PbMapLocaliser::vQueueObservedPlanes
std::vector< unsigned > vQueueObservedPlanes
Definition: PbMapLocaliser.h:62
mrpt::pbmap::PbMapLocaliser::alignedModelPtr
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr alignedModelPtr
Definition: PbMapLocaliser.h:68



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST