Main MRPT website > C++ reference for MRPT 1.5.7
Subgraph.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 __SUBGRAPH_H
16 #define __SUBGRAPH_H
17 
18 #include <mrpt/config.h>
19 #if MRPT_HAS_PCL
20 
21 #include <mrpt/utils/utils_defs.h>
23 
24 #include <mrpt/pbmap/PbMap.h>
25 
26 namespace mrpt {
27 namespace pbmap {
28 
29  /*! This class defines a subgraph inside a PbMap.
30  * This subgraph represents the entity to be matched in order to recognize a previous place.
31  *
32  * \ingroup mrpt_pbmap_grp
33  */
35  {
36  public:
37  /*!Subgraph constructor with no parameters*/
38  Subgraph(){};
39 
40  /*!Construct a subgraph, inside a given PbMap, as a set of neighborh planes (1-connected) of a reference plane.*/
41  Subgraph(PbMap *pPbMap, const unsigned &refPlaneId) :
42  pPBM(pPbMap)
43  {
44  subgraphPlanesIdx.insert(refPlaneId);
45  // Add proximity neighbors
46 // for(std::set<unsigned>::iterator it = pPBM->vPlanes[refPlaneId].nearbyPlanes.begin(); it != pPBM->vPlanes[refPlaneId].nearbyPlanes.end(); it++)
47 // subgraphPlanesIdx.insert(*it);
48 
49  // Add neighbors co-visible neighbors
50  for(std::map<unsigned,unsigned>::iterator it = pPBM->vPlanes[refPlaneId].neighborPlanes.begin(); 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(); it != subgraphPlanesIdx.end(); it++)
56  std::cout << *it << " ";
57  std::cout << std::endl;
58  #endif
59  };
60 
61  PbMap *pPBM;
62  std::set<unsigned> subgraphPlanesIdx;
63 
64  };
65 
66 } } // End of namespaces
67 
68 #endif
69 #endif
Scalar * iterator
Definition: eigen_plugins.h:23
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::set< unsigned > subgraphPlanesIdx
Definition: Subgraph.h:62
Subgraph(PbMap *pPbMap, const unsigned &refPlaneId)
Definition: Subgraph.h:41
A class used to store a Plane-based Map (PbMap).
Definition: pbmap/PbMap.h:45



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019