MRPT  2.0.4
HMT_SLAM_common.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 
13 #include <set>
14 
15 #define COMMON_TOPOLOG_HYP static_cast<THypothesisID>(0)
16 
17 #define NODE_ANNOTATION_METRIC_MAPS "metricMaps" // CMultiMetricMap
18 #define NODE_ANNOTATION_REF_POSEID "refPoseID" // TPoseID
19 #define NODE_ANNOTATION_POSES_GRAPH "posesGraph" // CRobotPosesGraph
20 
21 #define NODE_ANNOTATION_PLACE_POSE "placePose" // mrpt::poses::CPoint2D
22 
23 #define ARC_ANNOTATION_DELTA \
24  "Delta" // CPose3DPDF (for the current implementation, it's a
25 // CPose3DPDFParticles)
26 #define ARC_ANNOTATION_DELTA_SRC_POSEID \
27  "Delta_poseID_src" // TPoseID (elemental datatype)
28 #define ARC_ANNOTATION_DELTA_TRG_POSEID \
29  "Delta_poseID_trg" // TPoseID (elemental datatype)
30 
31 /** Used in constructor of mrpt::hmtslam::CHMHMapArc */
32 #define ARC_TYPES "Membership,Navegability,RelativePose,Location"
33 #define DEFAULT_ARC_TYPE "Membership"
34 
35 /** Used in constructor of mrpt::hmtslam::CHMHMapNode */
36 #define NODE_TYPES "Place,Area,TopologicalMap,Object"
37 #define DEFAULT_NODE_TYPE "Place"
38 
39 // Used as current robot pose when initializing an empty HMT-map.
40 #define POSEID_INVALID static_cast<TPoseID>(-1)
41 
42 #define AREAID_INVALID static_cast<uint64_t>(-1)
43 
44 #define MSG_SOURCE_LSLAM 1
45 #define MSG_SOURCE_AA 2
46 
47 namespace mrpt::hmtslam
48 {
49 class CHMHMapArc;
50 class CHMHMapNode;
51 
52 /** An integer number uniquely identifying each of the concurrent hypotheses for
53  * the robot topological path (& possibly local metric clusters) in HMT-SLAM.
54  * The number 0 has the special meaning of "that part of the map/robot path
55  * in which all hypotheses agree".
56  * They can be generated from CHMTSLAM::generateHypothesisID()
57  */
58 using THypothesisID = int64_t;
59 
60 /** An integer number uniquely identifying each robot pose stored in HMT-SLAM.
61  * They can be generated from CHMTSLAM::generatePoseID()
62  */
63 using TPoseID = uint64_t;
64 
65 using TPairPoseIDs = std::pair<TPoseID, TPoseID>;
66 
67 using TPoseIDList = std::vector<TPoseID>;
68 using TPoseIDSet = std::set<TPoseID>;
69 
70 /** A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid
71  * maps.
72  * \sa THypothesisID, CHierarchicalMHMap
73  * \ingroup mrpt_hmtslam_grp
74  */
76  public std::set<THypothesisID>
77 {
79 
80  public:
81  /** Default constructor
82  */
83  THypothesisIDSet() = default;
84  /** Constructor with one initial element
85  */
86  THypothesisIDSet(const THypothesisID& val) { insert(val); }
87  ~THypothesisIDSet() override = default;
88  /** Returns true if the hypothesis is into the set.
89  */
90  bool has(const THypothesisID& val) const
91  {
92  return find(val) != end() || find(COMMON_TOPOLOG_HYP) != end();
93  }
94 
95  /** Dump to console.
96  */
97  void debugDump() const;
98 };
99 
100 /** A class for storing a sequence of arcs (a path).
101  * \sa CHMTSLAM
102  */
104  std::shared_ptr<mrpt::hmtslam::CHMHMapArc>>
105 {
106  private:
109 
110  public:
111  void debugDump();
114 };
115 
116 } // namespace mrpt::hmtslam
std::set< TPoseID > TPoseIDSet
const_iterator find(const KEY &key) const
Definition: ts_hash_map.h:224
#define COMMON_TOPOLOG_HYP
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
bool has(const THypothesisID &val) const
Returns true if the hypothesis is into the set.
uint64_t TPoseID
An integer number uniquely identifying each robot pose stored in HMT-SLAM.
std::vector< TPoseID > TPoseIDList
void write(mrpt::serialization::CArchive &out) const
Definition: CHMHMapArc.cpp:159
This class implements a STL container with features of both, a std::set and a std::list.
A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps. ...
int val
Definition: mrpt_jpeglib.h:957
const_iterator end() const
Definition: ts_hash_map.h:246
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:54
mrpt::vision::TStereoCalibResults out
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:30
void debugDump() const
Dump to console.
void read(mrpt::serialization::CArchive &in)
Definition: CHMHMapArc.cpp:147
THypothesisIDSet(const THypothesisID &val)
Constructor with one initial element.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
THypothesisIDSet()=default
Default constructor.
std::pair< TPoseID, TPoseID > TPairPoseIDs
~THypothesisIDSet() override=default
A class for storing a sequence of arcs (a path).



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