Main MRPT website > C++ reference for MRPT 1.4.0
maps/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-2016, 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
17
18namespace mrpt
19{
20namespace maps
21{
23
24 /** CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D area.
25 *
26 * There are a number of methods available to build the gas grid-map, depending on the value of
27 * "TMapRepresentation maptype" passed in the constructor (see base class mrpt::maps::CRandomFieldGridMap2D).
28 *
29 * Update the map with insertIndividualReading() or insertObservation()
30 *
31 * \sa mrpt::maps::CRandomFieldGridMap2D, mrpt::maps::CMetricMap, mrpt::utils::CDynamicGrid, The application icp-slam, mrpt::maps::CMultiMetricMap
32 * \ingroup mrpt_maps_grp
33 */
35 {
36 // This must be added to any CSerializable derived class:
38 public:
39
40 /** Constructor
41 */
43 TMapRepresentation mapType = mrAchim,
44 float x_min = -2,
45 float x_max = 2,
46 float y_min = -2,
47 float y_max = 2,
48 float resolution = 0.1
49 );
50
51 /** Destructor */
53
54 /** Parameters related with inserting observations into the map:
55 */
59 {
60 TInsertionOptions(); //!< Default values loader
61
62 void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source,const std::string &section) MRPT_OVERRIDE; // See base docs
63 void dumpToTextStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE; // See base docs
64
65 /** @name For all mapping methods
66 @{ */
67 std::string gasSensorLabel; //!< The label of the CObservationGasSensor used to generate the map
68 uint16_t enose_id; //!< id for the enose used to generate this map (must be < gasGrid_count)
69 uint16_t gasSensorType; //!< The sensor type for the gas concentration map (0x0000 ->mean of all installed sensors, 0x2600, 0x6810, ...)
70 std::string windSensorLabel; //!< The label of the WindSenor used to simulate advection
71
72 //[Advection Options]
73 bool useWindInformation; //! Indicates if wind information must be used to simulate Advection
74 float advectionFreq; //! Frequency for simulating advection (only used to transform wind speed to distance)
75 float std_windNoise_phi, std_windNoise_mod; //! The std to consider on wind information measurements
76 float default_wind_direction, default_wind_speed; //! The default value for the wind information
77
78 /** @} */
79
80 } insertionOptions;
81
82 /** Returns a 3D object representing the map */
84
85 /** Returns two 3D objects representing the mean and variance maps */
87
88 /** Returns the 3D object representing the wind grid information */
90
91 /** Increase the kf_std of all cells from the m_map
92 * This mehod is usually called by the main_map to simulate loss of confidence in measurements when time passes */
93 virtual void increaseUncertainty(const double STD_increase_value);
94
95 /** Implements the transition model of the gasConcentration map using the information of the wind maps */
96 bool simulateAdvection(const double &STD_increase_value);
97
98 // Params for the estimation of the gaussian volume in a cell.
100 {
101 int cx; //x-index of the cell
102 int cy; //y-index of the cell
103 float value; //volume approximation
104 };
105
106 //Params for the estimation of the wind effect on each cell of the grid
108 {
109 //Fixed params
110 float resolution; //Cell_resolution. To be read from config-file
111 float std_phi; //to be read from config-file
112 float std_r; //to be read from config-file
113
114 //unsigned int subcell_count; //subcell_count x subcell_count subcells
115 //float subcell_res;
116 float phi_inc; //rad
117 unsigned int phi_count;
118 float r_inc; //m
119 float max_r; //maximum distance (m)
120 unsigned int r_count;
121
122 std::vector< std::vector< std::vector<TGaussianCell> > > *table;
123 }LUT;
124
125 protected:
126
127 /** Get the part of the options common to all CRandomFieldGridMap2D classes */
129 return &insertionOptions;
130 }
131
132 // See docs in base class
134 bool internal_insertObservation( const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose = NULL ) MRPT_OVERRIDE;
135 double internal_computeObservationLikelihood( const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom ) MRPT_OVERRIDE;
136
137 /** Builds a LookUp table with the values of the Gaussian Weights result of the wind advection
138 * for a specific std_windNoise_phi value.
139 */
140 bool build_Gaussian_Wind_Grid();
141
142 bool save_Gaussian_Wind_Grid_To_File();
143 bool load_Gaussian_Wind_Grid_From_File();
144
145 /** Gridmaps of the wind Direction/Module */
146 mrpt::utils::CDynamicGrid<double> windGrid_module, windGrid_direction;
147
148 /** The timestamp of the last time the advection simulation was executed */
149 mrpt::system::TTimeStamp timeLastSimulated;
150
152 float min_x,max_x,min_y,max_y,resolution; //!< See CGasConcentrationGridMap2D::CGasConcentrationGridMap2D
153 mrpt::maps::CGasConcentrationGridMap2D::TMapRepresentation mapType; //!< The kind of map representation (see CGasConcentrationGridMap2D::CGasConcentrationGridMap2D)
154 mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions insertionOpts; //!< Observations insertion options
156
157 };
159
160 } // End of namespace
161
162} // End of namespace
163
164#endif
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
#define MAP_DEFINITION_END(_CLASS_NAME_, _LINKAGE_)
#define MAP_DEFINITION_START(_CLASS_NAME_, _LINKAGE_)
Add a MAP_DEFINITION_START() ... MAP_DEFINITION_END() block inside the declaration of each metric map...
CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D area.
virtual void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
Returns a 3D object representing the map.
bool simulateAdvection(const double &STD_increase_value)
Implements the transition model of the gasConcentration map using the information of the wind maps
void getWindAs3DObject(mrpt::opengl::CSetOfObjectsPtr &windObj) const
Returns the 3D object representing the wind grid information.
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.
void internal_clear() MRPT_OVERRIDE
Erase all the contents of the map.
virtual void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &meanObj, mrpt::opengl::CSetOfObjectsPtr &varObj) const MRPT_OVERRIDE
Returns two 3D objects representing the mean and variance maps.
virtual ~CGasConcentrationGridMap2D()
Destructor.
virtual CRandomFieldGridMap2D::TInsertionOptionsCommon * getCommonInsertOptions() MRPT_OVERRIDE
Get the part of the options common to all CRandomFieldGridMap2D classes.
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...
CRandomFieldGridMap2D represents a 2D grid map where each cell is associated one real-valued property...
TMapRepresentation
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion.
This class allows loading and storing values and vectors of different types from a configuration text...
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:39
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Definition: mrpt_macros.h:28
struct OPENGL_IMPEXP CSetOfObjectsPtr
Definition: CSetOfObjects.h:23
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
unsigned int uint16_t
Definition: pstdint.h:170
std::vector< std::vector< std::vector< TGaussianCell > > > * table
Parameters related with inserting observations into the map:
std::string gasSensorLabel
The label of the CObservationGasSensor used to generate the map.
float default_wind_direction
The std to consider on wind information measurements.
uint16_t gasSensorType
The sensor type for the gas concentration map (0x0000 ->mean of all installed sensors,...
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string &section) MRPT_OVERRIDE
This method load the options from a ".ini"-like file or memory-stored string list.
float advectionFreq
Indicates if wind information must be used to simulate Advection.
void dumpToTextStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
This method should clearly display all the contents of the structure in textual form,...
uint16_t enose_id
id for the enose used to generate this map (must be < gasGrid_count)
std::string windSensorLabel
The label of the WindSenor used to simulate advection.



Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Mar 22 06:16:42 UTC 2023