Main MRPT website > C++ reference for MRPT 1.9.9
CGasConcentrationGridMap2D.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 CGasConcentrationGridMap2D_H
11 #define CGasConcentrationGridMap2D_H
12 
15 
16 namespace mrpt
17 {
18 namespace maps
19 {
20 /** CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D
21  * area.
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  * \ingroup mrpt_maps_grp
34  */
36 {
38  public:
39  /** Constructor
40  */
42  TMapRepresentation mapType = mrAchim, float x_min = -2, float x_max = 2,
43  float y_min = -2, float y_max = 2, float resolution = 0.1);
44 
45  /** Destructor */
47 
48  /** Parameters related with inserting observations into the map:
49  */
51  public TInsertionOptionsCommon
52  {
53  /** Default values loader */
55 
56  void loadFromConfigFile(
58  const std::string& section) override; // See base docs
59  void dumpToTextStream(
60  std::ostream& out) const override; // See base docs
61 
62  /** @name For all mapping methods
63  @{ */
64  /** The label of the CObservationGasSensor used to generate the map */
66  /** id for the enose used to generate this map (must be < gasGrid_count)
67  */
69  /** The sensor type for the gas concentration map (0x0000 ->mean of all
70  * installed sensors, 0x2600, 0x6810, ...) */
72  /** The label of the WindSenor used to simulate advection */
74 
75  //[Advection Options]
76  bool useWindInformation; //! Indicates if wind information must be used
77  //! to simulate Advection
78  float advectionFreq; //! Frequency for simulating advection (only used
79  //! to transform wind speed to distance)
80  float std_windNoise_phi, std_windNoise_mod; //! The std to consider on
81  //! wind information
82  //! measurements
84  default_wind_speed; //! The default value for the wind information
85 
86  /** @} */
87 
89 
90  /** Returns a 3D object representing the map */
91  virtual void getAs3DObject(
92  mrpt::opengl::CSetOfObjects::Ptr& outObj) const override;
93 
94  /** Returns two 3D objects representing the mean and variance maps */
95  virtual void getAs3DObject(
97  mrpt::opengl::CSetOfObjects::Ptr& varObj) const override;
98 
99  /** Returns the 3D object representing the wind grid information */
101 
102  /** Increase the kf_std of all cells from the m_map
103  * This mehod is usually called by the main_map to simulate loss of
104  *confidence in measurements when time passes */
105  virtual void increaseUncertainty(const double STD_increase_value);
106 
107  /** Implements the transition model of the gasConcentration map using the
108  * information of the wind maps */
109  bool simulateAdvection(const double& STD_increase_value);
110 
111  // Params for the estimation of the gaussian volume in a cell.
113  {
114  int cx; // x-index of the cell
115  int cy; // y-index of the cell
116  float value; // volume approximation
117  };
118 
119  // Params for the estimation of the wind effect on each cell of the grid
121  {
122  // Fixed params
123  float resolution; // Cell_resolution. To be read from config-file
124  float std_phi; // to be read from config-file
125  float std_r; // to be read from config-file
126 
127  // unsigned int subcell_count; //subcell_count x subcell_count subcells
128  // float subcell_res;
129  float phi_inc; // rad
130  unsigned int phi_count;
131  float r_inc; // m
132  float max_r; // maximum distance (m)
133  unsigned int r_count;
134 
135  std::vector<std::vector<std::vector<TGaussianCell>>>* table;
136  } LUT;
137 
138  protected:
139  /** Get the part of the options common to all CRandomFieldGridMap2D classes
140  */
143  {
144  return &insertionOptions;
145  }
146 
147  // See docs in base class
148  void internal_clear() override;
150  const mrpt::obs::CObservation* obs,
151  const mrpt::poses::CPose3D* robotPose = nullptr) override;
153  const mrpt::obs::CObservation* obs,
154  const mrpt::poses::CPose3D& takenFrom) override;
155 
156  /** Builds a LookUp table with the values of the Gaussian Weights result of
157  * the wind advection
158  * for a specific std_windNoise_phi value.
159  */
161 
164 
165  /** Gridmaps of the wind Direction/Module */
167 
168  /** The timestamp of the last time the advection simulation was executed */
170 
172  /** See CGasConcentrationGridMap2D::CGasConcentrationGridMap2D */
173  float min_x, max_x, min_y, max_y, resolution;
174  /** The kind of map representation (see
175  * CGasConcentrationGridMap2D::CGasConcentrationGridMap2D) */
177  /** Observations insertion options */
180 };
181 
182 } // End of namespace
183 
184 } // End of namespace
185 
186 #endif
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::std_windNoise_phi
float std_windNoise_phi
Frequency for simulating advection (only used.
Definition: CGasConcentrationGridMap2D.h:80
mrpt::maps::CGasConcentrationGridMap2D::getAs3DObject
virtual void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map.
Definition: CGasConcentrationGridMap2D.cpp:561
mrpt::maps::CGasConcentrationGridMap2D::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: CGasConcentrationGridMap2D.cpp:503
mrpt::maps::CGasConcentrationGridMap2D
CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D area.
Definition: CGasConcentrationGridMap2D.h:35
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions
Parameters related with inserting observations into the map:
Definition: CGasConcentrationGridMap2D.h:50
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::useWindInformation
bool useWindInformation
Definition: CGasConcentrationGridMap2D.h:76
uint16_t
unsigned __int16 uint16_t
Definition: rptypes.h:44
mrpt::maps::CGasConcentrationGridMap2D::CGasConcentrationGridMap2D
CGasConcentrationGridMap2D(TMapRepresentation mapType=mrAchim, float x_min=-2, float x_max=2, float y_min=-2, float y_max=2, float resolution=0.1)
Constructor.
CObservationGasSensors.h
mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable::std_r
float std_r
Definition: CGasConcentrationGridMap2D.h:125
mrpt::maps::CRandomFieldGridMap2D::TInsertionOptionsCommon
Parameters common to any derived class.
Definition: CRandomFieldGridMap2D.h:242
mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable::table
std::vector< std::vector< std::vector< TGaussianCell > > > * table
Definition: CGasConcentrationGridMap2D.h:135
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::enose_id
uint16_t enose_id
id for the enose used to generate this map (must be < gasGrid_count)
Definition: CGasConcentrationGridMap2D.h:68
mrpt::maps::CGasConcentrationGridMap2D::getWindAs3DObject
void getWindAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &windObj) const
Returns the 3D object representing the wind grid information.
Definition: CGasConcentrationGridMap2D.cpp:586
mrpt::maps::CGasConcentrationGridMap2D::windGrid_module
mrpt::containers::CDynamicGrid< double > windGrid_module
Gridmaps of the wind Direction/Module.
Definition: CGasConcentrationGridMap2D.h:166
mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable::std_phi
float std_phi
Definition: CGasConcentrationGridMap2D.h:124
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::dumpToTextStream
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form,...
Definition: CGasConcentrationGridMap2D.cpp:460
mrpt::maps::CGasConcentrationGridMap2D::LUT
struct mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable LUT
mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable::r_count
unsigned int r_count
Definition: CGasConcentrationGridMap2D.h:133
mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable::phi_count
unsigned int phi_count
Definition: CGasConcentrationGridMap2D.h:130
mrpt::maps::CGasConcentrationGridMap2D::TGaussianCell
Definition: CGasConcentrationGridMap2D.h:112
mrpt::maps::CGasConcentrationGridMap2D::increaseUncertainty
virtual void increaseUncertainty(const double STD_increase_value)
Increase the kf_std of all cells from the m_map This mehod is usually called by the main_map to simul...
Definition: CGasConcentrationGridMap2D.cpp:651
mrpt::system::TTimeStamp
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
Definition: datetime.h:31
source
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::std_windNoise_mod
float std_windNoise_mod
Definition: CGasConcentrationGridMap2D.h:80
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::windSensorLabel
std::string windSensorLabel
The label of the WindSenor used to simulate advection.
Definition: CGasConcentrationGridMap2D.h:73
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::advectionFreq
float advectionFreq
Indicates if wind information must be used.
Definition: CGasConcentrationGridMap2D.h:78
mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable::resolution
float resolution
Definition: CGasConcentrationGridMap2D.h:123
mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable::phi_inc
float phi_inc
Definition: CGasConcentrationGridMap2D.h:129
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::maps::CGasConcentrationGridMap2D::load_Gaussian_Wind_Grid_From_File
bool load_Gaussian_Wind_Grid_From_File()
Definition: CGasConcentrationGridMap2D.cpp:1392
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::CGasConcentrationGridMap2D::save_Gaussian_Wind_Grid_To_File
bool save_Gaussian_Wind_Grid_To_File()
Definition: CGasConcentrationGridMap2D.cpp:1330
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
mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable
Definition: CGasConcentrationGridMap2D.h:120
mrpt::maps::CGasConcentrationGridMap2D::TGaussianCell::cx
int cx
Definition: CGasConcentrationGridMap2D.h:114
mrpt::opengl::CSetOfObjects::Ptr
std::shared_ptr< CSetOfObjects > Ptr
Definition: CSetOfObjects.h:30
mrpt::maps::CGasConcentrationGridMap2D::simulateAdvection
bool simulateAdvection(const double &STD_increase_value)
Implements the transition model of the gasConcentration map using the information of the wind maps
Definition: CGasConcentrationGridMap2D.cpp:685
mrpt::maps::CGasConcentrationGridMap2D::insertionOptions
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions insertionOptions
MAP_DEFINITION_START
#define MAP_DEFINITION_START(_CLASS_NAME_)
Add a MAP_DEFINITION_START() ...
Definition: TMetricMapTypesRegistry.h:57
mrpt::maps::CGasConcentrationGridMap2D::internal_insertObservation
bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=nullptr) override
Internal method called by insertObservation()
Definition: CGasConcentrationGridMap2D.cpp:177
mrpt::maps::CGasConcentrationGridMap2D::getCommonInsertOptions
virtual CRandomFieldGridMap2D::TInsertionOptionsCommon * getCommonInsertOptions() override
Get the part of the options common to all CRandomFieldGridMap2D classes.
Definition: CGasConcentrationGridMap2D.h:142
mrpt::containers::CDynamicGrid< double >
MAP_DEFINITION_END
#define MAP_DEFINITION_END(_CLASS_NAME_)
Definition: TMetricMapTypesRegistry.h:67
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::gasSensorType
uint16_t gasSensorType
The sensor type for the gas concentration map (0x0000 ->mean of all installed sensors,...
Definition: CGasConcentrationGridMap2D.h:71
mrpt::maps::CGasConcentrationGridMap2D::internal_clear
void internal_clear() override
Erase all the contents of the map.
Definition: CGasConcentrationGridMap2D.cpp:139
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::CGasConcentrationGridMap2D::TGaussianWindTable::r_inc
float r_inc
Definition: CGasConcentrationGridMap2D.h:131
mrpt::maps::CRandomFieldGridMap2D
CRandomFieldGridMap2D represents a 2D grid map where each cell is associated one real-valued property...
Definition: CRandomFieldGridMap2D.h:152
mrpt::maps::CGasConcentrationGridMap2D::~CGasConcentrationGridMap2D
virtual ~CGasConcentrationGridMap2D()
Destructor.
Definition: CGasConcentrationGridMap2D.cpp:135
mrpt::maps::CGasConcentrationGridMap2D::TGaussianCell::cy
int cy
Definition: CGasConcentrationGridMap2D.h:115
mrpt::maps::CGasConcentrationGridMap2D::windGrid_direction
mrpt::containers::CDynamicGrid< double > windGrid_direction
Definition: CGasConcentrationGridMap2D.h:166
mrpt::obs::CObservation
Declares a class that represents any robot's observation.
Definition: CObservation.h:43
mrpt::maps::CRandomFieldGridMap2D::mrAchim
@ mrAchim
Another alias for "mrKernelDM", for backwards compatibility (see discussion in mrpt::maps::CRandomFie...
Definition: CRandomFieldGridMap2D.h:182
mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable::max_r
float max_r
Definition: CGasConcentrationGridMap2D.h:132
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::default_wind_direction
float default_wind_direction
The std to consider on.
Definition: CGasConcentrationGridMap2D.h:83
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::maps::CGasConcentrationGridMap2D::timeLastSimulated
mrpt::system::TTimeStamp timeLastSimulated
The timestamp of the last time the advection simulation was executed.
Definition: CGasConcentrationGridMap2D.h:169
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::gasSensorLabel
std::string gasSensorLabel
The label of the CObservationGasSensor used to generate the map.
Definition: CGasConcentrationGridMap2D.h:65
mrpt::maps::CGasConcentrationGridMap2D::TGaussianCell::value
float value
Definition: CGasConcentrationGridMap2D.h:116
CRandomFieldGridMap2D.h
mrpt::maps::CGasConcentrationGridMap2D::build_Gaussian_Wind_Grid
bool build_Gaussian_Wind_Grid()
Builds a LookUp table with the values of the Gaussian Weights result of the wind advection for a spec...
Definition: CGasConcentrationGridMap2D.cpp:886
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::TInsertionOptions
TInsertionOptions()
Default values loader.
Definition: CGasConcentrationGridMap2D.cpp:444
mrpt::maps::CGasConcentrationGridMap2D::internal_computeObservationLikelihood
double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) override
Internal method called by computeObservationLikelihood()
Definition: CGasConcentrationGridMap2D.cpp:289
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions::default_wind_speed
float default_wind_speed
Definition: CGasConcentrationGridMap2D.h:84



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