Main MRPT website > C++ reference for MRPT 1.5.6
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  {
51  class HMTSLAM_IMPEXP CHMHMapArc;
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:
81  DEFINE_SERIALIZABLE( THypothesisIDSet )
82 
83  public:
84  /** Default constructor
85  */
86  THypothesisIDSet()
87  {
88  }
89 
90  /** Constructor with one initial element
91  */
92  THypothesisIDSet( const THypothesisID& val)
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
uint64_t TPoseID
An integer number uniquely identifying each robot pose stored in HMT-SLAM.
GLuint in
Definition: glew.h:7146
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...
GLuint GLuint end
Definition: glew.h:1167
A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps. ...
__int64 int64_t
Definition: rptypes.h:51
std::vector< TPoseID > TPoseIDList
unsigned __int64 uint64_t
Definition: rptypes.h:52
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
const_iterator find(const KEY &key) const
Definition: ts_hash_map.h:139
THypothesisIDSet(const THypothesisID &val)
Constructor with one initial element.
GLuint GLfloat * val
Definition: glew.h:7785
#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
bool has(const THypothesisID &val) const
Returns true if the hypothesis is into the set.
mrpt::utils::list_searchable< mrpt::hmtslam::CHMHMapArcPtr > BASE



Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018