39     "mrpt::maps::CGasConcentrationGridMap2D,gasGrid",
    49         const std::string& sectionNamePrefix)
    52     const std::string sSectCreation =
    53         sectionNamePrefix + string(
"_creationOpts");
    60         sSectCreation, 
"mapType", mapType);
    62     insertionOpts.loadFromConfigFile(
    63         source, sectionNamePrefix + 
string(
"_insertOpts"));
    67     std::ostream& 
out)
 const    80     this->insertionOpts.dumpToTextStream(
out);
   101 #define LUT_TABLE (*(LUT.table))   107     TMapRepresentation mapType, 
float x_min, 
float x_max, 
float y_min,
   108     float y_max, 
float resolution)
   113     insertionOptions.GMRF_saturate_min = 0;
   114     insertionOptions.GMRF_saturate_max = 1;
   115     insertionOptions.GMRF_lambdaObsLoss = 1.0;
   123     windGrid_module.setSize(x_min, x_max, y_min, y_max, resolution);
   124     windGrid_direction.setSize(x_min, x_max, y_min, y_max, resolution);
   130 CGasConcentrationGridMap2D::~CGasConcentrationGridMap2D() = 
default;
   134 void CGasConcentrationGridMap2D::internal_clear()
   182         robotPose2D = 
CPose2D(*robotPose);
   183         robotPose3D = (*robotPose);
   202             if (o.sensorLabel.compare(
"MCEnose") == 0 ||
   203                 o.sensorLabel.compare(
"Full_MCEnose") == 0)
   222                     for (i = 0; i < it->sensorTypes.size(); i++)
   224                         if (it->sensorTypes.at(i) ==
   229                     if (i < it->sensorTypes.size())
   231                         sensorReading = it->readingsVoltage[i];
   235                         cout << 
"Sensor especified not found, compute default "   285     [[maybe_unused]] 
const CPose3D& takenFrom)
   301     n = 
static_cast<uint32_t
>(
m_map.size());
   305 #if MRPT_IS_BIG_ENDIAN   306     for (uint32_t i = 0; i < n; i++)
   309             << 
m_map[i].dmv_var_mean;
   366                 vector<TOldCellTypeInVersion1> old_map(n);
   367                 in.
ReadBuffer(&old_map[0], 
sizeof(old_map[0]) * old_map.size());
   371                 for (
size_t k = 0; k < n; k++)
   374                         (old_map[k].w != 0) ? old_map[k].wr : old_map[k].
mean;
   376                         (old_map[k].w != 0) ? old_map[k].w : old_map[k].
std;
   388 #if MRPT_IS_BIG_ENDIAN   389                 for (uint32_t i = 0; i < n; i++)
   390                     in >> 
m_map[i].kf_mean() >> 
m_map[i].dm_mean() >>
   391                         m_map[i].dmv_var_mean;
   440       gasSensorLabel(
"MCEnose"),
   442       windSensorLabel(
"windSensor")
   448     std::ostream& 
out)
 const   450     out << 
"\n----------- [CGasConcentrationGridMap2D::TInsertionOptions] "   452     out << 
"[TInsertionOptions.Common] ------------ \n\n";
   453     internal_dumpToTextStream_common(
   456     out << 
"[TInsertionOptions.GasSpecific] ------------ \n\n";
   458         "gasSensorLabel                         = %s\n",
   459         gasSensorLabel.c_str());
   461         "enose_id                               = %u\n", (
unsigned)enose_id);
   463         "gasSensorType                          = %u\n",
   464         (
unsigned)gasSensorType);
   466         "windSensorLabel                            = %s\n",
   467         windSensorLabel.c_str());
   469         "useWindInformation                     = %u\n", useWindInformation);
   472         "advectionFreq                          = %f\n", advectionFreq);
   474         "default_wind_direction                 = %f\n",
   475         default_wind_direction);
   477         "default_wind_speed                     = %f\n", default_wind_speed);
   479         "std_windNoise_phi                      = %f\n", std_windNoise_phi);
   481         "std_windNoise_mod                      = %f\n", std_windNoise_mod);
   493     internal_loadFromConfigFile_common(
iniFile, section);
   496     gasSensorLabel = 
