Main MRPT website > C++ reference for MRPT 1.9.9
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-2018, 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 
16 namespace mrpt
17 {
18 namespace maps
19 {
20 /** CHeightGridMap2D_MRF represents digital-elevation-model over a 2D area, with
21  * uncertainty, based on a Markov-Random-Field (MRF) estimator.
22  *
23  * There are a number of methods available to build the gas grid-map,
24  * depending on the value of
25  * "TMapRepresentation maptype" passed in the constructor (see base class
26  * mrpt::maps::CRandomFieldGridMap2D).
27  *
28  * Update the map with insertIndividualReading() or insertObservation()
29  *
30  * \sa mrpt::maps::CRandomFieldGridMap2D, mrpt::maps::CMetricMap,
31  * mrpt::containers::CDynamicGrid, The application icp-slam,
32  * mrpt::maps::CMultiMetricMap
33  * \note New in MRPT 1.4.0
34  * \ingroup mrpt_maps_grp
35  */
38 {
40  public:
41  /** Constructor */
43  TMapRepresentation mapType = mrGMRF_SD, double x_min = -2,
44  double x_max = 2, double y_min = -2, double y_max = 2,
45  double resolution = 0.5,
46  /** [in] Whether to call updateMapEstimation(). If false, make sure of
47  calling that function before accessing map contents. */
48  bool run_first_map_estimation_now = true);
49 
50  /** Parameters related with inserting observations into the map */
53  {
54  /** Default values loader */
56 
57  void loadFromConfigFile(
59  const std::string& section) override; // See base docs
60  void dumpToTextStream(
61  std::ostream& out) const override; // See base docs
63 
64  /** Returns a 3D object representing the map */
65  virtual void getAs3DObject(
66  mrpt::opengl::CSetOfObjects::Ptr& outObj) const override;
67 
68  /** Returns two 3D objects representing the mean and variance maps */
69  virtual void getAs3DObject(
71  mrpt::opengl::CSetOfObjects::Ptr& varObj) const override;
72 
73  virtual bool insertIndividualPoint(
74  const double x, const double y, const double z,
77  virtual double dem_get_resolution() const override;
78  virtual size_t dem_get_size_x() const override;
79  virtual size_t dem_get_size_y() const override;
80  virtual bool dem_get_z_by_cell(
81  const size_t cx, const size_t cy, double& z_out) const override;
82  virtual bool dem_get_z(
83  const double x, const double y, double& z_out) const override;
84  virtual void dem_update_map() override;
85 
86  /** Get the part of the options common to all CRandomFieldGridMap2D classes
87  */
90  {
91  return &insertionOptions;
92  }
93 
94  // See docs in base class
95  void internal_clear() override;
97  const mrpt::obs::CObservation* obs,
98  const mrpt::poses::CPose3D* robotPose = nullptr) override;
100  const mrpt::obs::CObservation* obs,
101  const mrpt::poses::CPose3D& takenFrom) override;
102 
104  /** Runs map estimation at start up (Default:true) */
105  bool run_map_estimation_at_ctor;
106  /** See CHeightGridMap2D_MRF::CHeightGridMap2D_MRF */
107  double min_x, max_x, min_y, max_y, resolution;
108  /** The kind of map representation (see
109  * CHeightGridMap2D_MRF::CHeightGridMap2D_MRF) */
111  /** Observations insertion options */
114 };
115 
116 } // End of namespace
117 } // End of namespace
118 #endif
mrpt::maps::CHeightGridMap2D_MRF::insertionOptions
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions insertionOptions
mrpt::maps::CHeightGridMap2D_MRF::dem_get_z_by_cell
virtual bool dem_get_z_by_cell(const size_t cx, const size_t cy, double &z_out) const override
Get cell 'z' by (cx,cy) cell indices.
Definition: CHeightGridMap2D_MRF.cpp:119
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions::loadFromConfigFile
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string &section) override
This method load the options from a ".ini"-like file or memory-stored string list.
Definition: CHeightGridMap2D_MRF.cpp:289
mrpt::maps::CHeightGridMap2D_Base::TPointInsertParams
Extra params for insertIndividualPoint()
Definition: CHeightGridMap2D_Base.h:42
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: CRandomFieldGridMap2D.h:242
mrpt::maps::CRandomFieldGridMap2D::mrGMRF_SD
@ mrGMRF_SD
Gaussian Markov Random Field, squared differences prior weights between 4 neighboring cells (see disc...
Definition: CRandomFieldGridMap2D.h:197
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::maps::CHeightGridMap2D_MRF::dem_get_size_x
virtual size_t dem_get_size_x() const override
Definition: CHeightGridMap2D_MRF.cpp:117
mrpt::maps::CHeightGridMap2D_MRF::insertIndividualPoint
virtual bool insertIndividualPoint(const double x, const double y, const double z, const CHeightGridMap2D_Base::TPointInsertParams &params=CHeightGridMap2D_Base::TPointInsertParams()) override
Update the DEM with one new point.
Definition: CHeightGridMap2D_MRF.cpp:105
mrpt::maps::CHeightGridMap2D_MRF
CHeightGridMap2D_MRF represents digital-elevation-model over a 2D area, with uncertainty,...
Definition: CHeightGridMap2D_MRF.h:36
source
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
mrpt::maps::CHeightGridMap2D_MRF::CHeightGridMap2D_MRF
CHeightGridMap2D_MRF(TMapRepresentation mapType=mrGMRF_SD, double x_min=-2, double x_max=2, double y_min=-2, double y_max=2, double resolution=0.5, bool run_first_map_estimation_now=true)
Constructor.
Definition: CHeightGridMap2D_MRF.cpp:92
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
mrpt::maps::CRandomFieldGridMap2D::TMapRepresentation
TMapRepresentation
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion.
Definition: CRandomFieldGridMap2D.h:175
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions::TInsertionOptions
TInsertionOptions()
Default values loader.
Definition: CHeightGridMap2D_MRF.cpp:272
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions::dumpToTextStream
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form,...
Definition: CHeightGridMap2D_MRF.cpp:273
mrpt::config::CLoadableOptions
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
Definition: config/CLoadableOptions.h:28
CHeightGridMap2D_Base.h
mrpt::opengl::CSetOfObjects::Ptr
std::shared_ptr< CSetOfObjects > Ptr
Definition: CSetOfObjects.h:30
mrpt::maps::CHeightGridMap2D_MRF::getAs3DObject
virtual void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map.
Definition: CHeightGridMap2D_MRF.cpp:302
mrpt::maps::CHeightGridMap2D_MRF::internal_computeObservationLikelihood
double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) override
Internal method called by computeObservationLikelihood()
Definition: CHeightGridMap2D_MRF.cpp:160
mrpt::maps::CHeightGridMap2D_MRF::dem_get_size_y
virtual size_t dem_get_size_y() const override
Definition: CHeightGridMap2D_MRF.cpp:118
mrpt::maps::CHeightGridMap2D_MRF::internal_insertObservation
bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=nullptr) override
Internal method called by insertObservation()
Definition: CHeightGridMap2D_MRF.cpp:151
MAP_DEFINITION_START
#define MAP_DEFINITION_START(_CLASS_NAME_)
Add a MAP_DEFINITION_START() ...
Definition: TMetricMapTypesRegistry.h:57
MAP_DEFINITION_END
#define MAP_DEFINITION_END(_CLASS_NAME_)
Definition: TMetricMapTypesRegistry.h:67
mrpt::maps::CHeightGridMap2D_MRF::dem_get_resolution
virtual double dem_get_resolution() const override
Definition: CHeightGridMap2D_MRF.cpp:116
mrpt::maps::CHeightGridMap2D_MRF::dem_update_map
virtual void dem_update_map() override
Ensure that all observations are reflected in the map estimate.
Definition: CHeightGridMap2D_MRF.cpp:143
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
mrpt::maps::CRandomFieldGridMap2D
CRandomFieldGridMap2D represents a 2D grid map where each cell is associated one real-valued property...
Definition: CRandomFieldGridMap2D.h:152
mrpt::maps::CHeightGridMap2D_MRF::getCommonInsertOptions
virtual CRandomFieldGridMap2D::TInsertionOptionsCommon * getCommonInsertOptions() override
Get the part of the options common to all CRandomFieldGridMap2D classes.
Definition: CHeightGridMap2D_MRF.h:89
mrpt::obs::CObservation
Declares a class that represents any robot's observation.
Definition: CObservation.h:43
mrpt::maps::CHeightGridMap2D_MRF::internal_clear
void internal_clear() override
Erase all the contents of the map.
Definition: CHeightGridMap2D_MRF.cpp:144
z
GLdouble GLdouble z
Definition: glext.h:3872
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::maps::CHeightGridMap2D_MRF::dem_get_z
virtual bool dem_get_z(const double x, const double y, double &z_out) const override
Get cell 'z' (x,y) by metric coordinates.
Definition: CHeightGridMap2D_MRF.cpp:131
CRandomFieldGridMap2D.h
y
GLenum GLint GLint y
Definition: glext.h:3538
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions
Parameters related with inserting observations into the map.
Definition: CHeightGridMap2D_MRF.h:51
x
GLenum GLint x
Definition: glext.h:3538
params
GLenum const GLfloat * params
Definition: glext.h:3534



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST