MRPT  2.0.1
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
Extra params for insertIndividualPoint()
CRandomFieldGridMap2D::TInsertionOptionsCommon * getCommonInsertOptions() override
Get the part of the options common to all CRandomFieldGridMap2D classes.
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
bool internal_insertObservation(const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose=nullptr) override
Internal method called by insertObservation()
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() ...
mrpt::vision::TStereoCalibParams params
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.
This class allows loading and storing values and vectors of different types from a configuration text...
void dem_update_map() override
Ensure that all observations are reflected in the map estimate.
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.
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
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.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
mrpt::vision::TStereoCalibResults out
Declares a class that represents any robot's observation.
Definition: CObservation.h:43
mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions insertionOpts
Observations insertion options.
Virtual base class for Digital Elevation Model (DEM) maps.
void internal_clear() override
Internal method called by clear()
bool dem_get_z(const double x, const double y, double &z_out) const override
Get cell 'z' (x,y) by metric coordinates.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
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.
#define MAP_DEFINITION_END(_CLASS_NAME_)
double internal_computeObservationLikelihood(const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D &takenFrom) override
Internal method called by computeObservationLikelihood()



Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020