59 insertionOpts.loadFromConfigFile(
source, sectionNamePrefix+
string(
"_insertOpts") );
71 this->insertionOpts.dumpToTextStream(out);
86 #define LUT_TABLE (*(LUT.table)) 175 robotPose2D =
CPose2D(*robotPose);
176 robotPose3D = (*robotPose);
205 sensorReading =
math::mean( it->readingsVoltage );
211 for (i=0; i<it->sensorTypes.size(); i++)
217 if (i<it->sensorTypes.size()){
218 sensorReading = it->readingsVoltage[i];
222 cout <<
"Sensor especified not found, compute default mean value" << endl;
223 sensorReading =
math::mean( it->readingsVoltage );
287 #if MRPT_IS_BIG_ENDIAN 352 vector<TOldCellTypeInVersion1> old_map(
n);
353 in.ReadBuffer( &old_map[0],
sizeof(old_map[0])*old_map.size() );
357 for (
size_t k=0;k<
n;k++)
359 m_map[k].kf_mean = (old_map[k].w!=0) ? old_map[k].wr : old_map[k].
mean;
360 m_map[k].kf_std = (old_map[k].w!=0) ? old_map[k].
w : old_map[k].
std;
371 #if MRPT_IS_BIG_ENDIAN 425 gasSensorLabel (
"MCEnose" ),
427 gasSensorType ( 0x0000 ),
428 windSensorLabel (
"windSensor" ),
429 useWindInformation ( false ),
430 std_windNoise_phi ( 0.2f ),
431 std_windNoise_mod ( 0.2f ),
432 default_wind_direction ( 0.0f ),
433 default_wind_speed ( 1.0f )
442 out.
printf(
"\n----------- [CGasConcentrationGridMap2D::TInsertionOptions] ------------ \n\n");
443 out.
printf(
"[TInsertionOptions.Common] ------------ \n\n");
444 internal_dumpToTextStream_common(out);
446 out.
printf(
"[TInsertionOptions.GasSpecific] ------------ \n\n");
447 out.
printf(
"gasSensorLabel = %s\n", gasSensorLabel.c_str() );
448 out.
printf(
"enose_id = %u\n", (
unsigned)enose_id);
449 out.
printf(
"gasSensorType = %u\n", (
unsigned)gasSensorType);
450 out.
printf(
"windSensorLabel = %s\n", windSensorLabel.c_str() );
451 out.
printf(
"useWindInformation = %u\n", useWindInformation);
453 out.
printf(
"advectionFreq = %f\n", advectionFreq);
454 out.
printf(
"default_wind_direction = %f\n", default_wind_direction);
455 out.
printf(
"default_wind_speed = %f\n", default_wind_speed);
456 out.
printf(
"std_windNoise_phi = %f\n", std_windNoise_phi);
457 out.
printf(
"std_windNoise_mod = %f\n", std_windNoise_mod);
470 internal_loadFromConfigFile_common(iniFile,section);
473 gasSensorLabel = iniFile.
read_string(section.c_str(),
"gasSensorLabel",
"Full_MCEnose",
true);
474 enose_id = iniFile.
read_int(section.c_str(),
"enoseID",enose_id);
479 stringstream convert ( sensorType_str );
480 convert>> std::hex >> tmpSensorType;
482 if (tmpSensorType>=0)
485 gasSensorType = tmpSensorType;
489 gasSensorType = iniFile.
read_int(section.c_str(),
"KF_sensorType",gasSensorType,
true);
492 windSensorLabel = iniFile.
read_string(section.c_str(),
"windSensorLabel",
"Full_MCEnose",
true);
495 useWindInformation = iniFile.
read_bool(section.c_str(),
"useWindInformation",
"false",
true);
498 default_wind_direction = iniFile.
read_float(section.c_str(),
"default_wind_direction",0,
false);
500 default_wind_speed = iniFile.
read_float(section.c_str(),
"default_wind_speed",0,
false);
503 std_windNoise_phi = iniFile.
read_float(section.c_str(),
"std_windNoise_phi",0,
false);
505 std_windNoise_mod = iniFile.
read_float(section.c_str(),
"std_windNoise_mod",0,
false);
508 advectionFreq = iniFile.
read_float(section.c_str(),
"advectionFreq",1,
true);
527 mrpt::opengl::CSetOfObjectsPtr &meanObj,
528 mrpt::opengl::CSetOfObjectsPtr &varObj )
const 543 size_t arrow_separation = 5;
557 if(
m_map.size() != wind_map_size )
559 cout <<
" GAS MAP DIMENSIONS DO NOT MATCH WIND MAP " << endl;
568 xs.resize( floor((x_max-x_min)/(arrow_separation*resol)) );
569 for (cx=0;cx<xs.size();cx++)
570 xs[cx] = x_min + arrow_separation*resol * cx;
573 ys.resize( floor((y_max-y_min)/(arrow_separation*resol)) );
574 for (cy=0;cy<ys.size();cy++)
575 ys[cy] = y_min + arrow_separation*resol * cy;
577 for (cy=0;cy<ys.size();cy++)
579 for (cx=0;cx<xs.size();cx++)
588 xs[cx]+
scale*cos(dir_xy),ys[cy]+
scale*sin(dir_xy),0,
595 windObj->insert(
obj );
610 for(
size_t it=0; it<
m_map.size(); it++ )
644 cout << endl <<
" - At since last simulation = " << At <<
"seconds" << endl;
655 int cell_i_cx,cell_i_cy;
656 float mu_phi, mu_r, mu_modwind;
657 const size_t N =
m_map.size();
661 double *row_sum = (
double*)calloc(N,
sizeof(
double));
668 if( N != wind_map_size )
670 cout <<
" GAS MAP DIMENSIONS DO NOT MATCH WIND INFORMATION " << endl;
688 mu_r = mu_modwind * At;
698 vector<TGaussianCell> &cells_to_update =
LUT_TABLE[phi_indx][r_indx];
701 for(
unsigned int ci=0; ci<cells_to_update.size(); ci++)
703 int final_cx = cell_i_cx + cells_to_update[ci].cx;
704 int final_cy = cell_i_cy + cells_to_update[ci].cy;
706 if( (final_cx>=0) && (final_cx<(int)getSizeX()) && (final_cy>=0) && (final_cy<(
int)
getSizeY()) )
708 int final_idx = final_cx + final_cy*
getSizeX();
711 if( cells_to_update[ci].
value != 0.0 )
713 A(final_idx,i) = cells_to_update[ci].value;
714 row_sum[final_idx] += cells_to_update[ci].value;
720 cout <<
" - SA matrix computed in " << tictac.
Tac() <<
"s" << endl << endl;
722 catch( std::exception &e)
724 cout <<
" ######### EXCEPTION computing Transition Matrix (A) ##########\n: " << e.what() << endl;
725 cout <<
"on cell i= " << i <<
" c=" <<
c << endl << endl;
736 double *new_means = (
double*)calloc(N,
sizeof(
double));
738 double *new_variances = (
double*)calloc(N,
sizeof(
double));
740 for(
size_t it_i=0; it_i<N; it_i++)
745 for(
size_t it_j=0; it_j<N; it_j++)
747 if (
m_map[it_j].kf_mean!=0 && A(it_i,it_j)!=0)
749 if (row_sum[it_i] >= 1)
750 new_means[it_i] += ( A(it_i,it_j)/row_sum[it_i] ) *
m_map[it_j].kf_mean;
752 new_means[it_i] += A(it_i,it_j) *
m_map[it_j].kf_mean;
761 if (row_sum[it_i] < 1)
764 for(
size_t it_j=0; it_j<N; it_j++)
768 if (row_sum[it_i] >= 1)
769 new_variances[it_i] += ( A(it_i,it_j)/row_sum[it_i] ) * (
m_stackedCov(it_j,0) +
square(
m_map[it_j].kf_mean - new_means[it_i]) );
771 new_variances[it_i] += A(it_i,it_j) * (
m_stackedCov(it_j,0) +
square(
m_map[it_j].kf_mean - new_means[it_i]) );
777 for(
size_t it_i=0; it_i<N; it_i++)
779 m_map[it_i].kf_mean = new_means[it_i];
783 for (
size_t it_j=0; it_j<N; it_j++)
792 cout <<
" - Mean&Var updated in " << tictac.
Tac() <<
"s" << endl;
801 catch( std::exception &e)
803 cout <<
" ######### EXCEPTION Updating Covariances ##########\n: " << e.what() << endl;
804 cout <<
"on row i= " << i <<
" column c=" <<
c << endl << endl;
841 cout << endl <<
"---------------------------------" << endl;
842 cout <<
" BUILDING GAUSSIAN WIND WEIGHTS " << endl;
843 cout <<
"---------------------------------" << endl << endl;
869 cout <<
"Looking for file: " << filename.c_str() << endl;
874 cout <<
"LookUp table found for this configuration. Loading..." << endl;
881 cout <<
"LookUp table NOT found. Generating table..." << endl;
888 debug_file =
fopen (
"simple_LUT.txt",
"w");
891 fprintf(debug_file,
"[ phi ] [ r ] ---> (cx,cy)=Value\n");
892 fprintf(debug_file,
"----------------------------------\n");
896 for (
size_t phi_indx=0; phi_indx<
LUT.
phi_count; phi_indx++ )
902 for (
size_t r_indx=0; r_indx<
LUT.
r_count; r_indx++ )
909 fprintf(debug_file,
"\n[%.2f] [%.2f] ---> ",phi,
r);
937 std::vector<double> vertex_x, vertex_y;
941 double minBBox_x = 1000;
942 double maxBBox_x = -1000;
943 double minBBox_y = 1000;
944 double maxBBox_y = -1000;
948 if( std_phi_BBox >
M_PI/3)
950 std_phi_BBox =
M_PI/3;
956 for(
int sd=(-3); sd<=(3); sd++ )
958 vertex_x[indx] = cell_i_x + (
r+sr*
LUT.
std_r)*cos(phi+sd*std_phi_BBox);
959 if (vertex_x[indx] < minBBox_x)
960 minBBox_x = vertex_x[indx];
961 if (vertex_x[indx] > maxBBox_x)
962 maxBBox_x = vertex_x[indx];
964 vertex_y[indx] = cell_i_y + (
r+sr*
LUT.
std_r)*sin(phi+sd*std_phi_BBox);
965 if (vertex_y[indx] < minBBox_y)
966 minBBox_y = vertex_y[indx];
967 if (vertex_y[indx] > maxBBox_y)
968 maxBBox_y = vertex_y[indx];
973 for(
int sd=(3); sd>=(-3); sd-- )
975 vertex_x[indx] = cell_i_x + (
r+sr*
LUT.
std_r)*cos(phi+sd*std_phi_BBox);
976 if (vertex_x[indx] < minBBox_x)
977 minBBox_x = vertex_x[indx];
978 if (vertex_x[indx] > maxBBox_x)
979 maxBBox_x = vertex_x[indx];
981 vertex_y[indx] = cell_i_y + (
r+sr*
LUT.
std_r)*sin(phi+sd*std_phi_BBox);
982 if (vertex_y[indx] < minBBox_y)
983 minBBox_y = vertex_y[indx];
984 if (vertex_y[indx] > maxBBox_y)
985 maxBBox_y = vertex_y[indx];
994 int min_cx =
static_cast<int>( floor(minBBox_x/
LUT.
resolution) );
995 int max_cx =
static_cast<int>( floor(maxBBox_x/
LUT.
resolution) );
996 int min_cy =
static_cast<int>( floor(minBBox_y/
LUT.
resolution) );
997 int max_cy =
static_cast<int>( floor(maxBBox_y/
LUT.
resolution) );
999 int num_cells_affected = (max_cx-min_cx+1) * (max_cy-min_cy+1);
1001 if( num_cells_affected == 1 )
1005 gauss_info.
cx = min_cx;
1006 gauss_info.
cy = min_cy;
1007 gauss_info.
value = 1;
1010 LUT_TABLE[phi_indx][r_indx].push_back(gauss_info);
1015 fprintf(debug_file,
"(%d,%d)=%.4f",gauss_info.
cx, gauss_info.
cy, gauss_info.
value);
1024 const int BB_x_subcells = (int) (floor( (maxBBox_x - minBBox_x)/subcell_pres ) +1 );
1025 const int BB_y_subcells = (int) (floor( (maxBBox_y - minBBox_y)/subcell_pres ) +1 );
1027 double subcell_pres_x = (maxBBox_x - minBBox_x)/BB_x_subcells;
1028 double subcell_pres_y = (maxBBox_y - minBBox_y)/BB_y_subcells;
1031 std::map<std::pair<int,int>,
float> w_values;
1032 std::map<std::pair<int,int>,
float>
::iterator it;
1035 for(
int scy=0; scy<BB_y_subcells; scy++)
1037 for(
int scx=0; scx<BB_x_subcells; scx++)
1040 float subcell_a_x = minBBox_x + (scx+0.5f)*subcell_pres_x;
1041 float subcell_a_y = minBBox_y + (scy+0.5f)*subcell_pres_y;
1044 float r_ia = sqrt(
square(subcell_a_x-cell_i_x) +
square(subcell_a_y-cell_i_y) );
1045 float phi_ia = atan2(subcell_a_y-cell_i_y, subcell_a_x-cell_i_x);
1054 w = (
w * (subcell_pres_x*subcell_pres_y)/r_ia);
1057 int cell_cx =
static_cast<int>( floor(subcell_a_x/
LUT.
resolution) );
1058 int cell_cy =
static_cast<int>( floor(subcell_a_y/
LUT.
resolution) );
1061 it = w_values.find(std::make_pair(cell_cx,cell_cy));
1062 if( it!=w_values.end() )
1063 w_values[std::make_pair(cell_cx,cell_cy)] +=
w;
1065 w_values[std::make_pair(cell_cx,cell_cy)] =
w;
1073 for(it= w_values.begin(); it != w_values.end(); it++)
1075 float w_final = (it->second)/sum_w;
1077 if( w_final >= 0.001 )
1081 gauss_info.
cx = it->first.first;
1082 gauss_info.
cy = it->first.second;
1083 gauss_info.
value = w_final;
1086 LUT_TABLE[phi_indx][r_indx].push_back(gauss_info);
1091 fprintf(debug_file,
"(%d,%d)=%.6f ",gauss_info.
cx, gauss_info.
cy, gauss_info.
value);
1178 cout <<
"Saving to File ....";
1182 if( !f.fileOpenCorrectly() )
1185 cout <<
"WARNING: Gaussian_Wind_Weights file NOT SAVED" << endl;
1205 for (
size_t phi_indx=0; phi_indx<
LUT.
phi_count; phi_indx++ )
1207 for (
size_t r_indx=0; r_indx<
LUT.
r_count; r_indx++ )
1210 size_t N =
LUT_TABLE[phi_indx][r_indx].size();
1213 for (
size_t i=0; i<N; i++)
1215 f << (float)
LUT_TABLE[phi_indx][r_indx][i].cx;
1216 f << (float)
LUT_TABLE[phi_indx][r_indx][i].cy;
1217 f <<
LUT_TABLE[phi_indx][r_indx][i].value;
1221 cout <<
"DONE" << endl;
1227 cout << endl <<
"------------------------------------------------------------" << endl;
1228 cout <<
"EXCEPTION WHILE SAVING LUT TO FILE" << endl;
1229 cout <<
"Exception = " << e.what() << endl;
1239 cout <<
"Loading from File ....";
1247 cout <<
"WARNING WHILE READING FROM: Gaussian_Wind_Weights" << endl;
1252 unsigned int t_uint;
1267 t_uint = (
unsigned int)t_float;
1277 t_uint = (
unsigned int)t_float;
1283 for (
size_t phi_indx=0; phi_indx<
LUT.
phi_count; phi_indx++ )
1285 for (
size_t r_indx=0; r_indx<
LUT.
r_count; r_indx++ )
1290 N = (size_t)t_float;
1292 for (
size_t i=0; i<N; i++)
1296 gauss_info.
cx = (int)t_float;
1299 gauss_info.
cy = (int)t_float;
1301 f >> gauss_info.
value;
1304 LUT_TABLE[phi_indx][r_indx].push_back(gauss_info);
1308 cout <<
"DONE" << endl;
1313 cout << endl <<
"------------------------------------------------------------" << endl;
1314 cout <<
"EXCEPTION WHILE LOADING LUT FROM FILE" << endl;
1315 cout <<
"Exception = " << e.what() << endl;
#define ASSERT_EQUAL_(__A, __B)
void clear()
Erase all the contents of the map.
float R_max
Limits for normalization of sensor readings.
double getXMax() const
Returns the "x" coordinate of right side of grid map.
double GMRF_saturate_max
(Default:-inf,+inf) Saturate the estimated mean in these limits
double x() const
Common members of all points & poses classes.
Virtual base for specifying the kind and parameters of one map (normally, to be inserted into mrpt::m...
FILE BASE_IMPEXP * fopen(const char *fileName, const char *mode) MRPT_NO_THROWS
An OS-independent version of fopen.
std::string gasSensorLabel
The label of the CObservationGasSensor used to generate the map.
float sigma
The sigma of the "Parzen"-kernel Gaussian.
bool read_bool(const std::string §ion, const std::string &name, bool defaultValue, bool failIfNotFound=false) const
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
static CArrowPtr Create()
float resolution
See CGasConcentrationGridMap2D::CGasConcentrationGridMap2D.
float read_float(const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const
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.
struct MAPS_IMPEXP mrpt::maps::CGasConcentrationGridMap2D::TGaussianWindTable LUT
int BASE_IMPEXP void BASE_IMPEXP fclose(FILE *f)
An OS-independent version of fclose.
double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE
Internal method called by computeObservationLikelihood()
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
GLenum GLenum GLenum GLenum GLenum scale
#define THROW_EXCEPTION(msg)
mrpt::utils::CDynamicGrid< double > windGrid_direction
uint16_t enose_id
id for the enose used to generate this map (must be < gasGrid_count)
#define LOADABLEOPTS_DUMP_VAR(variableName, variableType)
Macro for dumping a variable to a stream, within the method "dumpToTextStream(out)" (Variable types a...
This file implements several operations that operate element-wise on individual or pairs of container...
void dumpToTextStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
void WriteBuffer(const void *Buffer, size_t Count)
Writes a block of bytes to the stream from Buffer.
bool BASE_IMPEXP 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.
mrpt::math::CMatrixD m_cov
The whole covariance matrix, used for the Kalman Filter map representation.
double getXMin() const
Returns the "x" coordinate of left side of grid map.
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
size_t getSizeY() const
Returns the vertical size of grid map in cells count.
int BASE_IMPEXP fprintf(FILE *fil, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(2
An OS-independent version of fprintf.
std::string read_string(const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const
The structure for each e-nose.
TMapRepresentation
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion.
TMapGenericParams genericMapParams
Common params to all maps.
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions insertionOpts
Observations insertion options.
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 cutoffRadius
The cutoff radius for updating cells.
void fill(const T &value)
Fills all the cells with the same value.
TInsertionOptions()
Default values loader.
void Tic()
Starts the stopwatch.
GLsizei GLsizei GLuint * obj
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion) MRPT_OVERRIDE
This method load the options from a ".ini"-like file or memory-stored string list.
GLubyte GLubyte GLubyte GLubyte w
void idx2cxcy(const int &idx, int &cx, int &cy) const
Transform a global (linear) cell index value into its corresponding (x,y) cell indexes.
void recoverMeanAndCov() const
In the KF2 implementation, takes the auxiliary matrices and from them update the cells' mean and std ...
This class allows loading and storing values and vectors of different types from a configuration text...
T square(const T x)
Inline function for the square of a number.
TMapRepresentation m_mapType
The map representation type of this map, as passed in the constructor.
void loadFromConfigFile_map_specific(const mrpt::utils::CConfigFileBase &source, const std::string §ionNamePrefix)
Load all map-specific params.
T * cellByPos(double x, double y)
Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map...
int read_int(const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const
float KF_observationModelNoise
The sensor model noise (in normalized concentration units).
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
This base provides a set of functions for maths stuff.
double getYMax() const
Returns the "y" coordinate of bottom side of grid map.
math::TPose3D eNosePoseOnTheRobot
The pose of the sensors on the robot.
float advectionFreq
Indicates if wind information must be used to simulate Advection.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
The contents of each cell in a CRandomFieldGridMap2D map.
A helper class that can convert an enum value into its textual representation, and viceversa...
uint16_t gasSensorType
The sensor type for the gas concentration map (0x0000 ->mean of all installed sensors, 0x2600, 0x6810, ...)
virtual ~CGasConcentrationGridMap2D()
Destructor.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
size_t m_average_normreadings_count
std::vector< TRandomFieldCell > m_map
The cells.
This class implements a high-performance stopwatch.
size_t getSizeX() const
Returns the horizontal size of grid map in cells count.
mrpt::utils::CDynamicGrid< double > windGrid_module
Gridmaps of the wind Direction/Module.
std::vector< std::vector< std::vector< TGaussianCell > > > * table
bool simulateAdvection(const double &STD_increase_value)
Implements the transition model of the gasConcentration map using the information of the wind maps...
This namespace contains representation of robot actions and observations.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
virtual void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
Returns a 3D object representing the map (mean)
Declares a class derived from "CObservation" that represents a set of readings from gas sensors...
GLsizei const GLchar ** string
T * cellByIndex(unsigned int cx, unsigned int cy)
Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the ma...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
bool m_hasToRecoverMeanAndCov
Only for the KF2 implementation.
mrpt::system::TTimeStamp timeLastSimulated
The timestamp of the last time the advection simulation was executed.
virtual void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
Returns a 3D object representing the map.
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
std::string sensorLabel
An arbitrary label that can be used to identify the sensor.
unsigned __int64 uint64_t
#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 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...
#define CFileGZOutputStream
Saves data to a file and transparently compress the data using the given compression level...
GLdouble GLdouble GLdouble r
double getResolution() const
Returns the resolution of the grid map.
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).
Declares a class that represents any robot's observation.
std::vector< TObservationENose > m_readings
One entry per e-nose on the robot.
mrpt::maps::CGasConcentrationGridMap2D::TMapRepresentation mapType
The kind of map representation (see CGasConcentrationGridMap2D::CGasConcentrationGridMap2D) ...
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is of t...
bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
Internal method called by insertObservation()
void BASE_IMPEXP 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...
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.
double Tac()
Stops the stopwatch.
GLsizei GLsizei GLchar * source
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...
int round(const T value)
Returns the closer integer (int) to x.
void dyngridcommon_writeToStream(mrpt::utils::CStream &out) const
void setSize(const double x_min, const double x_max, const double y_min, const double y_max, const double resolution, const T *fill_value=NULL)
Changes the size of the grid, ERASING all previous contents.
mrpt::math::CMatrixD m_stackedCov
The compressed band diagonal matrix for the KF2 implementation.
GLsizei const GLfloat * value
CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D area. ...
double BASE_IMPEXP 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 ...
This class is a "CSerializable" wrapper for "CMatrixFloat".
bool load_Gaussian_Wind_Grid_From_File()
unsigned __int32 uint32_t
void dyngridcommon_readFromStream(mrpt::utils::CStream &in, bool cast_from_float=false)
void dumpToTextStream_map_specific(mrpt::utils::CStream &out) const
static mrpt::maps::CMetricMap * internal_CreateFromMapDefinition(const mrpt::maps::TMetricMapInitializer &def)
float KF_initialCellStd
The initial standard deviation of each cell's concentration (will be stored both at each cell's struc...
void getWindAs3DObject(mrpt::opengl::CSetOfObjectsPtr &windObj) const
Returns the 3D object representing the wind grid information.
void internal_clear() MRPT_OVERRIDE
Erase all the contents of the map.
EIGEN_STRONG_INLINE double mean() const
Computes the mean of the entire matrix.
float std_windNoise_phi
Frequency for simulating advection (only used to transform wind speed to distance) ...
float default_wind_direction
The std to consider on wind information measurements.
double GMRF_lambdaObsLoss
The loss of information of the observations with each iteration.
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions insertionOptions
virtual void internal_clear() MRPT_OVERRIDE
Erase all the contents of the map.
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()