Main MRPT website > C++ reference for MRPT 1.5.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 
17 
18 
19 #define COMMON_TOPOLOG_HYP static_cast<THypothesisID>(0)
20 
21 #define NODE_ANNOTATION_METRIC_MAPS "metricMaps" // CMultiMetricMap
22 #define NODE_ANNOTATION_REF_POSEID "refPoseID" // TPoseID
23 #define NODE_ANNOTATION_POSES_GRAPH "posesGraph" // CRobotPosesGraph
24 
25 #define NODE_ANNOTATION_PLACE_POSE "placePose" // mrpt::poses::CPoint2D
26 
27 #define ARC_ANNOTATION_DELTA "Delta" // CPose3DPDF (for the current implementation, it's a CPose3DPDFParticles)
28 #define ARC_ANNOTATION_DELTA_SRC_POSEID "Delta_poseID_src" // TPoseID (elemental datatype)
29 #define ARC_ANNOTATION_DELTA_TRG_POSEID "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
48 {
49  namespace hmtslam
50  {
53 
55 
56  /** An integer number uniquely identifying each of the concurrent hypotheses for 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 in which all hypotheses agree".
58  * They can be generated from CHMTSLAM::generateHypothesisID()
59  */
61 
62  /** An integer number uniquely identifying each robot pose stored in HMT-SLAM.
63  * They can be generated from CHMTSLAM::generatePoseID()
64  */
65  typedef uint64_t TPoseID;
66 
67  typedef std::pair<TPoseID,TPoseID> TPairPoseIDs;
68 
69  typedef std::vector<TPoseID> TPoseIDList;
70  typedef std::set<TPoseID> TPoseIDSet;
71 
73 
74  /** A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps.
75  * \sa THypothesisID, CHierarchicalMHMap
76  * \ingroup mrpt_hmtslam_grp
77  */
78  class HMTSLAM_IMPEXP THypothesisIDSet : public mrpt::utils::CSerializable, public std::set<THypothesisID>
79  {
80  // This must be added to any CSerializable derived class:
82 
83  public:
84  /** Default constructor
85  */
87  {
88  }
89 
90  /** Constructor with one initial element
91  */
93  {
94  insert( val );
95  }
96 
98  {
99  }
100 
101  /** Returns true if the hypothesis is into the set.
102  */
103  bool has( const THypothesisID& val ) const
104  {
105  return find(val)!=end() || find(COMMON_TOPOLOG_HYP)!=end();
106  }
107 
108  /** Dump to console.
109  */
110  void debugDump() const;
111 
112  };
114 
115 
116  /** A class for storing a sequence of arcs (a path).
117  * \sa CHMTSLAM
118  */
119  class HMTSLAM_IMPEXP TArcList : public mrpt::utils::list_searchable<mrpt::hmtslam::CHMHMapArcPtr>
120  {
121  private:
123 
124  public:
125  void debugDump();
126  void read( utils::CStream &in );
127  void write( utils::CStream &out ) const;
128 
129  };
130 
131 
132  } // End of namespace
133 } // End of namespace
134 
135 
136 
137 #endif
std::set< TPoseID > TPoseIDSet
#define COMMON_TOPOLOG_HYP
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
bool has(const THypothesisID &val) const
Returns true if the hypothesis is into the set.
class HMTSLAM_IMPEXP CHMHMapArc
Definition: CHMHMapNode.h:26
THypothesisIDSet()
Default constructor.
STL namespace.
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:139
std::pair< TPoseID, TPoseID > TPairPoseIDs
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:38
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps. ...
__int64 int64_t
Definition: rptypes.h:51
GLuint GLuint end
Definition: glext.h:3512
int val
Definition: mrpt_jpeglib.h:953
std::vector< TPoseID > TPoseIDList
unsigned __int64 uint64_t
Definition: rptypes.h:52
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:6301
THypothesisIDSet(const THypothesisID &val)
Constructor with one initial element.
A class for representing an arc between two nodes in a hierarchical, multi-hypothesis map...
Definition: CHMHMapArc.h:29
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
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:37
mrpt::utils::list_searchable< mrpt::hmtslam::CHMHMapArcPtr > BASE



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020