MRPT  2.0.4
CHeightGridMap2D_MRF.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
14 
15 namespace mrpt::maps
16 {
17 /** CHeightGridMap2D_MRF represents digital-elevation-model over a 2D area, with
18  * uncertainty, based on a Markov-Random-Field (MRF) estimator.
19  *
20  * There are a number of methods available to build the gas grid-map,
21  * depending on the value of
22  * "TMapRepresentation maptype" passed in the constructor (see base class
23  * mrpt::maps::CRandomFieldGridMap2D).
24  *
25  * Update the map with insertIndividualReading() or insertObservation()
26  *
27  * \sa mrpt::maps::CRandomFieldGridMap2D, mrpt::maps::CMetricMap,
28  * mrpt::containers::CDynamicGrid, The application icp-slam,
29  * mrpt::maps::CMultiMetricMap
30  * \note New in MRPT 1.4.0
31  * \ingroup mrpt_maps_grp
32  */
35 {
37  public:
38  /** Constructor */
40  TMapRepresentation mapType = mrGMRF_SD, double x_min = -2,
41  double x_max = 2, double y_min = -2, double y_max = 2,
42  double resolution = 0.5,
43  /** [in] Whether to call updateMapEstimation(). If false, make sure of
44  calling that function before accessing map contents. */
45  bool run_first_map_estimation_now = true);
46 
47  /** Parameters related with inserting observations into the map */
50  {
51  /** Default values loader */
53 
54  void loadFromConfigFile(
55  const mrpt::config::CConfigFileBase& source,
56  const std::string& section) override; // See base docs
57  void dumpToTextStream(
58  std::ostream& out) const override; // See base docs
60 
61  /** Returns a 3D object representing the map */
62  void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr& outObj) const override;
63 
64  /** Returns two 3D objects representing the mean and variance maps */
65  void getAs3DObject(
67  mrpt::opengl::CSetOfObjects::Ptr& varObj) const override;
68 
70  const double x, const double y, const double z,
73  double dem_get_resolution() const override;
74  size_t dem_get_size_x() const override;
75  size_t dem_get_size_y() const override;
76  bool dem_get_z_by_cell(
77  const size_t cx, const size_t cy, double& z_out) const override;
78  bool dem_get_z(
79  const double x, const double y, double& z_out) const override;
80  void dem_update_map() override;
81 
82  /** Get the part of the options common to all CRandomFieldGridMap2D classes
83  */
85  override
86  {
87  return &insertionOptions;
88  }
89 
90  // See docs in base class
91  void internal_clear() override;
93  const mrpt::obs::CObservation& obs,
94  const mrpt::poses::CPose3D* robotPose = nullptr) override;
96  const mrpt::obs::CObservation& obs,
97  const mrpt::poses::CPose3D& takenFrom) override;
98 
100  /** Runs map estimation at start up (Default:true) */
101  bool run_map_estimation_at_ctor{true};
102  /** See CHeightGridMap2D_MRF::CHeightGridMap2D_MRF */
103  double min_x{-2}, max_x{2}, min_y{-2}, max_y{2}, resolution{0.10f};
104  /** The kind of map representation (see
105  * CHeightGridMap2D_MRF::CHeightGridMap2D_MRF) */
107  /** Observations insertion options */
110 };
111 
112 } // namespace mrpt::maps
mrpt::maps::CHeightGridMap2D_MRF::insertionOptions
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions insertionOptions
mrpt::maps::CHeightGridMap2D_MRF::dem_get_z_by_cell
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:112
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:282
mrpt::opengl::CSetOfObjects::Ptr
std::shared_ptr< mrpt::opengl ::CSetOfObjects > Ptr
Definition: CSetOfObjects.h:28
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:152
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:22
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
out
mrpt::vision::TStereoCalibResults out
Definition: chessboard_stereo_camera_calib_unittest.cpp:25
mrpt::maps::CHeightGridMap2D_MRF::dem_get_size_x
size_t dem_get_size_x() const override
Definition: CHeightGridMap2D_MRF.cpp:110
mrpt::maps::CHeightGridMap2D_MRF::insertIndividualPoint
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:98
mrpt::maps::CHeightGridMap2D_MRF
CHeightGridMap2D_MRF represents digital-elevation-model over a 2D area, with uncertainty,...
Definition: CHeightGridMap2D_MRF.h:33
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:85
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:85
mrpt::maps::CHeightGridMap2D_MRF::TMapDefinition::insertionOpts
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions insertionOpts
Observations insertion options.
Definition: CHeightGridMap2D_MRF.h:108
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.
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:266
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:144
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:26
CHeightGridMap2D_Base.h
mrpt::maps::CHeightGridMap2D_MRF::getAs3DObject
void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map.
Definition: CHeightGridMap2D_MRF.cpp:295
params
mrpt::vision::TStereoCalibParams params
Definition: chessboard_stereo_camera_calib_unittest.cpp:24
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:153
mrpt::maps::CHeightGridMap2D_MRF::dem_get_size_y
size_t dem_get_size_y() const override
Definition: CHeightGridMap2D_MRF.cpp:111
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
double dem_get_resolution() const override
Definition: CHeightGridMap2D_MRF.cpp:109
mrpt::maps::CHeightGridMap2D_MRF::dem_update_map
void dem_update_map() override
Ensure that all observations are reflected in the map estimate.
Definition: CHeightGridMap2D_MRF.cpp:136
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
CRandomFieldGridMap2D::TInsertionOptionsCommon * getCommonInsertOptions() override
Get the part of the options common to all CRandomFieldGridMap2D classes.
Definition: CHeightGridMap2D_MRF.h:84
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
Internal method called by clear()
Definition: CHeightGridMap2D_MRF.cpp:137
mrpt::maps::CHeightGridMap2D_MRF::dem_get_z
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:124
mrpt::maps
Definition: CBeacon.h:21
CRandomFieldGridMap2D.h
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions
Parameters related with inserting observations into the map.
Definition: CHeightGridMap2D_MRF.h:48



Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sat Jun 27 14:00:59 UTC 2020