Main MRPT website > C++ reference
MRPT logo
CHMTSLAM.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 CHMTSLAM_H
10 #define CHMTSLAM_H
11 
15 #include <mrpt/system/threads.h>
16 
23 #include <mrpt/slam/CICP.h>
24 #include <mrpt/slam/CPointsMap.h>
25 #include <mrpt/slam/TKLDParams.h>
28 #include <queue>
29 
30 namespace mrpt
31 {
32  /** Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM. \ingroup mrpt_hmtslam_grp */
33  namespace hmtslam
34  {
35  using namespace mrpt::utils;
36  using namespace mrpt::system;
37  using namespace mrpt::math;
38  using namespace mrpt::bayes;
39  using namespace mrpt::slam;
40 
41 
42  class CHMTSLAM;
43  class CLSLAMAlgorithmBase;
44  class CLSLAM_RBPF_2DLASER;
45 
47 
48  /** An implementation of Hybrid Metric Topological SLAM (HMT-SLAM).
49  *
50  * The main entry points for a user are pushAction() and pushObservations(). Several parameters can be modified
51  * through m_options.
52  *
53  * The mathematical models of this approach have been reported in:
54  * - Blanco J.L., Fernandez-Madrigal J.A., and Gonzalez J., "Towards a Unified Bayesian Approach to Hybrid Metric-Topological SLAM", in IEEE Transactions on Robotics (TRO), Vol. 24, No. 2, April 2008.
55  * - ...
56  *
57  * More information in the wiki page: http://www.mrpt.org/HMT-SLAM . A complete working application can be found in "MRPT/apps/hmt-slam".
58  *
59  * The complete state of the SLAM framework is serializable, so it can be saved and restore to/from a binary dump. This class implements mrpt::utils::CSerializable, so
60  * it can be saved with "stream << slam_object;" and restored with "stream >> slam_object;". Alternatively, the methods CHMTSLAM::saveState and CHMTSLAM::loadState
61  * can be invoked, which in turn call internally to the CSerializable interface.
62  *
63  * \sa CHierarchicalMHMap
64  * \ingroup mrpt_hmtslam_grp
65  */
66  class HMTSLAM_IMPEXP CHMTSLAM : public mrpt::utils::CDebugOutputCapable, public mrpt::utils::CSerializable
67  {
72 
73  // This must be added to any CSerializable derived class:
75 
76  protected:
77 
78 
79  /** @name Inter-thread communication queues:
80  @{ */
81  /** Message definition:
82  - From: LSLAM
83  - To: AA
84  - Meaning: Reconsider the graph partition for the given LMH. Compute SSO for the new node(s) "newPoseIDs".
85  */
86  /*struct TMessageAA
87  {
88  CLocalMetricHypothesis *LMH;
89  TPoseIDList newPoseIDs;
90  };*/
91 
92  /** Message definition:
93  - From: AA
94  - To: LSLAM
95  - Meaning: The partitioning of robot poses.
96  */
98  {
99  THypothesisID hypothesisID; //!< The hypothesis ID (LMH) for these results.
100  std::vector< TPoseIDList > partitions;
101 
102  void dumpToConsole( ) const; //!< for debugging only
103  };
105 
106  /** Message definition:
107  - From: LSLAM
108  - To: TBI
109  - Meaning: One or more areas are to be considered by the TBI engines.
110  */
112  {
114  TNodeIDList areaIDs; //!< The areas to consider.
115  };
117 
118  /** Message definition:
119  - From: TBI
120  - To: LSLAM
121  - Meaning:
122  */
124  {
125  THypothesisID hypothesisID; //!< The hypothesis ID (LMH) for these results.
126 
127  CHMHMapNode::TNodeID cur_area; //!< The area for who the loop-closure has been computed.
128 
129  struct TBI_info
130  {
131  TBI_info() : log_lik(0),delta_new_cur(0)
132  {}
133 
134  double log_lik; //!< Log likelihood for this loop-closure.
135 
136  /** Depending on the loop-closure engine, an guess of the relative pose of "area_new" relative to "cur_area" is given here.
137  * If the SOG contains 0 modes, then the engine does not provide this information.
138  */
140  };
141 
142  /** The meat is here: only feasible loop closures from "cur_area" are included here, with associated data.
143  */
144  std::map< CHMHMapNode::TNodeID, TBI_info > loopClosureData;
145 
146  //MRPT_MAKE_ALIGNED_OPERATOR_NEW
147  };
149 
150 
151  utils::CMessageQueue m_LSLAM_queue; //!< LSLAM thread input queue, messages of type CHMTSLAM::TMessageLSLAMfromAA
152 
153  /** @} */
154 
155  /** The Area Abstraction (AA) method, invoked from LSLAM.
156  * \param LMH (IN) The LMH which to this query applies.
157  * \param newPoseIDs (IN) The new poseIDs to be added to the graph partitioner.
158  * \return A structure with all return data. Memory to be freed by user.
159  * \note The critical section for LMH must be locked BEFORE calling this method (it does NOT lock any critical section).
160  */
161  static TMessageLSLAMfromAAPtr areaAbstraction(
163  const TPoseIDList &newPoseIDs );
164 
165 
166  /** The entry point for Topological Bayesian Inference (TBI) engines, invoked from LSLAM.
167  * \param LMH (IN) The LMH which to this query applies.
168  * \param areaID (IN) The area ID to consider for potential loop-closures.
169  * \note The critical section for LMH must be locked BEFORE calling this method (it does NOT lock any critical section).
170  */
171  static TMessageLSLAMfromTBIPtr TBI_main_method(
173  const CHMHMapNode::TNodeID &areaID
174  );
175 
176  /** @name Related to the input queue:
177  @{ */
178  public:
179  /** Empty the input queue. */
180  void clearInputQueue();
181 
182  /** Returns true if the input queue is empty (Note that the queue must not be empty to the user to enqueue more actions/observaitions)
183  * \sa pushAction,pushObservations, inputQueueSize
184  */
185  bool isInputQueueEmpty();
186 
187  /** Returns the number of objects waiting for processing in the input queue.
188  * \sa pushAction,pushObservations, isInputQueueEmpty
189  */
190  size_t inputQueueSize();
191 
192  /** Here the user can enter an action into the system (will go to the SLAM process).
193  * This class will delete the passed object when required, so DO NOT DELETE the passed object after calling this.
194  * \sa pushObservations,pushObservation
195  */
196  void pushAction( const CActionCollectionPtr &acts );
197 
198  /** Here the user can enter observations into the system (will go to the SLAM process).
199  * This class will delete the passed object when required, so DO NOT DELETE the passed object after calling this.
200  * \sa pushAction,pushObservation
201  */
202  void pushObservations( const CSensoryFramePtr &sf );
203 
204  /** Here the user can enter an observation into the system (will go to the SLAM process).
205  * This class will delete the passed object when required, so DO NOT DELETE the passed object after calling this.
206  * \sa pushAction,pushObservation
207  */
208  void pushObservation( const CObservationPtr &obs );
209 
211  {
212  lsmRBPF_2DLASER = 1
213  };
214 
215  protected:
216  /** Used from the LSLAM thread to retrieve the next object from the queue.
217  * \return The object, or NULL if empty.
218  */
219  CSerializablePtr getNextObjectFromInputQueue();
220 
221  /** The queue of pending actions/observations supplied by the user waiting for being processed. */
222  std::queue<CSerializablePtr> m_inputQueue;
223 
224  /** Critical section for accessing m_inputQueue */
226 
227  /** Critical section for accessing m_map */
229 
230  synch::CCriticalSection m_LMHs_cs; //!< Critical section for accessing m_LMHs
231 
232  /** @} */
233 
234 
235  /** @name Threads stuff
236  @{ */
237 
238  /** The function for the "Local SLAM" thread. */
239  void thread_LSLAM( );
240 
241  /** The function for the "TBI" thread. */
242  void thread_TBI( );
243 
244  /** The function for the "3D viewer" thread. */
245  void thread_3D_viewer( );
246  /** Threads handles */
247  mrpt::system::TThreadHandle m_hThread_LSLAM, m_hThread_TBI, m_hThread_3D_viewer;
248  /** @} */
249 
250 
251  /** @name HMT-SLAM sub-processes.
252  @{ */
253  void LSLAM_process_message( const CMessage &msg ); //!< Auxiliary method within thread_LSLAM
254 
255  /** No critical section locks are assumed at the entrance of this method.
256  */
257  void LSLAM_process_message_from_AA( const TMessageLSLAMfromAA &myMsg );
258 
259  /** No critical section locks are assumed at the entrance of this method.
260  */
261  void LSLAM_process_message_from_TBI( const TMessageLSLAMfromTBI &myMsg );
262 
263  /** Topological Loop Closure: Performs all the required operations
264  to close a loop between two areas which have been determined
265  to be the same.
266  */
267  void perform_TLC(
269  const CHMHMapNode::TNodeID areaInLMH,
270  const CHMHMapNode::TNodeID areaLoopClosure,
271  const mrpt::poses::CPose3DPDFGaussian &pose1wrt2
272  );
273 
274 
275  /** @} */
276 
277  /** @name The different SLAM algorithms that can be invoked from the LSLAM thread.
278  @{ */
279 
280  /** An instance of a local SLAM method, to be applied to each LMH - initialized by "initializeEmptyMap" or "loadState".
281  */
283 
284  /** @} */
285 
286  /** @name The different Loop-Closure modules that are to be executed in the TBI thread.
287  @{ */
288  protected:
289 
290  typedef CTopLCDetectorBase* (*TLopLCDetectorFactory)(CHMTSLAM*);
291 
292  std::map<std::string,TLopLCDetectorFactory> m_registeredLCDetectors;
293 
294  /** The list of LC modules in operation - initialized by "initializeEmptyMap" or "loadState". */
295  std::deque<CTopLCDetectorBase*> m_topLCdets;
296 
297  /** The critical section for accessing m_topLCdets */
299  public:
300 
301  /** Must be invoked before calling initializeEmptyMap, so LC objects can be created. */
302  void registerLoopClosureDetector(
303  const std::string &name,
304  CTopLCDetectorBase* (*ptrCreateObject)(CHMTSLAM*)
305  );
306 
307  /** The class factory for topological loop closure detectors.
308  * Possible values are enumerated in TOptions::TLC_detectors
309  *
310  * \exception std::exception On unknown name.
311  */
312  CTopLCDetectorBase* loopClosureDetector_factory(const std::string &name);
313 
314 
315  /** @} */
316  protected:
317 
318 
319  /** Termination flag for signaling all threads to terminate */
321 
322  /** Threads termination flags:
323  */
324  bool m_terminationFlag_LSLAM,
326  m_terminationFlag_3D_viewer;
327 
328  /** Generates a new and unique area textual label (currently this generates "0","1",...) */
329  static std::string generateUniqueAreaLabel();
330 
331  /** Generates a new and unique pose ID */
332  static TPoseID generatePoseID();
333 
334  /** Generates a new and unique hypothesis ID */
335  static THypothesisID generateHypothesisID();
336 
337  static int64_t m_nextAreaLabel;
340 
341 
342  public:
343  /** Default constructor
344  * \param debug_out_stream If debug output messages should be redirected to any other stream apart from std::cout
345  */
346  CHMTSLAM( );
347 
348  CHMTSLAM(const CHMTSLAM &) { THROW_EXCEPTION("This object cannot be copied."); }
349  const CHMTSLAM& operator =(const CHMTSLAM &) { THROW_EXCEPTION("This object cannot be copied."); }
350 
351  /** Destructor
352  */
353  virtual ~CHMTSLAM();
354 
355  /** Return true if an exception has been caught in any thread leading to the end of the mapping application: no more actions/observations will be processed from now on.
356  */
357  bool abortedDueToErrors();
358 
359 
360  /** @name High-level map management
361  @{ */
362 
363  /** Loads the options from a config file. */
364  void loadOptions( const std::string &configFile );
365  /** Loads the options from a config source */
366  void loadOptions( const mrpt::utils::CConfigFileBase &cfgSource );
367 
368  /** Initializes the whole HMT-SLAM framework, reseting to an empty map (It also clears the logs directory) - this must be called AFTER loading the options with CHMTSLAM::loadOptions. */
369  void initializeEmptyMap();
370 
371  /** Save the state of the whole HMT-SLAM framework to some binary stream (e.g. a file).
372  * \return true if everything goes OK.
373  * \sa loadState
374  */
375  bool saveState( CStream &out ) const;
376 
377  /** Load the state of the whole HMT-SLAM framework from some binary stream (e.g. a file).
378  * \return true if everything goes OK.
379  * \sa saveState
380  */
381  bool loadState( CStream &in );
382  /** @} */
383 
384  /** @name The important data.
385  @{ */
386  CHierarchicalMHMap m_map; //!< The hiearchical, multi-hypothesis graph-based map.
388  /** @} */
389 
390  /** Called from LSLAM thread when log files must be created.
391  */
392  void generateLogFiles(unsigned int nIteration);
393 
394 
395  /** Gets a 3D representation of the current state of the whole mapping framework.
396  */
397  void getAs3DScene( COpenGLScene &outScene );
398 
399  protected:
400  /** A variety of options and configuration params (private, use loadOptions).
401  */
403  {
404  /** Initialization of default params
405  */
406  TOptions();
407 
408  /** Load parameters from configuration source
409  */
410  void loadFromConfigFile(
411  const mrpt::utils::CConfigFileBase &source,
412  const std::string &section);
413 
414  /** This method must display clearly all the contents of the structure in textual form, sending it to a CStream.
415  */
416  void dumpToTextStream(CStream &out) const;
417 
418 
419  std::string LOG_OUTPUT_DIR; //!< [LOGGING] If it is not an empty string (""), a directory with that name will be created and log files save there.
420  int LOG_FREQUENCY; //!< [LOGGING] One SLAM iteration out of "LOGGING_logFrequency", a log file will be generated.
421 
422  /** [LSLAM] The method to use for local SLAM
423  */
425 
426  /** [LSLAM] Minimum distance (and heading) difference between observations inserted in the map.
427  */
428  float SLAM_MIN_DIST_BETWEEN_OBS, SLAM_MIN_HEADING_BETWEEN_OBS;
429 
430  /** [LSLAM] Minimum uncertainty (1 sigma, meters) in x and y for odometry increments (Default=0) */
432 
433  /** [LSLAM] Minimum uncertainty (1 sigma, rads) in phi for odometry increments (Default=0) */
435 
436  /** [VIEW3D] The height of the areas' spheres.
437  */
439 
440  /** [VIEW3D] The radius of the areas' spheres.
441  */
443 
444  /** A 3-length vector with the std. deviation of the transition model in (x,y,phi) used only when there is no odometry (if there is odo, its uncertainty values will be used instead); x y: In meters, phi: radians (but in degrees when loading from a configuration ini-file!)
445  */
447 
448  /** [AA] The options for the partitioning algorithm
449  */
451 
452  TSetOfMetricMapInitializers defaultMapsInitializers; //!< The default set of maps to be created in each particle
453 
454  CMultiMetricMap::TOptions defaultMapsOptions; //!< The default options for the CMultiMetricMap in each particle.
455 
456  bayes::CParticleFilter::TParticleFilterOptions pf_options; //!< These params are used from every LMH object.
457 
459 
460  int random_seed; //!< 0 means randomize, use any other value to have repetitive experiments.
461 
462  /** A list of topological loop-closure detectors to use: can be one or more from this list:
463  * 'gridmaps': Occupancy Grid matching.
464  * 'fabmap': Mark Cummins' image matching framework.
465  */
467 
468  CTopLCDetector_GridMatching::TOptions TLC_grid_options; //!< Options passed to this TLC constructor
469  CTopLCDetector_FabMap::TOptions TLC_fabmap_options; //!< Options passed to this TLC constructor
470 
471  } m_options;
472 
473  }; // End of class CHMTSLAM.
475 
476 
477  /** Virtual base for local SLAM methods, used in mrpt::slam::CHMTSLAM.
478  */
480  {
482  protected:
484 
485  public:
486  /** Constructor
487  */
488  CLSLAMAlgorithmBase( CHMTSLAM *parent ) : m_parent(parent) { }
489 
490  /** Destructor
491  */
492  virtual ~CLSLAMAlgorithmBase() {}
493 
494  /** Main entry point from HMT-SLAM: process some actions & observations.
495  * The passed action/observation will be deleted, so a copy must be made if necessary.
496  * This method must be in charge of updating the robot pose estimates and also to update the
497  * map when required.
498  *
499  * \param LMH The local metric hypothesis which must be updated by this SLAM algorithm.
500  * \param act The action to process (or NULL).
501  * \param sf The observations to process (or NULL).
502  */
503  virtual void processOneLMH(
505  const CActionCollectionPtr &act,
506  const CSensoryFramePtr &sf ) = 0;
507 
508 
509  /** The PF algorithm implementation.
510  */
511  virtual void prediction_and_update_pfAuxiliaryPFOptimal(
513  const mrpt::slam::CActionCollection * action,
514  const mrpt::slam::CSensoryFrame * observation,
515  const bayes::CParticleFilter::TParticleFilterOptions &PF_options ) = 0;
516 
517  /** The PF algorithm implementation. */
518  virtual void prediction_and_update_pfOptimalProposal(
520  const mrpt::slam::CActionCollection * action,
521  const mrpt::slam::CSensoryFrame * observation,
522  const bayes::CParticleFilter::TParticleFilterOptions &PF_options ) = 0;
523 
524  }; // end of class CLSLAMAlgorithmBase
525 
526 
527  /** Implements a 2D local SLAM method based on a RBPF over an occupancy grid map.
528  * This class is used internally in mrpt::slam::CHMTSLAM
529  */
531  {
533 
534  public:
535  /** Constructor
536  */
537  CLSLAM_RBPF_2DLASER( CHMTSLAM *parent );
538 
539  /** Destructor
540  */
541  virtual ~CLSLAM_RBPF_2DLASER();
542 
543  /** Main entry point from HMT-SLAM: process some actions & observations.
544  * The passed action/observation will be deleted, so a copy must be made if necessary.
545  * This method must be in charge of updating the robot pose estimates and also to update the
546  * map when required.
547  *
548  * \param LMH The local metric hypothesis which must be updated by this SLAM algorithm.
549  * \param act The action to process (or NULL).
550  * \param sf The observations to process (or NULL).
551  */
552  void processOneLMH(
554  const CActionCollectionPtr &act,
555  const CSensoryFramePtr &sf );
556 
557  /** The PF algorithm implementation. */
558  void prediction_and_update_pfAuxiliaryPFOptimal(
560  const mrpt::slam::CActionCollection * action,
561  const mrpt::slam::CSensoryFrame * observation,
563 
564  /** The PF algorithm implementation. */
565  void prediction_and_update_pfOptimalProposal(
567  const mrpt::slam::CActionCollection * action,
568  const mrpt::slam::CSensoryFrame * observation,
570 
571  protected:
572  bool m_insertNewRobotPose; //!< For use within PF callback methods
573 
574  /** Auxiliary structure
575  */
576  struct TPathBin
577  {
578  TPathBin() : x(),y(),phi()
579  {}
580 
581  vector_int x,y,phi;
582 
583  /** For debugging purposes!
584  */
585  void dumpToStdOut() const;
586  };
587 
588 
589  /** Fills out a "TPathBin" variable, given a path hypotesis and (if not set to NULL) a new pose appended at the end, using the KLD params in "options".
590  */
591  void loadTPathBinFromPath(
592  TPathBin &outBin,
593  std::map<TPoseID,CPose3D> *path = NULL,
594  CPose2D *newPose = NULL );
595 
596  /** Checks if a given "TPathBin" element is already into a set of them, and return its index (first one is 0), or -1 if not found.
597  */
598  int findTPathBinIntoSet(
599  TPathBin &desiredBin,
600  std::deque<TPathBin> &theSet
601  );
602 
603  /** Auxiliary function used in "prediction_and_update_pfAuxiliaryPFOptimal"
604  */
605  static double particlesEvaluator_AuxPFOptimal(
607  const CParticleFilterCapable *obj,
608  size_t index,
609  const void *action,
610  const void *observation );
611 
612  /** Auxiliary function that evaluates the likelihood of an observation, given a robot pose, and according to the options in "CPosePDFParticles::options".
613  */
614  static double auxiliarComputeObservationLikelihood(
616  const CParticleFilterCapable *obj,
617  size_t particleIndexForMap,
618  const CSensoryFrame *observation,
619  const CPose2D *x );
620 
621  }; // end class CLSLAM_RBPF_2DLASER
622 
623  } // End of namespace
624 } // End of namespace
625 
626 #endif
float MIN_ODOMETRY_STD_PHI
[LSLAM] Minimum uncertainty (1 sigma, rads) in phi for odometry increments (Default=0) ...
Definition: CHMTSLAM.h:434
int random_seed
0 means randomize, use any other value to have repetitive experiments.
Definition: CHMTSLAM.h:460
static TPoseID m_nextPoseID
Definition: CHMTSLAM.h:338
float MIN_ODOMETRY_STD_XY
[LSLAM] Minimum uncertainty (1 sigma, meters) in x and y for odometry increments (Default=0) ...
Definition: CHMTSLAM.h:431
CLSLAMAlgorithmBase * m_LSLAM_method
An instance of a local SLAM method, to be applied to each LMH - initialized by "initializeEmptyMap" o...
Definition: CHMTSLAM.h:282
#define HMTSLAM_IMPEXP
This class provides simple critical sections functionality.
CPose3DPDFSOG delta_new_cur
Depending on the loop-closure engine, an guess of the relative pose of "area_new" relative to "cur_ar...
Definition: CHMTSLAM.h:139
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
Implements a 2D local SLAM method based on a RBPF over an occupancy grid map.
Definition: CHMTSLAM.h:530
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
Definition: math_frwds.h:30
int LOG_FREQUENCY
[LOGGING] One SLAM iteration out of "LOGGING_logFrequency", a log file will be generated.
Definition: CHMTSLAM.h:420
CTopLCDetector_FabMap::TOptions TLC_fabmap_options
Options passed to this TLC constructor.
Definition: CHMTSLAM.h:469
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:35
std::queue< CSerializablePtr > m_inputQueue
The queue of pending actions/observations supplied by the user waiting for being processed.
Definition: CHMTSLAM.h:222
The namespace for Bayesian filtering algorithm: different particle filters and Kalman filter algorith...
mrpt::system::TThreadHandle m_hThread_TBI
Definition: CHMTSLAM.h:247
#define THROW_EXCEPTION(msg)
std::vector< std::string > vector_string
A type for passing a vector of strings.
Declares a class that represents a Probability Density function (PDF) of a 3D(6D) pose ...
Definition: CPose3DPDFSOG.h:34
CIncrementalMapPartitioner::TOptions AA_options
[AA] The options for the partitioning algorithm
Definition: CHMTSLAM.h:450
vector_string TLC_detectors
A list of topological loop-closure detectors to use: can be one or more from this list: 'gridmaps': O...
Definition: CHMTSLAM.h:466
Option set for KLD algorithm.
Definition: TKLDParams.h:24
std::map< TYPE1, TYPE2, std::less< TYPE1 >, Eigen::aligned_allocator< std::pair< const TYPE1, TYPE2 > > > map_t
THypothesisID hypothesisID
The hypothesis ID (LMH) for these results.
Definition: CHMTSLAM.h:99
CTopLCDetector_GridMatching::TOptions TLC_grid_options
Options passed to this TLC constructor.
Definition: CHMTSLAM.h:468
uint64_t TPoseID
An integer number uniquely identifying each robot pose stored in HMT-SLAM.
aligned_containers< THypothesisID, CLocalMetricHypothesis >::map_t m_LMHs
The list of LMHs at each instant.
Definition: CHMTSLAM.h:387
bool m_terminateThreads
Termination flag for signaling all threads to terminate.
Definition: CHMTSLAM.h:320
utils::CMessageQueue m_LSLAM_queue
LSLAM thread input queue, messages of type CHMTSLAM::TMessageLSLAMfromAA.
Definition: CHMTSLAM.h:151
Virtual base for local SLAM methods, used in mrpt::slam::CHMTSLAM.
Definition: CHMTSLAM.h:479
An implementation of Hybrid Metric Topological SLAM (HMT-SLAM).
Definition: CHMTSLAM.h:66
This namespace contains algorithms for SLAM, localization, map building, representation of robot's ac...
Declares a class for storing a collection of robot actions.
This class allows loading and storing values and vectors of different types from a configuration text...
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
CLSLAMAlgorithmBase(CHMTSLAM *parent)
Constructor.
Definition: CHMTSLAM.h:488
CHMTSLAM(const CHMTSLAM &)
Definition: CHMTSLAM.h:348
synch::CCriticalSection m_map_cs
Critical section for accessing m_map.
Definition: CHMTSLAM.h:228
CHMHMapNode::TNodeID cur_area
The area for who the loop-closure has been computed.
Definition: CHMTSLAM.h:127
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
This base provides a set of functions for maths stuff.
Definition: CArray.h:18
#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...
std::string LOG_OUTPUT_DIR
[LOGGING] If it is not an empty string (""), a directory with that name will be created and log files...
Definition: CHMTSLAM.h:419
synch::CCriticalSection m_inputQueue_cs
Critical section for accessing m_inputQueue.
Definition: CHMTSLAM.h:225
std::deque< CTopLCDetectorBase * > m_topLCdets
The list of LC modules in operation - initialized by "initializeEmptyMap" or "loadState".
Definition: CHMTSLAM.h:295
virtual ~CLSLAMAlgorithmBase()
Destructor.
Definition: CHMTSLAM.h:492
This virtual class defines the interface that any particles based PDF class must implement in order t...
CMultiMetricMap::TOptions defaultMapsOptions
The default options for the CMultiMetricMap in each particle.
Definition: CHMTSLAM.h:454
class HMTSLAM_IMPEXP CHMTSLAM
CHierarchicalMHMap m_map
The hiearchical, multi-hypothesis graph-based map.
Definition: CHMTSLAM.h:386
THypothesisID hypothesisID
The hypothesis ID (LMH) for these results.
Definition: CHMTSLAM.h:125
stlplus::smart_ptr< TMessageLSLAMtoTBI > TMessageLSLAMtoTBIPtr
Definition: CHMTSLAM.h:116
The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM.
This class is used in HMT-SLAM to represent each of the Local Metric Hypotheses (LMHs).
std::vector< TPoseIDList > partitions
Definition: CHMTSLAM.h:100
static int64_t m_nextAreaLabel
Definition: CHMTSLAM.h:337
struct BASE_IMPEXP CSerializablePtr
Definition: CStream.h:24
TLSlamMethod SLAM_METHOD
[LSLAM] The method to use for local SLAM
Definition: CHMTSLAM.h:424
synch::CCriticalSection m_LMHs_cs
Critical section for accessing m_LMHs.
Definition: CHMTSLAM.h:230
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:51
std::vector< TPoseID > TPoseIDList
bayes::CParticleFilter::TParticleFilterOptions pf_options
These params are used from every LMH object.
Definition: CHMTSLAM.h:456
std::map< CHMHMapNode::TNodeID, TBI_info > loopClosureData
The meat is here: only feasible loop closures from "cur_area" are included here, with associated data...
Definition: CHMTSLAM.h:144
A variety of options and configuration params (private, use loadOptions).
Definition: CHMTSLAM.h:402
double log_lik
Log likelihood for this loop-closure.
Definition: CHMTSLAM.h:134
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...
Options for a TLC-detector of type FabMap, used from CHMTSLAM.
Options for a TLC-detector of type gridmap-matching, used from CHMTSLAM.
A set of TMetricMapInitializer structures, passed to the constructor CMultiMetricMap::CMultiMetricMap...
float VIEW3D_AREA_SPHERES_HEIGHT
[VIEW3D] The height of the areas' spheres.
Definition: CHMTSLAM.h:438
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:53
A class used to store a 2D pose.
Definition: CPose2D.h:36
safe_ptr< CHMTSLAM > m_parent
Definition: CHMTSLAM.h:483
std::vector< int32_t > vector_int
std::map< std::string, TLopLCDetectorFactory > m_registeredLCDetectors
Definition: CHMTSLAM.h:292
The configuration of a particle filter.
float VIEW3D_AREA_SPHERES_RADIUS
[VIEW3D] The radius of the areas' spheres.
Definition: CHMTSLAM.h:442
This structure contains the information needed to interface the threads API on each platform: ...
Definition: threads.h:25
The most high level class for storing hybrid, multi-hypothesis maps in a graph-based model...
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives...
Definition: COpenGLScene.h:49
class HMTSLAM_IMPEXP CLSLAM_RBPF_2DLASER
TNodeIDList areaIDs
The areas to consider.
Definition: CHMTSLAM.h:114
Declares a class that represents a Probability Density function (PDF) of a 3D pose ...
static THypothesisID m_nextHypID
Definition: CHMTSLAM.h:339
synch::CCriticalSection m_topLCdets_cs
The critical section for accessing m_topLCdets.
Definition: CHMTSLAM.h:298
TSetOfMetricMapInitializers defaultMapsInitializers
The default set of maps to be created in each particle.
Definition: CHMTSLAM.h:452
CLocalMetricHypothesis * LMH
The LMH.
Definition: CHMTSLAM.h:113
bool m_insertNewRobotPose
For use within PF callback methods.
Definition: CHMTSLAM.h:572
Some options for this class:
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This base class provides a common printf-like method to send debug information to std::cout...
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
A class that contain generic messages, that can be sent and received from a "CClientTCPSocket" object...
Definition: CMessage.h:32
stlplus::smart_ptr< TMessageLSLAMfromAA > TMessageLSLAMfromAAPtr
Definition: CHMTSLAM.h:104
CVectorFloat stds_Q_no_odo
A 3-length vector with the std.
Definition: CHMTSLAM.h:446
A wrapper class for pointers that can be safely copied with "=" operator without problems.
Definition: safe_pointers.h:67
mrpt::utils::TNodeID TNodeID
The type of the IDs of nodes.
Definition: CHMHMapNode.h:51
stlplus::smart_ptr< TMessageLSLAMfromTBI > TMessageLSLAMfromTBIPtr
Definition: CHMTSLAM.h:148



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