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::maps
17 {
18 /** CHeightGridMap2D_MRF represents digital-elevation-model over a 2D area, with
19  * uncertainty, based on a Markov-Random-Field (MRF) estimator.
20  *
21  * There are a number of methods available to build the gas grid-map,
22  * depending on the value of
23  * "TMapRepresentation maptype" passed in the constructor (see base class
24  * mrpt::maps::CRandomFieldGridMap2D).
25  *
26  * Update the map with insertIndividualReading() or insertObservation()
27  *
28  * \sa mrpt::maps::CRandomFieldGridMap2D, mrpt::maps::CMetricMap,
29  * mrpt::containers::CDynamicGrid, The application icp-slam,
30  * mrpt::maps::CMultiMetricMap
31  * \note New in MRPT 1.4.0
32  * \ingroup mrpt_maps_grp
33  */
36 {
38  public:
39  /** Constructor */
41  TMapRepresentation mapType = mrGMRF_SD, double x_min = -2,
42  double x_max = 2, double y_min = -2, double y_max = 2,
43  double resolution = 0.5,
44  /** [in] Whether to call updateMapEstimation(). If false, make sure of
45  calling that function before accessing map contents. */
46  bool run_first_map_estimation_now = true);
47 
48  /** Parameters related with inserting observations into the map */
51  {
52  /** Default values loader */
54 
55  void loadFromConfigFile(
57  const std::string& section) override; // See base docs
58  void dumpToTextStream(
59  std::ostream& out) const override; // See base docs
61 
62  /** Returns a 3D object representing the map */
63  virtual void getAs3DObject(
64  mrpt::opengl::CSetOfObjects::Ptr& outObj) const override;
65 
66  /** Returns two 3D objects representing the mean and variance maps */
67  virtual void getAs3DObject(
69  mrpt::opengl::CSetOfObjects::Ptr& varObj) const override;
70 
71  virtual bool insertIndividualPoint(
72  const double x, const double y, const double z,
75  virtual double dem_get_resolution() const override;
76  virtual size_t dem_get_size_x() const override;
77  virtual size_t dem_get_size_y() const override;
78  virtual bool dem_get_z_by_cell(
79  const size_t cx, const size_t cy, double& z_out) const override;
80  virtual bool dem_get_z(
81  const double x, const double y, double& z_out) const override;
82  virtual void dem_update_map() override;
83 
84  /** Get the part of the options common to all CRandomFieldGridMap2D classes
85  */
88  {
89  return &insertionOptions;
90  }
91 
92  // See docs in base class
93  void internal_clear() override;
95  const mrpt::obs::CObservation* obs,
96  const mrpt::poses::CPose3D* robotPose = nullptr) override;
98  const mrpt::obs::CObservation* obs,
99  const mrpt::poses::CPose3D& takenFrom) override;
100 
102  /** Runs map estimation at start up (Default:true) */
103  bool run_map_estimation_at_ctor;
104  /** See CHeightGridMap2D_MRF::CHeightGridMap2D_MRF */
105  double min_x, max_x, min_y, max_y, resolution;
106  /** The kind of map representation (see
107  * CHeightGridMap2D_MRF::CHeightGridMap2D_MRF) */
109  /** Observations insertion options */
112 };
113 
114 }
115 #endif
116 
117 
Extra params for insertIndividualPoint()
GLdouble GLdouble z
Definition: glext.h:3872
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
virtual void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map.
#define MAP_DEFINITION_START(_CLASS_NAME_)
Add a MAP_DEFINITION_START() ...
TMapRepresentation
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion.
CHeightGridMap2D_MRF represents digital-elevation-model over a 2D area, with uncertainty, based on a Markov-Random-Field (MRF) estimator.
Parameters related with inserting observations into the map.
bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=nullptr) override
Internal method called by insertObservation()
This class allows loading and storing values and vectors of different types from a configuration text...
virtual size_t dem_get_size_y() const override
virtual size_t dem_get_size_x() const override
GLsizei const GLchar ** string
Definition: glext.h:4101
virtual void dem_update_map() override
Ensure that all observations are reflected in the map estimate.
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.
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.
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.
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions insertionOptions
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...
CRandomFieldGridMap2D represents a 2D grid map where each cell is associated one real-valued property...
Gaussian Markov Random Field, squared differences prior weights between 4 neighboring cells (see disc...
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form, sending it to a std::ostream.
virtual CRandomFieldGridMap2D::TInsertionOptionsCommon * getCommonInsertOptions() override
Get the part of the options common to all CRandomFieldGridMap2D classes.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:86
Declares a class that represents any robot's observation.
Definition: CObservation.h:43
Virtual base class for Digital Elevation Model (DEM) maps.
void internal_clear() override
Erase all the contents of the map.
double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) override
Internal method called by computeObservationLikelihood()
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
GLenum GLint GLint y
Definition: glext.h:3538
virtual bool dem_get_z(const double x, const double y, double &z_out) const override
Get cell 'z' (x,y) by metric coordinates.
virtual double dem_get_resolution() const override
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.
GLenum GLint x
Definition: glext.h:3538
#define MAP_DEFINITION_END(_CLASS_NAME_)
GLenum const GLfloat * params
Definition: glext.h:3534



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020