Main MRPT website > C++ reference
MRPT logo
CMultiMetricMap.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 CMultiMetricMap_H
29 #define CMultiMetricMap_H
30 
40 #include <mrpt/slam/CBeaconMap.h>
41 #include <mrpt/slam/CMetricMap.h>
44 #include <mrpt/utils/TEnumType.h>
45 
46 #include <mrpt/slam/link_pragmas.h>
47 
48 namespace mrpt
49 {
50 namespace slam
51 {
52  class TSetOfMetricMapInitializers;
53 
55 
56  /** This class stores any customizable set of metric maps.
57  * The internal metric maps can be accessed directly by the user.
58  * If some kind of map is not desired, it can be just ignored, but if this fact is specified in the
59  * "CMultiMetricMap::mapsUsage" member some methods (as the observation insertion) will be more
60  * efficient since it will be invoked on desired maps only.<br><br>
61  * <b>Currently these metric maps are supported for being kept internally:</b>:
62  * - mrpt::slam::CPointsMap: For laser 2D range scans, and posibly for IR ranges,... (It keeps the full 3D structure of scans)
63  * - mrpt::slam::COccupancyGridMap2D: Exclusively for 2D, <b>horizontal</b> laser range scans, at different altitudes.
64  * - mrpt::slam::CLandmarksMap: For visual landmarks,etc...
65  * - mrpt::slam::CGasConcentrationGridMap2D: For gas concentration maps.
66  * - mrpt::slam::CWirelessPowerGridMap2D: For wifi power maps.
67  * - mrpt::slam::CBeaconMap: For range-only SLAM.
68  * - mrpt::slam::CHeightGridMap2D: For maps of height for each (x,y) location.
69  * - mrpt::slam::CReflectivityGridMap2D: For maps of "reflectivity" for each (x,y) location.
70  * - mrpt::slam::CColouredPointsMap: For point map with color.
71  * - mrpt::slam::CWeightedPointsMap: For point map with weights (capable of "fusing").
72  *
73  * See CMultiMetricMap::setListOfMaps() for the method for initializing this class, and also
74  * see TSetOfMetricMapInitializers::loadFromConfigFile for a template of ".ini"-like configuration
75  * file that can be used to define what maps to create and all their parameters.
76  *
77  * \sa CMetricMap \ingroup mrpt_slam_grp
78  */
80  {
81  // This must be added to any CSerializable derived class:
83 
84  protected:
85  /** Deletes all maps and clears the internal lists of maps.
86  */
87  void deleteAllMaps();
88 
89  /** Clear all elements of the map.
90  */
91  virtual void internal_clear();
92 
93  /** Insert the observation information into this map (see options)
94  * \param obs The observation
95  * \param robotPose The 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use CPose2D(0,0,deg)
96  *
97  * \sa CObservation::insertObservationInto
98  */
99  virtual bool internal_insertObservation( const CObservation *obs, const CPose3D *robotPose = NULL );
100 
101  public:
102  typedef std::pair<CPoint3D,unsigned int> TPairIdBeacon;
103 
104  /** Returns true if the map is empty/no observation has been inserted.
105  */
106  bool isEmpty() const;
107 
108  /** Some options for this class:
109  */
110  struct SLAM_IMPEXP TOptions : public utils::CLoadableOptions
111  {
112  TOptions() : likelihoodMapSelection(mapFuseAll),
113  enableInsertion_pointsMap(true),
114  enableInsertion_landmarksMap(true),
115  enableInsertion_gridMaps(true),
116  enableInsertion_gasGridMaps(true),
117  enableInsertion_wifiGridMaps(true),
118  enableInsertion_beaconMap(true),
119  enableInsertion_heightMaps(true),
120  enableInsertion_reflectivityMaps(true),
121  enableInsertion_colourPointsMaps(true),
122  enableInsertion_weightedPointsMaps(true)
123  {
124  }
125 
126  /** Load parameters from configuration source
127  */
128  void loadFromConfigFile(
129  const mrpt::utils::CConfigFileBase &source,
130  const std::string &section);
131 
132  /** This method must display clearly all the contents of the structure in textual form, sending it to a CStream.
133  */
134  void dumpToTextStream(CStream &out) const;
135 
136  /** This selects the map to be used when computing the likelihood of an observation.
137  * This enum has a corresponding mrpt::utils::TEnumType<> specialization.
138  * \sa computeObservationLikelihood
139  */
141  {
142  mapFuseAll = -1,
143  mapGrid = 0,
152  mapWeightedPoints
153  } likelihoodMapSelection;
154 
155  bool enableInsertion_pointsMap; //!< Default = true (set to false to avoid "insertObservation" to update a given map)
156  bool enableInsertion_landmarksMap; //!< Default = true (set to false to avoid "insertObservation" to update a given map)
157  bool enableInsertion_gridMaps; //!< Default = true (set to false to avoid "insertObservation" to update a given map)
158  bool enableInsertion_gasGridMaps; //!< Default = true (set to false to avoid "insertObservation" to update a given map)
159  bool enableInsertion_wifiGridMaps; //!< Default = true (set to false to avoid "insertObservation" to update a given map)
160  bool enableInsertion_beaconMap; //!< Default = true (set to false to avoid "insertObservation" to update a given map)
161  bool enableInsertion_heightMaps; //!< Default = true (set to false to avoid "insertObservation" to update a given map)
162  bool enableInsertion_reflectivityMaps; //!< Default = true (set to false to avoid "insertObservation" to update a given map)
163  bool enableInsertion_colourPointsMaps; //!< Default = true (set to false to avoid "insertObservation" to update a given map)
164  bool enableInsertion_weightedPointsMaps; //!< Default = true (set to false to avoid "insertObservation" to update a given map)
165 
166  } options;
167 
168 
169  /** @name Internal lists of maps
170  @{ */
171  // Note: A variable number of maps may exist, depending on the initialization from TSetOfMetricMapInitializers.
172  // Not used maps are "NULL" or empty smart pointers.
173 
174  std::deque<CSimplePointsMapPtr> m_pointsMaps;
175  std::deque<COccupancyGridMap2DPtr> m_gridMaps;
176  std::deque<CGasConcentrationGridMap2DPtr> m_gasGridMaps;
177  std::deque<CWirelessPowerGridMap2DPtr> m_wifiGridMaps;
178  std::deque<CHeightGridMap2DPtr> m_heightMaps;
179  std::deque<CReflectivityGridMap2DPtr> m_reflectivityMaps;
184 
185  /** @} */
186 
187  /** Constructor.
188  * \param initializers One internal map will be created for each entry in this "TSetOfMetricMapInitializers" struct, and each map will be initialized with the corresponding options.
189  * \param opts If provided (not NULL), the member "options" will be initialized with those values.
190  * If initializers is NULL, no internal map will be created.
191  */
193  const mrpt::slam::TSetOfMetricMapInitializers *initializers = NULL,
194  const TOptions *opts = NULL );
195 
196  /** Sets the list of internal map according to the passed list of map initializers (Current maps' content will be deleted!)
197  */
198  void setListOfMaps( const mrpt::slam::TSetOfMetricMapInitializers *initializers );
199 
200  /** Copy constructor */
202 
203  /** Copy operator from "other" object.
204  */
205  mrpt::slam::CMultiMetricMap &operator = ( const mrpt::slam::CMultiMetricMap &other );
206 
207  /** Destructor.
208  */
209  virtual ~CMultiMetricMap( );
210 
211 
212  /** Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map.
213  *
214  * \param takenFrom The robot's pose the observation is supposed to be taken from.
215  * \param obs The observation.
216  * \return This method returns a likelihood in the range [0,1].
217  *
218  * \sa likelihoodMapSelection, Used in particle filter algorithms, see: CMultiMetricMapPDF::update
219  */
220  double computeObservationLikelihood( const CObservation *obs, const CPose3D &takenFrom );
221 
222  /** Returns the ratio of points in a map which are new to the point map while falling into yet static cells of gridmap.
223  * \param points The set of points to check.
224  * \param takenFrom The pose for the reference system of points, in global coordinates of this hybrid map.
225  */
226  float getNewStaticPointsRatio(
227  CPointsMap *points,
228  CPose2D &takenFrom );
229 
230  /** See the definition in the base class: In this class calls to this method are passed to the inner point map.
231  *
232  * \sa computeMatching3DWith
233  */
234  void computeMatchingWith2D(
235  const CMetricMap *otherMap,
236  const CPose2D &otherMapPose,
237  float maxDistForCorrespondence,
238  float maxAngularDistForCorrespondence,
239  const CPose2D &angularDistPivotPoint,
240  TMatchingPairList &correspondences,
241  float &correspondencesRatio,
242  float *sumSqrDist = NULL,
243  bool onlyKeepTheClosest = false,
244  bool onlyUniqueRobust = false,
245  const size_t decimation_other_map_points = 1,
246  const size_t offset_other_map_points = 0 ) const;
247 
248  /** Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose"
249  * In the case of a multi-metric map, this returns the average between the maps. This method always return 0 for grid maps.
250  * \param otherMap [IN] The other map to compute the matching with.
251  * \param otherMapPose [IN] The 6D pose of the other map as seen from "this".
252  * \param minDistForCorr [IN] The minimum distance between 2 non-probabilistic map elements for counting them as a correspondence.
253  * \param minMahaDistForCorr [IN] The minimum Mahalanobis distance between 2 probabilistic map elements for counting them as a correspondence.
254  *
255  * \return The matching ratio [0,1]
256  * \sa computeMatchingWith2D
257  */
258  float compute3DMatchingRatio(
259  const CMetricMap *otherMap,
260  const CPose3D &otherMapPose,
261  float minDistForCorr = 0.10f,
262  float minMahaDistForCorr = 2.0f
263  ) const;
264 
265  /** The implementation in this class just calls all the corresponding method of the contained metric maps.
266  */
267  void saveMetricMapRepresentationToFile(
268  const std::string &filNamePrefix
269  ) const;
270 
271  /** This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation".
272  * This method should normally do nothing, but in some cases can be used to free auxiliary cached variables.
273  */
274  void auxParticleFilterCleanUp();
275 
276  /** Returns a 3D object representing the map.
277  */
278  void getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr &outObj ) const;
279 
280  /** Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. an occupancy grid map cannot with an image).
281  * \param obs The observation.
282  * \sa computeObservationLikelihood
283  */
284  bool canComputeObservationLikelihood( const CObservation *obs );
285 
286  /** Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. an occupancy grid map cannot with an image).
287  * \param obs The observation.
288  * \sa computeObservationLikelihood
289  */
291 
292  /** If the map is a simple point map or it's a multi-metric map that contains EXACTLY one simple point map, return it.
293  * Otherwise, return NULL
294  */
295  virtual const CSimplePointsMap * getAsSimplePointsMap() const;
296  virtual CSimplePointsMap * getAsSimplePointsMap();
297 
298  /** An auxiliary variable that can be used freely by the users (this will be copied to other maps using the copy constructor, copy operator, streaming,etc) The default value is 0.
299  */
300  unsigned int m_ID;
301 
302  }; // End of class def.
303 
304  /** Each structure of this kind will determine the kind (and initial configuration) of one map to be build into a CMultiMetricMap object.
305  * See "mrpt::slam::TSetOfMetricMapInitializers::loadFromConfigFile" as an easy way of initialize this object.
306  * \sa TSetOfMetricMapInitializers, CMultiMetricMap::CMultiMetricMap
307  */
309  {
310  /** Initialization (sets 'metricMapClassType' to NULL, an invalid value -> it must be set correctly before use!)
311  */
313 
314  /** Set this to CLASS_ID(< class >) where < class > is any CMetricMap derived class.
315  */
317 
318  /** This value will be copied to the member with the same value in the map, see mrpt::slam::CMetricMap::m_disableSaveAs3DObject
319  */
321 
322  /** Specific options for grid maps (mrpt::slam::COccupancyGridMap2D)
323  */
325  {
326  TOccGridMap2DOptions(); //!< Default values loader
327 
328  float min_x,max_x,min_y,max_y,resolution; //!< See COccupancyGridMap2D::COccupancyGridMap2D
329  COccupancyGridMap2D::TInsertionOptions insertionOpts; //!< Customizable initial options.
330  COccupancyGridMap2D::TLikelihoodOptions likelihoodOpts; //!< Customizable initial options.
331 
332  } occupancyGridMap2D_options;
333 
334  /** Specific options for point maps (mrpt::slam::CPointsMap)
335  */
337  {
338  CPointsMapOptions(); //!< Default values loader
339  CPointsMap::TInsertionOptions insertionOpts; //!< Customizable initial options for loading the class' own defaults.
340  CPointsMap::TLikelihoodOptions likelihoodOpts; //!< //!< Customizable initial likelihood options
341  } pointsMapOptions_options;
342 
343  /** Specific options for gas grid maps (mrpt::slam::CGasConcentrationGridMap2D)
344  */
346  {
347  CGasConcentrationGridMap2DOptions(); //!< Default values loader
348 
349  float min_x,max_x,min_y,max_y,resolution; //!< See CGasConcentrationGridMap2D::CGasConcentrationGridMap2D
350  CGasConcentrationGridMap2D::TMapRepresentation mapType; //!< The kind of map representation (see CGasConcentrationGridMap2D::CGasConcentrationGridMap2D)
352 
353  } gasGridMap_options;
354 
355  /** Specific options for wifi grid maps (mrpt::slam::CWirelessPowerGridMap2D)
356  */
358  {
359  CWirelessPowerGridMap2DOptions(); //!< Default values loader
360 
361  float min_x,max_x,min_y,max_y,resolution; //!< See CWirelessPowerGridMap2D::CWirelessPowerGridMap2D
362  CWirelessPowerGridMap2D::TMapRepresentation mapType; //!< The kind of map representation (see CWirelessPowerGridMap2D::CWirelessPowerGridMap2D)
363  CWirelessPowerGridMap2D::TInsertionOptions insertionOpts; //!< Customizable initial options.
364 
365  } wifiGridMap_options;
366 
367  /** Specific options for landmarks maps (mrpt::slam::CLandmarksMap)
368  */
370  {
371  CLandmarksMapOptions(); //!< Default values loader
372 
373  std::deque<CMultiMetricMap::TPairIdBeacon> initialBeacons; //!< Initial contents of the map, especified by a set of 3D Beacons with associated IDs
374  CLandmarksMap::TInsertionOptions insertionOpts; //!< Customizable initial options.
375  CLandmarksMap::TLikelihoodOptions likelihoodOpts; //!< Customizable initial options.
376 
377  } landmarksMap_options;
378 
379 
380  /** Specific options for landmarks maps (mrpt::slam::CBeaconMap)
381  */
383  {
384  CBeaconMapOptions(); //!< Default values loader
385 
386  CBeaconMap::TLikelihoodOptions likelihoodOpts; //!< Customizable initial options.
387  CBeaconMap::TInsertionOptions insertionOpts; //!< Customizable initial options.
388 
389  } beaconMap_options;
390 
391  /** Specific options for height grid maps (mrpt::slam::CHeightGridMap2D)
392  */
394  {
395  CHeightGridMap2DOptions(); //!< Default values loader
396 
397  float min_x,max_x,min_y,max_y,resolution; //!< See CHeightGridMap2D::CHeightGridMap2D
398  CHeightGridMap2D::TMapRepresentation mapType; //!< The kind of map representation (see CHeightGridMap2D::CHeightGridMap2D)
399  CHeightGridMap2D::TInsertionOptions insertionOpts; //!< Customizable initial options.
400  } heightMap_options;
401 
402  /** Specific options for height grid maps (mrpt::slam::CReflectivityGridMap2D)
403  */
405  {
406  CReflectivityGridMap2DOptions(); //!< Default values loader
407 
408  float min_x,max_x,min_y,max_y,resolution; //!< See CReflectivityGridMap2DOptions::CReflectivityGridMap2DOptions
409  CReflectivityGridMap2D::TInsertionOptions insertionOpts; //!< Customizable initial options.
410  } reflectivityMap_options;
411 
412  /** Specific options for coloured point maps (mrpt::slam::CPointsMap)
413  */
415  {
416  CColouredPointsMapOptions(); //!< Default values loader
417  CPointsMap::TInsertionOptions insertionOpts; //!< Customizable initial options for loading the class' own defaults.
418  CPointsMap::TLikelihoodOptions likelihoodOpts; //!< //!< Customizable initial likelihood options
419  CColouredPointsMap::TColourOptions colourOpts; //!< Customizable initial options for loading the class' own defaults. */
420  } colouredPointsMapOptions_options;
421 
422  /** Specific options for coloured point maps (mrpt::slam::CPointsMap)
423  */
425  {
426  CWeightedPointsMapOptions(); //!< Default values loader
427  CPointsMap::TInsertionOptions insertionOpts; //!< Customizable initial options for loading the class' own defaults.
428  CPointsMap::TLikelihoodOptions likelihoodOpts; //!< //!< Customizable initial likelihood options
429  } weightedPointsMapOptions_options;
430  };
431 
432  /** A set of TMetricMapInitializer structures, passed to the constructor CMultiMetricMap::CMultiMetricMap
433  * See the comments for TSetOfMetricMapInitializers::loadFromConfigFile, and "CMultiMetricMap::setListOfMaps" for
434  * effectively creating the list of desired maps.
435  * \sa CMultiMetricMap::CMultiMetricMap, utils::CLoadableOptions
436  */
438  {
439  protected:
440  std::deque<TMetricMapInitializer> m_list;
441 
442  public:
443  size_t size() const { return m_list.size(); }
444  void push_back( const TMetricMapInitializer &o ) { m_list.push_back(o); }
445 
448 
449  iterator begin() { return m_list.begin(); }
450  const_iterator begin() const { return m_list.begin(); }
451 
452  iterator end() { return m_list.end(); }
453  const_iterator end() const { return m_list.end(); }
454 
455  void clear() { m_list.clear(); }
456 
457 
458  TSetOfMetricMapInitializers() : m_list(), options()
459  {}
460 
461 
462  /** This options will be loaded when creating the set of maps in CMultiMetricMap (See CMultiMetricMap::TOptions)
463  */
465 
466  /** Loads the configuration for the set of internal maps from a textual definition in an INI-like file.
467  * The format of the ini file is defined in utils::CConfigFile. The list of maps and their options
468  * will be loaded from a handle of sections:
469  *
470  * \code
471  * [<sectionName>]
472  * // Creation of maps:
473  * occupancyGrid_count=<Number of mrpt::slam::COccupancyGridMap2D maps>
474  * gasGrid_count=<Number of mrpt::slam::CGasConcentrationGridMap2D maps>
475  * wifiGrid_count=<Number of mrpt::slam::CWirelessPowerGridMap2D maps>
476  * landmarksMap_count=<0 or 1, for creating a mrpt::slam::CLandmarksMap map>
477  * beaconMap_count=<0 or 1, for creating a mrpt::slam::CBeaconMap map>
478  * pointsMap_count=<Number of mrpt::slam::CSimplePointsMap map>
479  * heightMap_count=<Number of mrpt::slam::CHeightGridMap2D maps>
480  * reflectivityMap_count=<Number of mrpt::slam::CReflectivityGridMap2D maps>
481  * colourPointsMap_count=<0 or 1, for creating a mrpt::slam::CColouredPointsMap map>
482  * weightedPointsMap_count=<0 or 1, for creating a mrpt::slam::CWeightedPointsMap map>
483  *
484  * // Selection of map for likelihood. Either a numeric value or the textual enum
485  * // enum value of slam::CMultiMetricMap::TOptions::TMapSelectionForLikelihood (e.g: either "-1" or "fuseAll", ect...)
486  * likelihoodMapSelection = -1
487  *
488  * // Enables (1 or "true") / Disables (0 or "false") insertion into specific maps (Defaults are all "true"):
489  * enableInsertion_pointsMap=<0/1>
490  * enableInsertion_landmarksMap=<0/1>
491  * enableInsertion_gridMaps=<0/1>
492  * enableInsertion_gasGridMaps=<0/1>
493  * enableInsertion_wifiGridMaps=<0/1>
494  * enableInsertion_beaconMap=<0/1>
495  * enableInsertion_heightMap=<0/1>
496  * enableInsertion_reflectivityMap=<0/1>
497  * enableInsertion_colourPointsMap=<0/1>
498  * enableInsertion_weightedPointsMap=<0/1>
499  *
500  * // ====================================================
501  * // Creation Options for OccupancyGridMap ##:
502  * [<sectionName>+"_occupancyGrid_##_creationOpts"]
503  * min_x=<value>
504  * max_x=<value>
505  * min_y=<value>
506  * max_y=<value>
507  * resolution=<value>
508  *
509  * // Insertion Options for OccupancyGridMap ##:
510  * [<sectionName>+"_occupancyGrid_##_insertOpts"]
511  * <See COccupancyGridMap2D::TInsertionOptions>
512  *
513  * // Likelihood Options for OccupancyGridMap ##:
514  * [<sectionName>+"_occupancyGrid_##_likelihoodOpts"]
515  * <See COccupancyGridMap2D::TLikelihoodOptions>
516  *
517  *
518  * // ====================================================
519  * // Insertion Options for CSimplePointsMap ##:
520  * [<sectionName>+"_pointsMap_##_insertOpts"]
521  * <See CPointsMap::TInsertionOptions>
522  *
523  * // Likelihood Options for CSimplePointsMap ##:
524  * [<sectionName>+"_pointsMap_##_likelihoodOpts"]
525  * <See CPointsMap::TLikelihoodOptions>
526  *
527  *
528  * // ====================================================
529  * // Creation Options for CGasConcentrationGridMap2D ##:
530  * [<sectionName>+"_gasGrid_##_creationOpts"]
531  * mapType= <0-1> ; See CGasConcentrationGridMap2D::CGasConcentrationGridMap2D
532  * min_x=<value>
533  * max_x=<value>
534  * min_y=<value>
535  * max_y=<value>
536  * resolution=<value>
537  *
538  * // Insertion Options for CGasConcentrationGridMap2D ##:
539  * [<sectionName>+"_gasGrid_##_insertOpts"]
540  * <See CGasConcentrationGridMap2D::TInsertionOptions>
541 
542 
543 
544 
545  * // ====================================================
546  * // Creation Options for CWirelessPowerGridMap2D ##:
547  * [<sectionName>+"_wifiGrid_##_creationOpts"]
548  * mapType= <0-1> ; See CWirelessPowerGridMap2D::CWirelessPowerGridMap2D
549  * min_x=<value>
550  * max_x=<value>
551  * min_y=<value>
552  * max_y=<value>
553  * resolution=<value>
554  *
555  * // Insertion Options for CWirelessPowerGridMap2D ##:
556  * [<sectionName>+"_wifiGrid_##_insertOpts"]
557  * <See CWirelessPowerGridMap2D::TInsertionOptions>
558 
559 
560  *
561  *
562  * // ====================================================
563  * // Creation Options for CLandmarksMap ##:
564  * [<sectionName>+"_landmarksMap_##_creationOpts"]
565  * nBeacons=<# of beacons>
566  * beacon_001_ID=67 ; The ID and 3D coordinates of each beacon
567  * beacon_001_X=<x>
568  * beacon_001_Y=<x>
569  * beacon_001_Z=<x>
570  *
571  * // Insertion Options for CLandmarksMap ##:
572  * [<sectionName>+"_landmarksMap_##_insertOpts"]
573  * <See CLandmarksMap::TInsertionOptions>
574  *
575  * // Likelihood Options for CLandmarksMap ##:
576  * [<sectionName>+"_landmarksMap_##_likelihoodOpts"]
577  * <See CLandmarksMap::TLikelihoodOptions>
578  *
579  *
580  * // ====================================================
581  * // Insertion Options for CBeaconMap ##:
582  * [<sectionName>+"_beaconMap_##_insertOpts"]
583  * <See CBeaconMap::TInsertionOptions>
584  *
585  * // Likelihood Options for CBeaconMap ##:
586  * [<sectionName>+"_beaconMap_##_likelihoodOpts"]
587  * <See CBeaconMap::TLikelihoodOptions>
588  *
589  * // ====================================================
590  * // Creation Options for HeightGridMap ##:
591  * [<sectionName>+"_heightGrid_##_creationOpts"]
592  * mapType= <0-1> // See CHeightGridMap2D::CHeightGridMap2D
593  * min_x=<value>
594  * max_x=<value>
595  * min_y=<value>
596  * max_y=<value>
597  * resolution=<value>
598  *
599  * // Insertion Options for HeightGridMap ##:
600  * [<sectionName>+"_heightGrid_##_insertOpts"]
601  * <See CHeightGridMap2D::TInsertionOptions>
602  *
603  *
604  * // ====================================================
605  * // Creation Options for ReflectivityGridMap ##:
606  * [<sectionName>+"_reflectivityGrid_##_creationOpts"]
607  * min_x=<value> // See CReflectivityGridMap2D::CReflectivityGridMap2D
608  * max_x=<value>
609  * min_y=<value>
610  * max_y=<value>
611  * resolution=<value>
612  *
613  * // Insertion Options for HeightGridMap ##:
614  * [<sectionName>+"_reflectivityGrid_##_insertOpts"]
615  * <See CReflectivityGridMap2D::TInsertionOptions>
616  *
617  *
618  * // ====================================================
619  * // Insertion Options for CColouredPointsMap ##:
620  * [<sectionName>+"_colourPointsMap_##_insertOpts"]
621  * <See CPointsMap::TInsertionOptions>
622  *
623  *
624  * // Color Options for CColouredPointsMap ##:
625  * [<sectionName>+"_colourPointsMap_##_colorOpts"]
626  * <See CColouredPointsMap::TColourOptions>
627  *
628  * // Likelihood Options for CSimplePointsMap ##:
629  * [<sectionName>+"_colourPointsMap_##_likelihoodOpts"]
630  * <See CPointsMap::TLikelihoodOptions>
631  *
632  *
633  * // ====================================================
634  * // Insertion Options for CWeightedPointsMap ##:
635  * [<sectionName>+"_weightedPointsMap_##_insertOpts"]
636  * <See CPointsMap::TInsertionOptions>
637  *
638  *
639  * // Likelihood Options for CWeightedPointsMap ##:
640  * [<sectionName>+"_weightedPointsMap_##_likelihoodOpts"]
641  * <See CPointsMap::TLikelihoodOptions>
642  *
643  * \endcode
644  *
645  * Where:
646  * - ##: Represents the index of the map (e.g. "00","01",...)
647  * - By default, the variables into each "TOptions" structure of the maps are defined in textual form by the same name of the corresponding C++ variable (e.g. "float resolution;" -> "resolution=0.10")
648  *
649  * \note Examples of map definitions can be found in the '.ini' files provided in the demo directories: "share/mrpt/config-files/"
650  */
651  void loadFromConfigFile(
652  const mrpt::utils::CConfigFileBase &source,
653  const std::string &sectionName);
654 
655  /** This method dumps the options of the multi-metric map AND those of every internal map.
656  */
657  void dumpToTextStream(CStream &out) const;
658  };
659 
660  } // End of namespace
661 
662 
663  // Specializations MUST occur at the same namespace:
664  namespace utils
665  {
666  template <>
668  {
670  static void fill(bimap<enum_t,std::string> &m_map)
671  {
674  m_map.insert(slam::CMultiMetricMap::TOptions::mapPoints, "mrSimpleAverage");
683  }
684  };
685  } // End of namespace
686 
687 
688 
689 } // End of namespace
690 
691 #endif



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