iniFile.read_string(
   497         section.c_str(), 
"gasSensorLabel", 
"Full_MCEnose", 
true);
   498     enose_id = 
iniFile.read_int(section.c_str(), 
"enoseID", enose_id);
   501         std::string sensorType_str =
   502             iniFile.read_string(section.c_str(), 
"gasSensorType", 
"-1", 
true);
   504         stringstream 
convert(sensorType_str);
   505         convert >> std::hex >> tmpSensorType;
   507         if (tmpSensorType >= 0)
   510             gasSensorType = tmpSensorType;
   514             gasSensorType = 
iniFile.read_int(
   515                 section.c_str(), 
"KF_sensorType", gasSensorType, 
true);
   518     windSensorLabel = 
iniFile.read_string(
   519         section.c_str(), 
"windSensorLabel", 
"Full_MCEnose", 
true);
   523         iniFile.read_bool(section.c_str(), 
"useWindInformation", 
"false", 
true);
   526     default_wind_direction =
   527         iniFile.read_float(section.c_str(), 
"default_wind_direction", 0, 
false);
   530         iniFile.read_float(section.c_str(), 
"default_wind_speed", 0, 
false);
   534         iniFile.read_float(section.c_str(), 
"std_windNoise_phi", 0, 
false);
   537         iniFile.read_float(section.c_str(), 
"std_windNoise_mod", 0, 
false);
   541         iniFile.read_float(section.c_str(), 
"advectionFreq", 1, 
true);
   577     size_t arrow_separation =
   588     unsigned int wind_map_size =
   593     if (
m_map.size() != wind_map_size)
   595         cout << 
" GAS MAP DIMENSIONS DO NOT MATCH WIND MAP " << endl;
   600     vector<float> xs, ys;
   603     xs.resize(floor((x_max - x_min) / (arrow_separation * resol)));
   604     for (cx = 0; cx < xs.size(); cx++)
   605         xs[cx] = x_min + arrow_separation * resol * cx;
   608     ys.resize(floor((y_max - y_min) / (arrow_separation * resol)));
   609     for (cy = 0; cy < ys.size(); cy++)
   610         ys[cy] = y_min + arrow_separation * resol * cy;
   612     for (cy = 0; cy < ys.size(); cy++)
   614         for (cx = 0; cx < xs.size(); cx++)
   621                 xs[cx], ys[cy], 0.f, xs[cx] + scale * (
float)cos(dir_xy),
   622                 ys[cy] + scale * (
float)sin(dir_xy), 0.f, 1.15f * scale,
   623                 0.3f * scale, 0.35f * scale);
   627             obj->setColor(r, g, b);
   629             windObj->insert(obj);
   638     const double STD_increase_value)
   645     for (
size_t it = 0; it < 
m_map.size(); it++)
   680     cout << endl << 
" - At since last simulation = " << At << 
"seconds" << endl;
   690     int cell_i_cx, cell_i_cy;
   691     float mu_phi, mu_r, mu_modwind;
   692     const size_t N = 
m_map.size();
   696     auto* row_sum = (
double*)calloc(N, 
sizeof(
double));
   701         unsigned int wind_map_size =
   706         if (N != wind_map_size)
   708             cout << 
" GAS MAP DIMENSIONS DO NOT MATCH WIND INFORMATION "   716         for (i = 0; i < N; i++)
   723                 cell_i_cx, cell_i_cy);  
   729             mu_r = mu_modwind * At;
   738             vector<TGaussianCell>& cells_to_update =
   742             for (
auto& ci : cells_to_update)
   744                 int final_cx = cell_i_cx + ci.cx;
   745                 int final_cy = cell_i_cy + ci.cy;
   747                 if ((final_cx >= 0) && (final_cx < (
int)
getSizeX()) &&
   748                     (final_cy >= 0) && (final_cy < (
int)
getSizeY()))
   750                     int final_idx = final_cx + final_cy * 
getSizeX();
   755                         A(final_idx, i) = ci.value;
   756                         row_sum[final_idx] += ci.value;
   762         cout << 
" - SA matrix computed in " << tictac.
Tac() << 
"s" << endl
   765     catch (
const std::exception& e)
   767         cout << 
