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



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020