MRPT  1.9.9
Subgraph.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 #if MRPT_HAS_PCL
20 
21 #include <mrpt/pbmap/PbMap.h>
22 
23 namespace mrpt::pbmap
24 {
25 /*! This class defines a subgraph inside a PbMap.
26  * This subgraph represents the entity to be matched in order to recognize a
27  * previous place.
28  *
29  * \ingroup mrpt_pbmap_grp
30  */
31 class Subgraph
32 {
33  public:
34  /*!Subgraph constructor with no parameters*/
35  Subgraph(){};
36 
37  /*!Construct a subgraph, inside a given PbMap, as a set of neighborh planes
38  * (1-connected) of a reference plane.*/
39  Subgraph(PbMap* pPbMap, const unsigned& refPlaneId) : pPBM(pPbMap)
40  {
41  subgraphPlanesIdx.insert(refPlaneId);
42  // Add proximity neighbors
43  // for(std::set<unsigned>::iterator it =
44  // pPBM->vPlanes[refPlaneId].nearbyPlanes.begin(); it !=
45  // pPBM->vPlanes[refPlaneId].nearbyPlanes.end(); it++)
46  // subgraphPlanesIdx.insert(*it);
47 
48  // Add neighbors co-visible neighbors
49  for (auto it = pPBM->vPlanes[refPlaneId].neighborPlanes.begin();
50  it != pPBM->vPlanes[refPlaneId].neighborPlanes.end(); it++)
51  subgraphPlanesIdx.insert(it->first);
52 
53 #ifdef _VERBOSE
54  std::cout << "Subgraph constructor: ";
55  for (std::set<unsigned>::iterator it = subgraphPlanesIdx.begin();
56  it != subgraphPlanesIdx.end(); it++)
57  std::cout << *it << " ";
58  std::cout << std::endl;
59 #endif
60  };
61 
62  PbMap* pPBM;
63  std::set<unsigned> subgraphPlanesIdx;
64 };
65 } // namespace mrpt::pbmap
66 #endif
std::set< unsigned > subgraphPlanesIdx
Definition: Subgraph.h:63
Subgraph(PbMap *pPbMap, const unsigned &refPlaneId)
Definition: Subgraph.h:39
std::vector< Plane > vPlanes
Definition: pbmap/PbMap.h:54
A class used to store a Plane-based Map (PbMap).
Definition: pbmap/PbMap.h:44



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