Main MRPT website > C++ reference for MRPT 1.4.0
CHeightGridMap2D_MRF.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-2016, 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 
10 #ifndef CHeightGridMap2D_MRF_MRF_H
11 #define CHeightGridMap2D_MRF_MRF_H
12 
15 #include <mrpt/maps/link_pragmas.h>
16 
17 namespace mrpt
18 {
19 namespace maps
20 {
21  DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CHeightGridMap2D_MRF , CRandomFieldGridMap2D, MAPS_IMPEXP )
22 
23  /** CHeightGridMap2D_MRF represents a PDF of gas concentrations over a 2D area
24  *
25  * There are a number of methods available to build the gas grid-map, depending on the value of
26  * "TMapRepresentation maptype" passed in the constructor (see base class mrpt::maps::CRandomFieldGridMap2D).
27  *
28  * Update the map with insertIndividualReading() or insertObservation()
29  *
30  * \sa mrpt::maps::CRandomFieldGridMap2D, mrpt::maps::CMetricMap, mrpt::utils::CDynamicGrid, The application icp-slam, mrpt::maps::CMultiMetricMap
31  * \note New in MRPT 1.4.0
32  * \ingroup mrpt_maps_grp
33  */
35  {
36  // This must be added to any CSerializable derived class:
38  public:
39  /** Constructor */
41  TMapRepresentation mapType = mrGMRF_SD,
42  double x_min = -2, double x_max = 2,
43  double y_min = -2, double y_max = 2, double resolution = 0.1,
44  bool run_first_map_estimation_now=true //!< [in] Whether to call updateMapEstimation(). If false, make sure of calling that function before accessing map contents.
45  );
46 
47  virtual ~CHeightGridMap2D_MRF(); //!< Destructor
48 
49  /** Parameters related with inserting observations into the map */
53  {
54  TInsertionOptions(); //!< Default values loader
55 
56  void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source,const std::string &section) MRPT_OVERRIDE; // See base docs
57  void dumpToTextStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE; // See base docs
58  } insertionOptions;
59 
60  /** Returns a 3D object representing the map */
61  virtual void getAs3DObject( mrpt::opengl::CSetOfObjectsPtr &outObj ) const MRPT_OVERRIDE;
62 
63  /** Returns two 3D objects representing the mean and variance maps */
64  virtual void getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr &meanObj, mrpt::opengl::CSetOfObjectsPtr &varObj ) const MRPT_OVERRIDE;
65 
66  virtual bool insertIndividualPoint(const double x,const double y,const double z, const CHeightGridMap2D_Base::TPointInsertParams & params = CHeightGridMap2D_Base::TPointInsertParams() ) MRPT_OVERRIDE;
67  virtual double dem_get_resolution() const MRPT_OVERRIDE;
68  virtual size_t dem_get_size_x() const MRPT_OVERRIDE;
69  virtual size_t dem_get_size_y() const MRPT_OVERRIDE;
70  virtual bool dem_get_z_by_cell(const size_t cx, const size_t cy, double &z_out) const MRPT_OVERRIDE;
71  virtual bool dem_get_z(const double x, const double y, double &z_out) const MRPT_OVERRIDE;
72  virtual void dem_update_map() MRPT_OVERRIDE;
73 
74  /** Get the part of the options common to all CRandomFieldGridMap2D classes */
75  virtual CRandomFieldGridMap2D::TInsertionOptionsCommon * getCommonInsertOptions() MRPT_OVERRIDE {
76  return &insertionOptions;
77  }
78 
79  // See docs in base class
80  void internal_clear() MRPT_OVERRIDE;
81  bool internal_insertObservation( const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose = NULL ) MRPT_OVERRIDE;
82  double internal_computeObservationLikelihood( const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom ) MRPT_OVERRIDE;
83 
85  bool run_map_estimation_at_ctor; //!< Runs map estimation at start up (Default:true)
86  double min_x,max_x,min_y,max_y,resolution; //!< See CHeightGridMap2D_MRF::CHeightGridMap2D_MRF
87  mrpt::maps::CHeightGridMap2D_MRF::TMapRepresentation mapType; //!< The kind of map representation (see CHeightGridMap2D_MRF::CHeightGridMap2D_MRF)
88  mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions insertionOpts; //!< Observations insertion options
90  };
91 
93 
94  } // End of namespace
95 } // End of namespace
96 #endif
MAP_DEFINITION_END
#define MAP_DEFINITION_END(_CLASS_NAME_, _LINKAGE_)
Definition: TMetricMapTypesRegistry.h:52
CRandomFieldGridMap2D.h
mrpt::maps::CHeightGridMap2D_Base::TPointInsertParams
Extra params for insertIndividualPoint()
Definition: CHeightGridMap2D_Base.h:40
mrpt::maps::CHeightGridMap2D_Base
Virtual base class for Digital Elevation Model (DEM) maps.
Definition: CHeightGridMap2D_Base.h:24
mrpt::maps::CRandomFieldGridMap2D::TInsertionOptionsCommon
Parameters common to any derived class.
Definition: maps/CRandomFieldGridMap2D.h:183
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CParticleFilter.h:16
mrpt::maps::CHeightGridMap2D_MRF
CHeightGridMap2D_MRF represents a PDF of gas concentrations over a 2D area.
Definition: CHeightGridMap2D_MRF.h:34
MAP_DEFINITION_START
#define MAP_DEFINITION_START(_CLASS_NAME_, _LINKAGE_)
Add a MAP_DEFINITION_START() ...
Definition: TMetricMapTypesRegistry.h:44
mrpt::utils::CStream
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
mrpt::utils::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: CConfigFileBase.h:30
mrpt::utils::CLoadableOptions
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
Definition: CLoadableOptions.h:31
mrpt::maps::CRandomFieldGridMap2D::TMapRepresentation
TMapRepresentation
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion.
Definition: maps/CRandomFieldGridMap2D.h:135
DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
Definition: CSerializable.h:174
CHeightGridMap2D_Base.h
DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE
#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...
Definition: CSerializable.h:170
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:147
mrpt::maps::CRandomFieldGridMap2D
CRandomFieldGridMap2D represents a 2D grid map where each cell is associated one real-valued property...
Definition: maps/CRandomFieldGridMap2D.h:113
MRPT_OVERRIDE
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Definition: mrpt_macros.h:28
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions
Parameters related with inserting observations into the map.
Definition: CHeightGridMap2D_MRF.h:50



Page generated by Doxygen 1.8.17 for MRPT 1.4.0 SVN: at Tue Mar 3 09:15:16 UTC 2020