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-2017, 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;
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  */
61 typedef int64_t THypothesisID;
62 
63 /** An integer number uniquely identifying each robot pose stored in HMT-SLAM.
64  * They can be generated from CHMTSLAM::generatePoseID()
65  */
66 typedef uint64_t TPoseID;
67 
68 typedef std::pair<TPoseID, TPoseID> TPairPoseIDs;
69 
70 typedef std::vector<TPoseID> TPoseIDList;
71 typedef std::set<TPoseID> TPoseIDSet;
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>>
113 
114  public:
115  void debugDump();
116  void read(utils::CStream& in);
117  void write(utils::CStream& out) const;
118 };
119 
120 } // End of namespace
121 } // End of namespace
122 
123 #endif
std::set< TPoseID > TPoseIDSet
This class implements a STL container with features of both, a std::set and a std::list.
void read(utils::CStream &in)
Definition: CHMHMapArc.cpp:161
#define COMMON_TOPOLOG_HYP
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:44
bool has(const THypothesisID &val) const
Returns true if the hypothesis is into the set.
THypothesisIDSet()
Default constructor.
uint64_t TPoseID
An integer number uniquely identifying each robot pose stored in HMT-SLAM.
const_iterator find(const KEY &key) const
Definition: ts_hash_map.h:220
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
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
std::pair< TPoseID, TPoseID > TPairPoseIDs
std::vector< TPoseID > TPoseIDList
unsigned __int64 uint64_t
Definition: rptypes.h:50
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...
GLuint in
Definition: glext.h:7274
void debugDump() const
Dump to console.
THypothesisIDSet(const THypothesisID &val)
Constructor with one initial element.
mrpt::utils::list_searchable< std::shared_ptr< mrpt::hmtslam::CHMHMapArc > > BASE
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:36
void write(utils::CStream &out) const
Definition: CHMHMapArc.cpp:173



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019