" #########  EXCEPTION computing Transition Matrix (A) "   770         cout << 
"on cell i= " << i << 
"  c=" << c << endl << endl;
   780         auto* new_means = (
double*)calloc(N, 
sizeof(
double));
   782         auto* new_variances = (
double*)calloc(N, 
sizeof(
double));
   784         for (
size_t it_i = 0; it_i < N; it_i++)
   789             for (
size_t it_j = 0; it_j < N; it_j++)
   791                 if (
m_map[it_j].kf_mean() != 0 && 
A(it_i, it_j) != 0)
   793                     if (row_sum[it_i] >= 1)
   794                         new_means[it_i] += (
A(it_i, it_j) / row_sum[it_i]) *
   795                                            m_map[it_j].kf_mean();
   798                             A(it_i, it_j) * 
m_map[it_j].kf_mean();
   806             if (row_sum[it_i] < 1)
   807                 new_variances[it_i] =
   808                     (1 - row_sum[it_i]) *
   811             for (
size_t it_j = 0; it_j < N; it_j++)
   813                 if (
A(it_i, it_j) != 0)
   815                     if (row_sum[it_i] >= 1)
   816                         new_variances[it_i] +=
   817                             (
A(it_i, it_j) / row_sum[it_i]) *
   821                         new_variances[it_i] +=
   830         for (
size_t it_i = 0; it_i < N; it_i++)
   832             m_map[it_i].kf_mean() = new_means[it_i];  
   836             for (
size_t it_j = 0; it_j < N; it_j++)
   847         cout << 
" - Mean&Var updated in " << tictac.
Tac() << 
"s" << endl;
   854     catch (
const std::exception& e)
   856         cout << 
" #########  EXCEPTION Updating Covariances ##########\n: "   858         cout << 
"on row i= " << i << 
"  column c=" << c << endl << endl;
   897     cout << endl << 
"---------------------------------" << endl;
   898     cout << 
" BUILDING GAUSSIAN WIND WEIGHTS " << endl;
   899     cout << 
"---------------------------------" << endl << endl;
   911     std::string filename = 
format(
   912         "Gaussian_Wind_Weights_res(%f)_stdPhi(%f)_stdR(%f).gz", 
LUT.
resolution,
   924     LUT.
table = 
new vector<vector<vector<TGaussianCell>>>(
   926         vector<vector<TGaussianCell>>(
LUT.
r_count, vector<TGaussianCell>()));
   938     cout << 
"Looking for file: " << filename.c_str() << endl;
   943         cout << 
"LookUp table found for this configuration. Loading..." << endl;
   949         cout << 
"LookUp table NOT found. Generating table..." << endl;
   956             debug_file = 
fopen(
"simple_LUT.txt", 
"w");
   958                 debug_file, 
" phi_inc = %.4f \n r_inc = %.4f \n", 
LUT.
phi_inc,
   961                 debug_file, 
" std_phi = %.4f \n std_r = %.4f \n", 
LUT.
std_phi,
   963             fprintf(debug_file, 
"[ phi ] [ r ] ---> (cx,cy)=Value\n");
   964             fprintf(debug_file, 
"----------------------------------\n");
   968         for (
size_t phi_indx = 0; phi_indx < 
LUT.
phi_count; phi_indx++)
   974             for (
size_t r_indx = 0; r_indx < 
LUT.
r_count; r_indx++)
   981                     fprintf(debug_file, 
"\n[%.2f] [%.2f] ---> ", phi, r);
  1010                 std::vector<double> vertex_x, vertex_y;
  1011                 vertex_x.resize(14);
  1012                 vertex_y.resize(14);
  1014                 double minBBox_x = 1000;
  1015                 double maxBBox_x = -1000;
  1016                 double minBBox_y = 1000;
  1017                 double maxBBox_y = -1000;
  1022                 if (std_phi_BBox > 
M_PI / 3)
  1024                     std_phi_BBox = 
M_PI / 3;  
  1032                 for (
int sd = (-3); sd <= (3); sd++)
  1036                         (r + sr * 
LUT.
std_r) * cos(phi + sd * std_phi_BBox);
  1037                     if (vertex_x[indx] < minBBox_x) minBBox_x = vertex_x[indx];
  1038                     if (vertex_x[indx] > maxBBox_x) maxBBox_x = vertex_x[indx];
  1042                         (r + sr * 
LUT.
std_r) * sin(phi + sd * std_phi_BBox);
  1043                     if (vertex_y[indx] < minBBox_y) minBBox_y = vertex_y[indx];
  1044                     if (vertex_y[indx] > maxBBox_y) maxBBox_y = vertex_y[indx];
  1049                 for (
int sd = (3); sd >= (-3); sd--)
  1053                         (r + sr * 
LUT.
std_r) * cos(phi + sd * std_phi_BBox);
  1054                     if (vertex_x[indx] < minBBox_x) minBBox_x = vertex_x[indx];
  1055                     if (vertex_x[indx] > maxBBox_x) maxBBox_x = vertex_x[indx];
  1059                         (r + sr * 
LUT.
std_r) * sin(phi + sd * std_phi_BBox);
  1060                     if (vertex_y[indx] < minBBox_y) minBBox_y = vertex_y[indx];
  1061                     if (vertex_y[indx] > maxBBox_y) maxBBox_y = vertex_y[indx];
  1080                 int num_cells_affected =
  1081                     (max_cx - min_cx + 1) * (max_cy - min_cy + 1);
  1083                 if (num_cells_affected == 1)
  1087                     gauss_info.
cx = min_cx;  
  1088                     gauss_info.
cy = min_cy;
  1089                     gauss_info.
value = 1;  
  1092                     LUT_TABLE[phi_indx][r_indx].push_back(gauss_info);
  1098                             debug_file, 
"(%d,%d)=%.4f", gauss_info.
cx,
  1099                             gauss_info.
cy, gauss_info.
value);
  1108                     const int BB_x_subcells =
  1109                         (int)(floor((maxBBox_x - minBBox_x) / subcell_pres) + 1);
  1110                     const int BB_y_subcells =
  1111                         (int)(floor((maxBBox_y - minBBox_y) / subcell_pres) + 1);
  1113                     double subcell_pres_x =
  1114                         (maxBBox_x - minBBox_x) / BB_x_subcells;
  1115                     double subcell_pres_y =
  1116                         (maxBBox_y - minBBox_y) / BB_y_subcells;
  1119                     std::map<std::pair<int, int>, 
