MRPT  2.0.4
CHMHMapArc.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-2020, 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 #pragma once
10 
12 #include <mrpt/obs/CSensoryFrame.h>
14 
15 namespace mrpt::hmtslam
16 {
17 class CHierarchicalMHMap;
18 
19 /** A class for representing an arc between two nodes in a hierarchical,
20  * multi-hypothesis map.
21  * The arc itself will be considered only if some given hypothesisID matchs
22  * its own ID.
23  * \note Create objects by invoking the class factory "::Create"
24  *
25  * \sa CHierarchicalMHMap,CHMHMapNode
26  * \ingroup mrpt_hmtslam_grp
27  */
29 {
30  friend class CHierarchicalMHMap;
31  friend class CHMHMapNode;
33  friend class TArcList;
34 
36 
37  public:
38  /** The hypothesis IDs under which this arc exists.
39  */
41 
42  protected:
43  /** The origin/target nodes for this arc.
44  */
46 
47  /** The hierarchical graph in which this object is into. */
49 
50  /** Event handler to be called just before a node is being destroyed: it
51  * should be called only for nodes involved in the arc, altought other cases
52  * must be handled without effects
53  * When a node involved in the arc is delected, the corresponding pointer
54  * in the arc will be set to nullptr and the arc is no longer a valid one.
55  */
56  void onNodeDestruction(CHMHMapNode* node);
57 
58  public:
59  /** Private constructor (see ::Create class factory)
60  */
61  CHMHMapArc(
62  const CHMHMapNode::TNodeID& from = 0,
63  const CHMHMapNode::TNodeID& to = 0,
64  const THypothesisIDSet& hyps = THypothesisIDSet(),
65  CHierarchicalMHMap* parent = nullptr);
66 
67  /** Alternative constructor, using pointers for convenience.
68  */
69  CHMHMapArc(
71  const THypothesisIDSet& hyps, CHierarchicalMHMap* parent);
72 
73  /** Destructor
74  */
75  ~CHMHMapArc() override;
76 
77  /** Return the starting node of the arc:
78  */
80  {
82  return m_nodeFrom;
83  }
84 
85  /** Return the ending node of the arc:
86  */
88  {
90  return m_nodeTo;
91  }
92 
93  /** The type of the arc, the possibilities are:
94  - "Membership": for abstractions
95  - "Navegability"
96  - "RelativePose"
97  */
98  std::string m_arcType;
99 
100  /** The annotations of the arc, see the general description of the class for
101  * possible properties and values.
102  */
104 
105 }; // End of class def.
106 
107 } // namespace mrpt::hmtslam
THypothesisIDSet m_hypotheses
The hypothesis IDs under which this arc exists.
Definition: CHMHMapArc.h:40
mrpt::safe_ptr< CHierarchicalMHMap > m_parent
The hierarchical graph in which this object is into.
Definition: CHMHMapArc.h:48
Represents a set of nodes and arcs, posibly only a part of the whole hierarchical, multi-hypothesis map.
mrpt::graphs::TNodeID TNodeID
The type of the IDs of nodes.
Definition: CHMHMapNode.h:44
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
CHMHMapNode::TNodeID m_nodeTo
Definition: CHMHMapArc.h:45
#define AREAID_INVALID
CHMHMapNode::TNodeID getNodeFrom() const
Return the starting node of the arc:
Definition: CHMHMapArc.h:79
CHMHMapNode::TNodeID m_nodeFrom
The origin/target nodes for this arc.
Definition: CHMHMapArc.h:45
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:120
A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps. ...
CHMHMapArc(const CHMHMapNode::TNodeID &from=0, const CHMHMapNode::TNodeID &to=0, const THypothesisIDSet &hyps=THypothesisIDSet(), CHierarchicalMHMap *parent=nullptr)
Private constructor (see ::Create class factory)
Definition: CHMHMapArc.cpp:21
std::string m_arcType
The type of the arc, the possibilities are:
Definition: CHMHMapArc.h:98
CMHPropertiesValuesList m_annotations
The annotations of the arc, see the general description of the class for possible properties and valu...
Definition: CHMHMapArc.h:103
A wrapper class for pointers that can be safely copied with "=" operator without problems.
Definition: safe_pointers.h:71
The most high level class for storing hybrid, multi-hypothesis maps in a graph-based model...
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:30
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
A class for representing an arc between two nodes in a hierarchical, multi-hypothesis map...
Definition: CHMHMapArc.h:28
~CHMHMapArc() override
Destructor.
Definition: CHMHMapArc.cpp:59
A class for storing a sequence of arcs (a path).
A class for representing a node in a hierarchical, multi-hypothesis map.
Definition: CHMHMapNode.h:33
CHMHMapNode::TNodeID getNodeTo() const
Return the ending node of the arc:
Definition: CHMHMapArc.h:87
void onNodeDestruction(CHMHMapNode *node)
Event handler to be called just before a node is being destroyed: it should be called only for nodes ...
Definition: CHMHMapArc.cpp:74



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020