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::maps
17 {
18 /** CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D
19  * area.
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  * \ingroup mrpt_maps_grp
32  */
34 {
36  public:
37  /** Constructor
38  */
40  TMapRepresentation mapType = mrAchim, float x_min = -2, float x_max = 2,
41  float y_min = -2, float y_max = 2, float resolution = 0.1);
42 
43  /** Destructor */
45 
46  /** Parameters related with inserting observations into the map:
47  */
49  public TInsertionOptionsCommon
50  {
51  /** Default values loader */
53 
54  void loadFromConfigFile(
56  const std::string& section) override; // See base docs
57  void dumpToTextStream(
58  std::ostream& out) const override; // See base docs
59 
60  /** @name For all mapping methods
61  @{ */
62  /** The label of the CObservationGasSensor used to generate the map */
64  /** id for the enose used to generate this map (must be < gasGrid_count)
65  */
67  /** The sensor type for the gas concentration map (0x0000 ->mean of all
68  * installed sensors, 0x2600, 0x6810, ...) */
70  /** The label of the WindSenor used to simulate advection */
72 
73  //[Advection Options]
74  bool useWindInformation; //! Indicates if wind information must be used
75  //! to simulate Advection
76  float advectionFreq; //! Frequency for simulating advection (only used
77  //! to transform wind speed to distance)
78  float std_windNoise_phi, std_windNoise_mod; //! The std to consider on
79  //! wind information
80  //! measurements
82  default_wind_speed; //! The default value for the wind information
83 
84  /** @} */
85 
87 
88  /** Returns a 3D object representing the map */
89  virtual void getAs3DObject(
90  mrpt::opengl::CSetOfObjects::Ptr& outObj) const override;
91 
92  /** Returns two 3D objects representing the mean and variance maps */
93  virtual void getAs3DObject(
95  mrpt::opengl::CSetOfObjects::Ptr& varObj) const override;
96 
97  /** Returns the 3D object representing the wind grid information */
99 
100  /** Increase the kf_std of all cells from the m_map
101  * This mehod is usually called by the main_map to simulate loss of
102  *confidence in measurements when time passes */
103  virtual void increaseUncertainty(const double STD_increase_value);
104 
105  /** Implements the transition model of the gasConcentration map using the
106  * information of the wind maps */
107  bool simulateAdvection(const double& STD_increase_value);
108 
109  // Params for the estimation of the gaussian volume in a cell.
111  {
112  int cx; // x-index of the cell
113  int cy; // y-index of the cell
114  float value; // volume approximation
115  };
116 
117  // Params for the estimation of the wind effect on each cell of the grid
119  {
120  // Fixed params
121  float resolution; // Cell_resolution. To be read from config-file
122  float std_phi; // to be read from config-file
123  float std_r; // to be read from config-file
124 
125  // unsigned int subcell_count; //subcell_count x subcell_count subcells
126  // float subcell_res;
127  float phi_inc; // rad
128  unsigned int phi_count;
129  float r_inc; // m
130  float max_r; // maximum distance (m)
131  unsigned int r_count;
132 
133  std::vector<std::vector<std::vector<TGaussianCell>>>* table;
134  } LUT;
135 
136  protected:
137  /** Get the part of the options common to all CRandomFieldGridMap2D classes
138  */
141  {
142  return &insertionOptions;
143  }
144 
145  // See docs in base class
146  void internal_clear() override;
148  const mrpt::obs::CObservation* obs,
149  const mrpt::poses::CPose3D* robotPose = nullptr) override;
151  const mrpt::obs::CObservation* obs,
152  const mrpt::poses::CPose3D& takenFrom) override;
153 
154  /** Builds a LookUp table with the values of the Gaussian Weights result of
155  * the wind advection
156  * for a specific std_windNoise_phi value.
157  */
159 
162 
163  /** Gridmaps of the wind Direction/Module */
165 
166  /** The timestamp of the last time the advection simulation was executed */
168 
170  /** See CGasConcentrationGridMap2D::CGasConcentrationGridMap2D */
171  float min_x, max_x, min_y, max_y, resolution;
172  /** The kind of map representation (see
173  * CGasConcentrationGridMap2D::CGasConcentrationGridMap2D) */
175  /** Observations insertion options */
178 };
179 
180 }
181 #endif
182 
183 
void internal_clear() override
Erase all the contents of the map.
std::string gasSensorLabel
The label of the CObservationGasSensor used to generate the map.
void getWindAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &windObj) const
Returns the 3D object representing the wind grid information.
unsigned __int16 uint16_t
Definition: rptypes.h:44
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
#define MAP_DEFINITION_START(_CLASS_NAME_)
Add a MAP_DEFINITION_START() ...
uint16_t enose_id
id for the enose used to generate this map (must be < gasGrid_count)
TMapRepresentation
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion.
virtual void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map.
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.
Another alias for "mrKernelDM", for backwards compatibility (see discussion in mrpt::maps::CRandomFie...
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:40
This class allows loading and storing values and vectors of different types from a configuration text...
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.
float advectionFreq
Indicates if wind information must be used.
uint16_t gasSensorType
The sensor type for the gas concentration map (0x0000 ->mean of all installed sensors, 0x2600, 0x6810, ...)
bool simulateAdvection(const double &STD_increase_value)
Implements the transition model of the gasConcentration map using the information of the wind maps...
GLsizei const GLchar ** string
Definition: glext.h:4101
std::vector< std::vector< std::vector< TGaussianCell > > > * table
mrpt::containers::CDynamicGrid< double > windGrid_module
Gridmaps of the wind Direction/Module.
Parameters related with inserting observations into the map:
virtual CRandomFieldGridMap2D::TInsertionOptionsCommon * getCommonInsertOptions() override
Get the part of the options common to all CRandomFieldGridMap2D classes.
mrpt::system::TTimeStamp timeLastSimulated
The timestamp of the last time the advection simulation was executed.
double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) override
Internal method called by computeObservationLikelihood()
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...
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&#39;s observation.
Definition: CObservation.h:43
std::string windSensorLabel
The label of the WindSenor used to simulate advection.
bool build_Gaussian_Wind_Grid()
Builds a LookUp table with the values of the Gaussian Weights result of the wind advection for a spec...
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
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...
mrpt::containers::CDynamicGrid< double > windGrid_direction
CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D area. ...
#define MAP_DEFINITION_END(_CLASS_NAME_)
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.
float std_windNoise_phi
Frequency for simulating advection (only used.
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions insertionOptions
bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=nullptr) override
Internal method called by insertObservation()
struct mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable LUT



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