Main MRPT website > C++ reference
MRPT logo
HMT_SLAM_common.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://www.mrpt.org/ |
5  | |
6  | Copyright (C) 2005-2012 University of Malaga |
7  | |
8  | This software was written by the Machine Perception and Intelligent |
9  | Robotics Lab, University of Malaga (Spain). |
10  | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11  | |
12  | This file is part of the MRPT project. |
13  | |
14  | MRPT is free software: you can redistribute it and/or modify |
15  | it under the terms of the GNU General Public License as published by |
16  | the Free Software Foundation, either version 3 of the License, or |
17  | (at your option) any later version. |
18  | |
19  | MRPT is distributed in the hope that it will be useful, |
20  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22  | GNU General Public License for more details. |
23  | |
24  | You should have received a copy of the GNU General Public License |
25  | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26  | |
27  +---------------------------------------------------------------------------+ */
28 #ifndef HMT_SLAM_common_H
29 #define HMT_SLAM_common_H
30 
33 
35 
36 
37 #define COMMON_TOPOLOG_HYP static_cast<THypothesisID>(0)
38 
39 #define NODE_ANNOTATION_METRIC_MAPS "metricMaps" // CMultiMetricMap
40 #define NODE_ANNOTATION_REF_POSEID "refPoseID" // TPoseID
41 #define NODE_ANNOTATION_POSES_GRAPH "posesGraph" // CRobotPosesGraph
42 
43 #define NODE_ANNOTATION_PLACE_POSE "placePose" // CPoint2D
44 
45 #define ARC_ANNOTATION_DELTA "Delta" // CPose3DPDF (for the current implementation, it's a CPose3DPDFParticles)
46 #define ARC_ANNOTATION_DELTA_SRC_POSEID "Delta_poseID_src" // TPoseID (elemental datatype)
47 #define ARC_ANNOTATION_DELTA_TRG_POSEID "Delta_poseID_trg" // TPoseID (elemental datatype)
48 
49 /** Used in constructor of mrpt::hmtslam::CHMHMapArc */
50 #define ARC_TYPES "Membership,Navegability,RelativePose,Location"
51 #define DEFAULT_ARC_TYPE "Membership"
52 
53 /** Used in constructor of mrpt::hmtslam::CHMHMapNode */
54 #define NODE_TYPES "Place,Area,TopologicalMap,Object"
55 #define DEFAULT_NODE_TYPE "Place"
56 
57 // Used as current robot pose when initializing an empty HMT-map.
58 #define POSEID_INVALID static_cast<TPoseID>(-1)
59 
60 #define AREAID_INVALID static_cast<uint64_t>(-1)
61 
62 #define MSG_SOURCE_LSLAM 1
63 #define MSG_SOURCE_AA 2
64 
65 namespace mrpt
66 {
67  namespace hmtslam
68  {
69  using namespace mrpt::utils;
70 
71  class HMTSLAM_IMPEXP CHMHMapArc;
73 
75 
76 
77  /** An integer number uniquely identifying each of the concurrent hypotheses for the robot topological path (& possibly local metric clusters) in HMT-SLAM.
78  * The number 0 has the special meaning of "that part of the map/robot path in which all hypotheses agree".
79  * They can be generated from CHMTSLAM::generateHypothesisID()
80  */
81  typedef int64_t THypothesisID;
82 
83  /** An integer number uniquely identifying each robot pose stored in HMT-SLAM.
84  * They can be generated from CHMTSLAM::generatePoseID()
85  */
86  typedef uint64_t TPoseID;
87 
88  typedef std::pair<TPoseID,TPoseID> TPairPoseIDs;
89 
90  typedef std::vector<TPoseID> TPoseIDList;
91  typedef std::set<TPoseID> TPoseIDSet;
92 
94 
95  /** A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps.
96  * \sa THypothesisID, CHierarchicalMHMap
97  * \ingroup mrpt_hmtslam_grp
98  */
99  class HMTSLAM_IMPEXP THypothesisIDSet : public mrpt::utils::CSerializable, public std::set<THypothesisID>
100  {
101  // This must be added to any CSerializable derived class:
102  DEFINE_SERIALIZABLE( THypothesisIDSet )
103 
104  public:
105  /** Default constructor
106  */
107  THypothesisIDSet()
108  {
109  }
110 
111  /** Constructor with one initial element
112  */
113  THypothesisIDSet( const THypothesisID& val)
114  {
115  insert( val );
116  }
117 
118  virtual ~THypothesisIDSet()
119  {
120  }
121 
122  /** Returns true if the hypothesis is into the set.
123  */
124  bool has( const THypothesisID& val ) const
125  {
126  return find(val)!=end() || find(COMMON_TOPOLOG_HYP)!=end();
127  }
128 
129  /** Dump to console.
130  */
131  void debugDump() const;
132 
133  };
134 
135 
136  /** A class for storing a sequence of arcs (a path).
137  * \sa CHMTSLAM
138  */
139  class HMTSLAM_IMPEXP TArcList : public list_searchable<mrpt::hmtslam::CHMHMapArcPtr>
140  {
141  private:
143 
144  public:
145  void debugDump();
146  void read( utils::CStream &in );
147  void write( utils::CStream &out ) const;
148 
149  };
150 
151 
152  } // End of namespace
153 } // End of namespace
154 
155 
156 
157 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013