float> w_values;
  1120                     std::map<std::pair<int, int>, 
float>::iterator it;
  1123                     for (
int scy = 0; scy < BB_y_subcells; scy++)
  1125                         for (
int scx = 0; scx < BB_x_subcells; scx++)
  1129                                 minBBox_x + (scx + 0.5f) * subcell_pres_x;
  1131                                 minBBox_y + (scy + 0.5f) * subcell_pres_y;
  1135                                 square(subcell_a_x - cell_i_x) +
  1136                                 square(subcell_a_y - cell_i_y));
  1137                             float phi_ia = atan2(
  1138                                 subcell_a_y - cell_i_y, subcell_a_x - cell_i_x);
  1164                                     (w * (subcell_pres_x * subcell_pres_y) /
  1168                             int cell_cx = 
static_cast<int>(
  1170                             int cell_cy = 
static_cast<int>(
  1175                                 w_values.find(std::make_pair(cell_cx, cell_cy));
  1176                             if (it != w_values.end())  
  1177                                 w_values[std::make_pair(cell_cx, cell_cy)] += w;
  1179                                 w_values[std::make_pair(cell_cx, cell_cy)] = w;
  1186                     for (it = w_values.begin(); it != w_values.end(); it++)
  1189                             (it->second) / sum_w;  
  1191                         if (w_final >= 0.001)
  1196                             gauss_info.
cx = it->first.first;
  1197                             gauss_info.
cy = it->first.second;
  1198                             gauss_info.
value = w_final;
  1201                             LUT_TABLE[phi_indx][r_indx].push_back(gauss_info);
  1207                                     debug_file, 
"(%d,%d)=%.6f    ",
  1208                                     gauss_info.
cx, gauss_info.
cy,
  1308         if (debug) 
fclose(debug_file);
  1319     cout << 
"Saving to File ....";
  1322         "Gaussian_Wind_Weights_res(%f)_stdPhi(%f)_stdR(%f).gz", 
LUT.
resolution,
  1327         cout << 
"WARNING: Gaussian_Wind_Weights file NOT SAVED" << endl;
  1347         for (
size_t phi_indx = 0; phi_indx < 
LUT.
phi_count; phi_indx++)
  1349             for (
size_t r_indx = 0; r_indx < 
LUT.
r_count; r_indx++)
  1352                 size_t N = 
LUT_TABLE[phi_indx][r_indx].size();
  1355                 for (
size_t i = 0; i < N; i++)
  1357                     f << (float)
LUT_TABLE[phi_indx][r_indx][i].cx;
  1358                     f << (float)
LUT_TABLE[phi_indx][r_indx][i].cy;
  1359                     f << 
LUT_TABLE[phi_indx][r_indx][i].value;
  1363         cout << 
"DONE" << endl;
  1366     catch (
const std::exception& e)
  1369              << 
"------------------------------------------------------------"  1371         cout << 
"EXCEPTION WHILE SAVING LUT TO FILE" << endl;
  1372         cout << 
"Exception = " << e.what() << endl;
  1380     cout << 
"Loading from File ....";
  1385             "Gaussian_Wind_Weights_res(%f)_stdPhi(%f)_stdR(%f).gz",
  1389             cout << 
"WARNING WHILE READING FROM: Gaussian_Wind_Weights" << endl;
  1395         unsigned int t_uint;
  1411         t_uint = (
unsigned int)t_float;
  1421         t_uint = (
unsigned int)t_float;
  1427         for (
size_t phi_indx = 0; phi_indx < 
LUT.
phi_count; phi_indx++)
  1429             for (
size_t r_indx = 0; r_indx < 
LUT.
r_count; r_indx++)
  1434                 N = (size_t)t_float;
  1436                 for (
size_t i = 0; i < N; i++)
  1440                     gauss_info.
cx = (int)t_float;
  1443                     gauss_info.
cy = (int)t_float;
  1445                     f >> gauss_info.
value;
  1448                     LUT_TABLE[phi_indx][r_indx].push_back(gauss_info);
  1452         cout << 
"DONE" << endl;
  1455     catch (
const std::exception& e)
  1458              << 
"------------------------------------------------------------"  1460         cout << 
"EXCEPTION WHILE LOADING LUT FROM FILE" << endl;
  1461         cout << 
"Exception = " << e.what() << endl;
 
float min_x
See CGasConcentrationGridMap2D::CGasConcentrationGridMap2D. 
 
double Tac() noexcept
Stops the stopwatch. 
 
Virtual base for specifying the kind and parameters of one map (normally, to be inserted into mrpt::m...
 
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive. 
 
std::vector< TRandomFieldCell > m_map
The cells. 
 
std::string gasSensorLabel
The label of the CObservationGasSensor used to generate the map. 
 
float sigma
The sigma of the "Parzen"-kernel Gaussian. 
 
void getWindAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &windObj) const
Returns the 3D object representing the wind grid information. 
 
double getYMax() const
Returns the "y" coordinate of bottom side of grid map. 
 
void fill(const T &value)
Fills all the cells with the same value. 
 
IMPLEMENTS_SERIALIZABLE(CGasConcentrationGridMap2D, CRandomFieldGridMap2D, mrpt::maps) CGasConcentrationGridMap2D
 
#define THROW_EXCEPTION(msg)
 
std::string std::string format(std::string_view fmt, ARGS &&... args)
 
bool enableSaveAs3DObject
(Default=true) If false, calling CMetricMap::getAs3DObject() will have no effects ...
 
double m_average_normreadings_mean
 
float KF_defaultCellMeanValue
The default value for the mean of cells' concentration. 
 
int void fclose(FILE *f)
An OS-independent version of fclose. 
 
double getResolution() const
Returns the resolution of the grid map. 
 
uint16_t enose_id
id for the enose used to generate this map (must be < gasGrid_count) 
 
This file implements several operations that operate element-wise on individual or pairs of container...
 
bool fileExists(const std::string &fileName)
Test if a given file (or directory) exists. 
 
double getYMin() const
Returns the "y" coordinate of top side of grid map. 
 
A high-performance stopwatch, with typical resolution of nanoseconds. 
 
mrpt::math::CMatrixD m_cov
The whole covariance matrix, used for the Kalman Filter map representation. 
 
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime. 
 
The structure for each e-nose. 
 
TMapRepresentation
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion. 
 
void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map. 
 
void idx2cxcy(int idx, int &cx, int &cy) const
Transform a global (linear) cell index value into its corresponding (x,y) cell indexes. 
 
TMapGenericParams genericMapParams
Common params to all maps. 
 
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion) override
This method load the options from a ".ini"-like file or memory-stored string list. 
 
void dyngridcommon_writeToStream(STREAM &out) const
 
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions insertionOpts
Observations insertion options. 
 
float cutoffRadius
The cutoff radius for updating cells. 
 
CGasConcentrationGridMap2D(TMapRepresentation mapType=mrAchim, float x_min=-2, float x_max=2, float y_min=-2, float y_max=2, float resolution=0.1f)
Constructor. 
 
TInsertionOptions()
Default values loader. 
 
bool fileOpenCorrectly() const
Returns true if the file was open without errors. 
 
void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map (mean) 
 
void recoverMeanAndCov() const
In the KF2 implementation, takes the auxiliary matrices and from them update the cells' mean and std ...
 
TMapRepresentation m_mapType
The map representation type of this map, as passed in the constructor. 
 
ENUMTYPE read_enum(const std::string §ion, const std::string &name, const ENUMTYPE &defaultValue, bool failIfNotFound=false) const
Reads an "enum" value, where the value in the config file can be either a numerical value or the symb...
 
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations. 
 
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream, std::istream, std::ostream, std::stringstream. 
 
bool simulateAdvection(double STD_increase_value)
Implements the transition model of the gasConcentration map using the information of the wind maps...
 
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive. 
 
float KF_observationModelNoise
The sensor model noise (in normalized concentration units). 
 
#define ASSERT_(f)
Defines an assertion mechanism. 
 
float d2f(const double d)
shortcut for static_cast<float>(double) 
 
float R_min
Limits for normalization of sensor readings. 
 
This class allows loading and storing values and vectors of different types from a configuration text...
 
This base provides a set of functions for maths stuff. 
 
double getXMin() const
Returns the "x" coordinate of left side of grid map. 
 
static Ptr Create(Args &&... args)
 
math::TPose3D eNosePoseOnTheRobot
The pose of the sensors on the robot. 
 
float advectionFreq
Indicates if wind information must be used. 
 
void jet2rgb(const float color_index, float &r, float &g, float &b)
Computes the RGB color components (range [0,1]) for the corresponding color index in the range [0...
 
#define ASSERT_EQUAL_(__A, __B)
Assert comparing two values, reporting their actual values upon failure. 
 
The contents of each cell in a CRandomFieldGridMap2D map. 
 
uint16_t gasSensorType
The sensor type for the gas concentration map (0x0000 ->mean of all installed sensors, 0x2600, 0x6810, ...) 
 
size_t m_average_normreadings_count
 
double internal_computeObservationLikelihood(const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D &takenFrom) override
Internal method called by computeObservationLikelihood() 
 
T * cellByPos(double x, double y)
Returns a pointer to the contents of a cell given by its coordinates, or nullptr if it is out of the ...
 
This namespace contains representation of robot actions and observations. 
 
string iniFile(myDataDir+string("benchmark-options.ini"))
 
#define IS_CLASS(obj, class_name)
True if the given reference to object (derived from mrpt::rtti::CObject) is of the given class...
 
double x() const
Common members of all points & poses classes. 
 
T * cellByIndex(unsigned int cx, unsigned int cy)
Returns a pointer to the contents of a cell given by its cell indexes, or nullptr if it is out of the...
 
Declares a class derived from "CObservation" that represents a set of readings from gas sensors...
 
size_t getSizeX() const
Returns the horizontal size of grid map in cells count. 
 
void dyngridcommon_readFromStream(STREAM &in, bool cast_from_float=false)
 
std::vector< std::vector< std::vector< TGaussianCell > > > * table
 
mrpt::containers::CDynamicGrid< double > windGrid_module
Gridmaps of the wind Direction/Module. 
 
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
 
bool m_hasToRecoverMeanAndCov
Only for the KF2 implementation. 
 
size_t getSizeY() const
Returns the vertical size of grid map in cells count. 
 
#define LOADABLEOPTS_DUMP_VAR(variableName, variableType)
Macro for dumping a variable to a stream, within the method "dumpToTextStream(out)" (Variable types a...
 
int fprintf(FILE *fil, const char *format,...) noexcept MRPT_printf_format_check(2
An OS-independent version of fprintf. 
 
mrpt::system::TTimeStamp timeLastSimulated
The timestamp of the last time the advection simulation was executed. 
 
return_t square(const num_t x)
Inline function for the square of a number. 
 
bool convert(const sensor_msgs::LaserScan &msg, const mrpt::poses::CPose3D &pose, mrpt::obs::CObservation2DRangeScan &obj)
 
#define MRPT_LOAD_CONFIG_VAR( variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
 
This class is a "CSerializable" wrapper for "CMatrixFloat". 
 
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries. 
 
#define MAP_DEFINITION_REGISTER(_CLASSNAME_STRINGS, _CLASSNAME_WITH_NS)
Registers one map class into TMetricMapInitializer factory. 
 
CRandomFieldGridMap2D represents a 2D grid map where each cell is associated one real-valued property...
 
Virtual base class for "archives": classes abstracting I/O streams. 
 
void loadFromConfigFile_map_specific(const mrpt::config::CConfigFileBase &source, const std::string §ionNamePrefix) override
Load all map-specific params. 
 
float KF_covSigma
The "sigma" for the initial covariance value between cells (in meters). 
 
Declares a virtual base class for all metric maps storage classes. 
 
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
 
A class used to store a 3D pose (a 3D translation + a rotation in 3D). 
 
mrpt::vision::TStereoCalibResults out
 
Declares a class that represents any robot's observation. 
 
mrpt::maps::CGasConcentrationGridMap2D::TMapRepresentation mapType
The kind of map representation (see CGasConcentrationGridMap2D::CGasConcentrationGridMap2D) ...
 
void internal_clear() override
Erase all the contents of the map. 
 
void dumpToTextStream_map_specific(std::ostream &out) const override
 
double m_average_normreadings_var
 
bool build_Gaussian_Wind_Grid()
Builds a LookUp table with the values of the Gaussian Weights result of the wind advection for a spec...
 
uint16_t KF_W_size
[mrKalmanApproximate] The size of the window of neighbor cells. 
 
double mean(const CONTAINER &v)
Computes the mean value of a vector. 
 
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...
 
size_t ReadBuffer(void *Buffer, size_t Count)
Reads a block of bytes from the stream into Buffer. 
 
double getXMax() const
Returns the "x" coordinate of right side of grid map. 
 
mrpt::containers::CDynamicGrid< double > windGrid_direction
 
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen. 
 
mrpt::math::CMatrixD m_stackedCov
The compressed band diagonal matrix for the KF2 implementation. 
 
CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D area. ...
 
double timeDifference(const mrpt::system::TTimeStamp t_first, const mrpt::system::TTimeStamp t_later)
Returns the time difference from t1 to t2 (positive if t2 is posterior to t1), in seconds...
 
std::vector< float > readingsVoltage
The set of readings (in volts) from the array of sensors (size of "sensorTypes" is the same that the ...
 
Saves data to a file and transparently compress the data using the given compression level...
 
void Tic() noexcept
Starts the stopwatch. 
 
bool load_Gaussian_Wind_Grid_From_File()
 
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. 
 
static mrpt::maps::CMetricMap * internal_CreateFromMapDefinition(const mrpt::maps::TMetricMapInitializer &def)
 
void clear()
Clear the contents of this container. 
 
float KF_initialCellStd
The initial standard deviation of each cell's concentration (will be stored both at each cell's struc...
 
float std_windNoise_phi
Frequency for simulating advection (only used. 
 
float default_wind_direction
The std to consider on. 
 
bool internal_insertObservation(const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose=nullptr) override
Internal method called by insertObservation() 
 
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions insertionOptions
 
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object. 
 
void insertIndividualReading(const double sensorReading, const mrpt::math::TPoint2D &point, const bool update_map=true, const bool time_invariant=true, const double reading_stddev=.0)
Direct update of the map with a reading in a given position of the map, using the appropriate method ...
 
bool save_Gaussian_Wind_Grid_To_File()
 
int round(const T value)
Returns the closer integer (int) to x.