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:
111  std::shared_ptr<mrpt::hmtslam::CHMHMapArc>>;
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
mrpt::hmtslam::THypothesisIDSet::THypothesisIDSet
THypothesisIDSet(const THypothesisID &val)
Constructor with one initial element.
Definition: HMT_SLAM_common.h:89
mrpt::hmtslam::TArcList::write
void write(mrpt::serialization::CArchive &out) const
Definition: CHMHMapArc.cpp:159
mrpt::hmtslam::TArcList::read
void read(mrpt::serialization::CArchive &in)
Definition: CHMHMapArc.cpp:147
end
GLuint GLuint end
Definition: glext.h:3528
mrpt::containers::find
const_iterator find(const KEY &key) const
Definition: ts_hash_map.h:219
list_searchable.h
int64_t
__int64 int64_t
Definition: rptypes.h:49
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::serialization::CArchive
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:48
val
int val
Definition: mrpt_jpeglib.h:955
mrpt::hmtslam::TArcList::debugDump
void debugDump()
Definition: CHMHMapArc.cpp:135
mrpt::hmtslam::THypothesisIDSet::~THypothesisIDSet
virtual ~THypothesisIDSet()
Definition: HMT_SLAM_common.h:90
mrpt::hmtslam::THypothesisIDSet::has
bool has(const THypothesisID &val) const
Returns true if the hypothesis is into the set.
Definition: HMT_SLAM_common.h:93
COMMON_TOPOLOG_HYP
#define COMMON_TOPOLOG_HYP
Definition: HMT_SLAM_common.h:16
mrpt::hmtslam::THypothesisIDSet::debugDump
void debugDump() const
Dump to console.
uint64_t
unsigned __int64 uint64_t
Definition: rptypes.h:50
mrpt::hmtslam::TPoseIDSet
std::set< TPoseID > TPoseIDSet
Definition: HMT_SLAM_common.h:71
mrpt::serialization::CSerializable
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:32
mrpt::hmtslam::TPairPoseIDs
std::pair< TPoseID, TPoseID > TPairPoseIDs
Definition: HMT_SLAM_common.h:68
mrpt::hmtslam::THypothesisIDSet
A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps.
Definition: HMT_SLAM_common.h:78
mrpt::hmtslam::TPoseID
uint64_t TPoseID
An integer number uniquely identifying each robot pose stored in HMT-SLAM.
Definition: HMT_SLAM_common.h:66
mrpt::hmtslam::TArcList
A class for storing a sequence of arcs (a path).
Definition: HMT_SLAM_common.h:106
mrpt::hmtslam::THypothesisIDSet::THypothesisIDSet
THypothesisIDSet()
Default constructor.
Definition: HMT_SLAM_common.h:86
mrpt::hmtslam::THypothesisID
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
Definition: HMT_SLAM_common.h:61
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
mrpt::containers::list_searchable
This class implements a STL container with features of both, a std::set and a std::list.
Definition: list_searchable.h:24
in
GLuint in
Definition: glext.h:7274
mrpt::hmtslam::TPoseIDList
std::vector< TPoseID > TPoseIDList
Definition: HMT_SLAM_common.h:70
CSerializable.h



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST