Main MRPT website > C++ reference
MRPT logo
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-2014, 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" // 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  using namespace mrpt::utils;
52 
53  class HMTSLAM_IMPEXP CHMHMapArc;
55 
57 
58  /** An integer number uniquely identifying each of the concurrent hypotheses for the robot topological path (& possibly local metric clusters) in HMT-SLAM.
59  * The number 0 has the special meaning of "that part of the map/robot path in which all hypotheses agree".
60  * They can be generated from CHMTSLAM::generateHypothesisID()
61  */
62  typedef int64_t THypothesisID;
63 
64  /** An integer number uniquely identifying each robot pose stored in HMT-SLAM.
65  * They can be generated from CHMTSLAM::generatePoseID()
66  */
67  typedef uint64_t TPoseID;
68 
69  typedef std::pair<TPoseID,TPoseID> TPairPoseIDs;
70 
71  typedef std::vector<TPoseID> TPoseIDList;
72  typedef std::set<TPoseID> TPoseIDSet;
73 
75 
76  /** A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps.
77  * \sa THypothesisID, CHierarchicalMHMap
78  * \ingroup mrpt_hmtslam_grp
79  */
80  class HMTSLAM_IMPEXP THypothesisIDSet : public mrpt::utils::CSerializable, public std::set<THypothesisID>
81  {
82  // This must be added to any CSerializable derived class:
83  DEFINE_SERIALIZABLE( THypothesisIDSet )
84 
85  public:
86  /** Default constructor
87  */
88  THypothesisIDSet()
89  {
90  }
91 
92  /** Constructor with one initial element
93  */
94  THypothesisIDSet( const THypothesisID& val)
95  {
96  insert( val );
97  }
98 
100  {
101  }
102 
103  /** Returns true if the hypothesis is into the set.
104  */
105  bool has( const THypothesisID& val ) const
106  {
107  return find(val)!=end() || find(COMMON_TOPOLOG_HYP)!=end();
108  }
109 
110  /** Dump to console.
111  */
112  void debugDump() const;
113 
114  };
116 
117 
118  /** A class for storing a sequence of arcs (a path).
119  * \sa CHMTSLAM
120  */
121  class HMTSLAM_IMPEXP TArcList : public list_searchable<mrpt::hmtslam::CHMHMapArcPtr>
122  {
123  private:
125 
126  public:
127  void debugDump();
128  void read( utils::CStream &in );
129  void write( utils::CStream &out ) const;
130 
131  };
132 
133 
134  } // End of namespace
135 } // End of namespace
136 
137 
138 
139 #endif
std::set< TPoseID > TPoseIDSet
#define HMTSLAM_IMPEXP
This class implements a STL container with features of both, a std::set and a std::list.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
EIGEN_STRONG_INLINE iterator end()
Definition: eigen_plugins.h:27
#define COMMON_TOPOLOG_HYP
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:35
STL namespace.
uint64_t TPoseID
An integer number uniquely identifying each robot pose stored in HMT-SLAM.
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. ...
list_searchable< mrpt::hmtslam::CHMHMapArcPtr > BASE
std::vector< TPoseID > TPoseIDList
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...
THypothesisIDSet(const THypothesisID &val)
Constructor with one initial element.
#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:39
bool has(const THypothesisID &val) const
Returns true if the hypothesis is into the set.



Page generated by Doxygen 1.8.8 for MRPT 1.2.2 SVN:Unversioned directory at Tue Oct 14 02:14:08 UTC 2014