Main MRPT website > C++ reference for 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
49 {
50 namespace hmtslam
51 {
52 class CHMHMapArc;
53 class CHMHMapNode;
54 
55 /** An integer number uniquely identifying each of the concurrent hypotheses for
56  * the robot topological path (& possibly local metric clusters) in HMT-SLAM.
57  * The number 0 has the special meaning of "that part of the map/robot path
58  * in which all hypotheses agree".
59  * They can be generated from CHMTSLAM::generateHypothesisID()
60  */
62 
63 /** An integer number uniquely identifying each robot pose stored in HMT-SLAM.
64  * They can be generated from CHMTSLAM::generatePoseID()
65  */
66 using TPoseID = uint64_t;
67 
68 using TPairPoseIDs = std::pair<TPoseID, TPoseID>;
69 
70 using TPoseIDList = std::vector<TPoseID>;
71 using TPoseIDSet = std::set<TPoseID>;
72 
73 /** A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid
74  * maps.
75  * \sa THypothesisID, CHierarchicalMHMap
76  * \ingroup mrpt_hmtslam_grp
77  */
79  public std::set<THypothesisID>
80 {
82 
83  public:
84  /** Default constructor
85  */
87  /** Constructor with one initial element
88  */
89  THypothesisIDSet(const THypothesisID& val) { insert(val); }
90  virtual ~THypothesisIDSet() {}
91  /** Returns true if the hypothesis is into the set.
92  */
93  bool has(const THypothesisID& val) const
94  {
95  return find(val) != end() || find(COMMON_TOPOLOG_HYP) != end();
96  }
97 
98  /** Dump to console.
99  */
100  void debugDump() const;
101 };
102 
103 /** A class for storing a sequence of arcs (a path).
104  * \sa CHMTSLAM
105  */
107  std::shared_ptr<mrpt::hmtslam::CHMHMapArc>>
108 {
109  private:
112 
113  public:
114  void debugDump();
116  void write(mrpt::serialization::CArchive& out) const;
117 };
118 
119 } // namespace hmtslam
120 } // namespace mrpt
121 
122 #endif
std::set< TPoseID > TPoseIDSet
const_iterator find(const KEY &key) const
Definition: ts_hash_map.h:219
#define COMMON_TOPOLOG_HYP
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...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#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:48
GLuint in
Definition: glext.h:7274
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:32
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: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019