CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D area.
There are a number of methods available to build the gas grid-map, depending on the value of "TMapRepresentation maptype" passed in the constructor.
The following papers describe the mapping alternatives implemented here:
Definition at line 101 of file CGasConcentrationGridMap2D.h.
#include <mrpt/slam/CGasConcentrationGridMap2D.h>
Classes | |
struct | TdataMap |
The content of each m_lastObservations in the estimation when using the option : MOS_MODEl (insertionOptions.useMOSmodel =1) More... | |
struct | TInsertionOptions |
Parameters related with inserting observations into the map: More... | |
Public Types | |
enum | TMapRepresentation { mrKernelDM = 0, mrAchim = 0, mrKalmanFilter, mrKalmanApproximate, mrKernelDMV } |
The type of map representation to be used. More... | |
Public Member Functions | |
void | clear () |
Calls the base CMetricMap::clear Declared here to avoid ambiguity between the two clear() in both base classes. | |
float | cell2float (const TGasConcentrationCell &c) const |
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. | |
virtual | ~CGasConcentrationGridMap2D () |
Destructor. | |
bool | isEmpty () const |
Returns true if the map is empty/no observation has been inserted. | |
double | computeObservationLikelihood (const CObservation *obs, const CPose3D &takenFrom) |
Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map. | |
void | saveAsBitmapFile (const std::string &filName) const |
Save the current map as a graphical file (BMP,PNG,...). | |
void | resize (float new_x_min, float new_x_max, float new_y_min, float new_y_max, const TGasConcentrationCell &defaultValueNewCells, float additionalMarginMeters=1.0f) |
Changes the size of the grid, maintaining previous contents. | |
float | compute3DMatchingRatio (const CMetricMap *otherMap, const CPose3D &otherMapPose, float minDistForCorr=0.10f, float minMahaDistForCorr=2.0f) const |
Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps. | |
void | saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const |
The implementation in this class just calls all the corresponding method of the contained metric maps. | |
void | saveAsMatlab3DGraph (const std::string &filName) const |
Save a matlab ".m" file which represents as 3D surfaces the mean and a given confidence level for the concentration of each cell. | |
void | getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const |
Returns a 3D object representing the map. | |
void | auxParticleFilterCleanUp () |
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". | |
TMapRepresentation | getMapType () |
Return the type of the gas distribution map, according to parameters passed on construction. | |
void | predictMeasurement (const double &x, const double &y, double &out_predict_response, double &out_predict_response_variance) |
Returns the prediction of the measurement at some (x,y) coordinates, and its certainty (in the form of the expected variance). | |
void | getMeanAndCov (vector_double &out_means, CMatrixDouble &out_cov) const |
Return the mean and covariance vector of the full Kalman filter estimate (works for all KF-based methods). | |
Public Attributes | |
mrpt::slam::CGasConcentrationGridMap2D::TInsertionOptions | insertionOptions |
Protected Member Functions | |
void | insertObservation_KernelDM_DMV (float normReading, const CPose3D &sensorPose, bool is_DMV) |
The implementation of "insertObservation" for Achim Lilienthal's map models DM & DM+V. | |
void | insertObservation_KF (float normReading, const CPose3D &sensorPose) |
The implementation of "insertObservation" for the (whole) Kalman Filter map model. | |
void | insertObservation_KF2 (float normReading, const CPose3D &sensorPose) |
The implementation of "insertObservation" for the Efficient Kalman Filter map model. | |
void | CGasConcentration_estimation (float reading, const CPose3D &sensorPose, const mrpt::system::TTimeStamp timestamp) |
Estimates the gas concentration based on readings and sensor model. | |
void | noise_filtering (float reading, const CPose3D &sensorPose, const mrpt::system::TTimeStamp timestamp) |
Reduce noise by averaging with a mobile window. | |
void | save_log_map (const mrpt::system::TTimeStamp timestamp, const float reading, const float estimation, const float k, const double yaw, const float speed) |
Save the GAS_MAP generated into a log file for offline representation. | |
double | computeMeanCellValue_DM_DMV (const TGasConcentrationCell *cell) const |
Computes the average cell concentration, or the overall average value if it has never been observed. | |
double | computeVarCellValue_DM_DMV (const TGasConcentrationCell *cell) const |
Computes the estimated variance of the cell concentration, or the overall average variance if it has never been observed. | |
void | recoverMeanAndCov () const |
In the KF2 implementation, takes the auxiliary matrices and from them update the cells' mean and std values. | |
virtual void | internal_clear () |
Erase all the contents of the map. | |
virtual bool | internal_insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL) |
Insert the observation information into this map. | |
Protected Attributes | |
TdataMap | m_new_Obs |
[useMOSmodel] The last N GasObservations, used for the MOS MODEL estimation. | |
TdataMap | m_new_ANS |
std::vector< TdataMap > | m_lastObservations |
std::vector< TdataMap > | m_antiNoise_window |
std::ofstream * | m_debug_dump |
[useMOSmodel] Ofstream to save to file option "save_maplog" | |
uint16_t | decimate_count |
[useMOSmodel] Decimate value for oversampled enose readings | |
double | fixed_incT |
[useMOSmodel] To force e-nose samples to have fixed time increments | |
bool | first_incT |
TMapRepresentation | m_mapType |
The map representation type of this map, as passed in the constructor. | |
CMatrixD | m_cov |
The whole covariance matrix, used for the Kalman Filter map representation. | |
CMatrixD | m_stackedCov |
The compressed band diagonal matrix for the KF2 implementation. | |
bool | m_hasToRecoverMeanAndCov |
Only for the KF2 implementation. | |
Auxiliary vars for DM & DM+V methods | |
float | m_DM_lastCutOff |
std::vector< float > | m_DM_gaussWindow |
double | m_average_normreadings_mean |
double | m_average_normreadings_var |
size_t | m_average_normreadings_count |
Private Types | |
typedef utils::CDynamicGrid < TGasConcentrationCell > | BASE |
RTTI stuff | |
typedef CGasConcentrationGridMap2DPtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CGasConcentrationGridMap2D |
static mrpt::utils::TRuntimeClassId | classCGasConcentrationGridMap2D |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. | |
virtual mrpt::utils::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. | |
static mrpt::utils::CObject * | CreateObject () |
static CGasConcentrationGridMap2DPtr | Create () |
typedef utils::CDynamicGrid<TGasConcentrationCell> mrpt::slam::CGasConcentrationGridMap2D::BASE [private] |
Definition at line 103 of file CGasConcentrationGridMap2D.h.
A typedef for the associated smart pointer
Definition at line 106 of file CGasConcentrationGridMap2D.h.
The type of map representation to be used.
Definition at line 122 of file CGasConcentrationGridMap2D.h.
mrpt::slam::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.
virtual mrpt::slam::CGasConcentrationGridMap2D::~CGasConcentrationGridMap2D | ( | ) | [virtual] |
Destructor.
static const mrpt::utils::TRuntimeClassId* mrpt::slam::CGasConcentrationGridMap2D::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::slam::CMetricMap.
void mrpt::slam::CGasConcentrationGridMap2D::auxParticleFilterCleanUp | ( | ) | [virtual] |
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation".
This method should normally do nothing, but in some cases can be used to free auxiliary cached variables.
Implements mrpt::slam::CMetricMap.
float mrpt::slam::CGasConcentrationGridMap2D::cell2float | ( | const TGasConcentrationCell & | c | ) | const [inline] |
Definition at line 115 of file CGasConcentrationGridMap2D.h.
References mrpt::slam::TGasConcentrationCell::kf_mean.
void mrpt::slam::CGasConcentrationGridMap2D::CGasConcentration_estimation | ( | float | reading, |
const CPose3D & | sensorPose, | ||
const mrpt::system::TTimeStamp | timestamp | ||
) | [protected] |
Estimates the gas concentration based on readings and sensor model.
void mrpt::slam::CGasConcentrationGridMap2D::clear | ( | void | ) | [inline] |
Calls the base CMetricMap::clear Declared here to avoid ambiguity between the two clear() in both base classes.
Reimplemented from mrpt::slam::CMetricMap.
Definition at line 112 of file CGasConcentrationGridMap2D.h.
References mrpt::slam::CMetricMap::clear().
float mrpt::slam::CGasConcentrationGridMap2D::compute3DMatchingRatio | ( | const CMetricMap * | otherMap, |
const CPose3D & | otherMapPose, | ||
float | minDistForCorr = 0.10f , |
||
float | minMahaDistForCorr = 2.0f |
||
) | const [virtual] |
Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps.
This method always return 0 for grid maps.
otherMap | [IN] The other map to compute the matching with. |
otherMapPose | [IN] The 6D pose of the other map as seen from "this". |
minDistForCorr | [IN] The minimum distance between 2 non-probabilistic map elements for counting them as a correspondence. |
minMahaDistForCorr | [IN] The minimum Mahalanobis distance between 2 probabilistic map elements for counting them as a correspondence. |
Implements mrpt::slam::CMetricMap.
double mrpt::slam::CGasConcentrationGridMap2D::computeMeanCellValue_DM_DMV | ( | const TGasConcentrationCell * | cell | ) | const [protected] |
Computes the average cell concentration, or the overall average value if it has never been observed.
double mrpt::slam::CGasConcentrationGridMap2D::computeObservationLikelihood | ( | const CObservation * | obs, |
const CPose3D & | takenFrom | ||
) | [virtual] |
Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map.
takenFrom | The robot's pose the observation is supposed to be taken from. |
obs | The observation. |
Implements mrpt::slam::CMetricMap.
double mrpt::slam::CGasConcentrationGridMap2D::computeVarCellValue_DM_DMV | ( | const TGasConcentrationCell * | cell | ) | const [protected] |
Computes the estimated variance of the cell concentration, or the overall average variance if it has never been observed.
static CGasConcentrationGridMap2DPtr mrpt::slam::CGasConcentrationGridMap2D::Create | ( | ) | [static] |
static mrpt::utils::CObject* mrpt::slam::CGasConcentrationGridMap2D::CreateObject | ( | ) | [static] |
virtual mrpt::utils::CObject* mrpt::slam::CGasConcentrationGridMap2D::duplicate | ( | ) | const [virtual] |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
void mrpt::slam::CGasConcentrationGridMap2D::getAs3DObject | ( | mrpt::opengl::CSetOfObjectsPtr & | outObj | ) | const [virtual] |
Returns a 3D object representing the map.
Implements mrpt::slam::CMetricMap.
TMapRepresentation mrpt::slam::CGasConcentrationGridMap2D::getMapType | ( | ) |
Return the type of the gas distribution map, according to parameters passed on construction.
void mrpt::slam::CGasConcentrationGridMap2D::getMeanAndCov | ( | vector_double & | out_means, |
CMatrixDouble & | out_cov | ||
) | const |
Return the mean and covariance vector of the full Kalman filter estimate (works for all KF-based methods).
virtual const mrpt::utils::TRuntimeClassId* mrpt::slam::CGasConcentrationGridMap2D::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::slam::CMetricMap.
void mrpt::slam::CGasConcentrationGridMap2D::insertObservation_KernelDM_DMV | ( | float | normReading, |
const CPose3D & | sensorPose, | ||
bool | is_DMV | ||
) | [protected] |
The implementation of "insertObservation" for Achim Lilienthal's map models DM & DM+V.
normReading | Is a [0,1] normalized concentration reading. |
sensorPose | Is the sensor pose on the robot |
is_DMV | = false -> map type is Kernel DM; true -> map type is DM+V |
void mrpt::slam::CGasConcentrationGridMap2D::insertObservation_KF | ( | float | normReading, |
const CPose3D & | sensorPose | ||
) | [protected] |
The implementation of "insertObservation" for the (whole) Kalman Filter map model.
normReading | Is a [0,1] normalized concentration reading. |
sensorPose | Is the sensor pose |
void mrpt::slam::CGasConcentrationGridMap2D::insertObservation_KF2 | ( | float | normReading, |
const CPose3D & | sensorPose | ||
) | [protected] |
The implementation of "insertObservation" for the Efficient Kalman Filter map model.
normReading | Is a [0,1] normalized concentration reading. |
sensorPose | Is the sensor pose |
virtual void mrpt::slam::CGasConcentrationGridMap2D::internal_clear | ( | ) | [protected, virtual] |
Erase all the contents of the map.
Implements mrpt::slam::CMetricMap.
virtual bool mrpt::slam::CGasConcentrationGridMap2D::internal_insertObservation | ( | const CObservation * | obs, |
const CPose3D * | robotPose = NULL |
||
) | [protected, virtual] |
Insert the observation information into this map.
This method must be implemented in derived classes.
obs | The observation |
robotPose | The 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use CPose2D(0,0,deg) |
Implements mrpt::slam::CMetricMap.
bool mrpt::slam::CGasConcentrationGridMap2D::isEmpty | ( | ) | const [virtual] |
Returns true if the map is empty/no observation has been inserted.
Implements mrpt::slam::CMetricMap.
void mrpt::slam::CGasConcentrationGridMap2D::noise_filtering | ( | float | reading, |
const CPose3D & | sensorPose, | ||
const mrpt::system::TTimeStamp | timestamp | ||
) | [protected] |
Reduce noise by averaging with a mobile window.
void mrpt::slam::CGasConcentrationGridMap2D::predictMeasurement | ( | const double & | x, |
const double & | y, | ||
double & | out_predict_response, | ||
double & | out_predict_response_variance | ||
) |
Returns the prediction of the measurement at some (x,y) coordinates, and its certainty (in the form of the expected variance).
This methods is implemented differently for the different gas map types.
void mrpt::slam::CGasConcentrationGridMap2D::recoverMeanAndCov | ( | ) | const [protected] |
In the KF2 implementation, takes the auxiliary matrices and from them update the cells' mean and std values.
void mrpt::slam::CGasConcentrationGridMap2D::resize | ( | float | new_x_min, |
float | new_x_max, | ||
float | new_y_min, | ||
float | new_y_max, | ||
const TGasConcentrationCell & | defaultValueNewCells, | ||
float | additionalMarginMeters = 1.0f |
||
) |
Changes the size of the grid, maintaining previous contents.
void mrpt::slam::CGasConcentrationGridMap2D::save_log_map | ( | const mrpt::system::TTimeStamp | timestamp, |
const float | reading, | ||
const float | estimation, | ||
const float | k, | ||
const double | yaw, | ||
const float | speed | ||
) | [protected] |
Save the GAS_MAP generated into a log file for offline representation.
void mrpt::slam::CGasConcentrationGridMap2D::saveAsBitmapFile | ( | const std::string & | filName | ) | const |
Save the current map as a graphical file (BMP,PNG,...).
The file format will be derived from the file extension (see CImage::saveToFile ) It depends on the map representation model: mrAchim: Each pixel is the ratio mrKalmanFilter: Each pixel is the mean value of the Gaussian that represents each cell. mrInformationFilter: Id.
void mrpt::slam::CGasConcentrationGridMap2D::saveAsMatlab3DGraph | ( | const std::string & | filName | ) | const |
Save a matlab ".m" file which represents as 3D surfaces the mean and a given confidence level for the concentration of each cell.
This method can only be called in a KF map model.
void mrpt::slam::CGasConcentrationGridMap2D::saveMetricMapRepresentationToFile | ( | const std::string & | filNamePrefix | ) | const [virtual] |
The implementation in this class just calls all the corresponding method of the contained metric maps.
Implements mrpt::slam::CMetricMap.
mrpt::utils::CLASSINIT mrpt::slam::CGasConcentrationGridMap2D::_init_CGasConcentrationGridMap2D [static, protected] |
Definition at line 106 of file CGasConcentrationGridMap2D.h.
mrpt::utils::TRuntimeClassId mrpt::slam::CGasConcentrationGridMap2D::classCGasConcentrationGridMap2D [static] |
Definition at line 106 of file CGasConcentrationGridMap2D.h.
Definition at line 106 of file CGasConcentrationGridMap2D.h.
uint16_t mrpt::slam::CGasConcentrationGridMap2D::decimate_count [protected] |
[useMOSmodel] Decimate value for oversampled enose readings
Definition at line 318 of file CGasConcentrationGridMap2D.h.
bool mrpt::slam::CGasConcentrationGridMap2D::first_incT [protected] |
Definition at line 323 of file CGasConcentrationGridMap2D.h.
double mrpt::slam::CGasConcentrationGridMap2D::fixed_incT [protected] |
[useMOSmodel] To force e-nose samples to have fixed time increments
Definition at line 322 of file CGasConcentrationGridMap2D.h.
mrpt::slam::CGasConcentrationGridMap2D::TInsertionOptions mrpt::slam::CGasConcentrationGridMap2D::insertionOptions |
std::vector<TdataMap> mrpt::slam::CGasConcentrationGridMap2D::m_antiNoise_window [protected] |
Definition at line 310 of file CGasConcentrationGridMap2D.h.
size_t mrpt::slam::CGasConcentrationGridMap2D::m_average_normreadings_count [protected] |
Definition at line 343 of file CGasConcentrationGridMap2D.h.
double mrpt::slam::CGasConcentrationGridMap2D::m_average_normreadings_mean [protected] |
Definition at line 342 of file CGasConcentrationGridMap2D.h.
double mrpt::slam::CGasConcentrationGridMap2D::m_average_normreadings_var [protected] |
Definition at line 342 of file CGasConcentrationGridMap2D.h.
The whole covariance matrix, used for the Kalman Filter map representation.
Definition at line 328 of file CGasConcentrationGridMap2D.h.
std::ofstream* mrpt::slam::CGasConcentrationGridMap2D::m_debug_dump [protected] |
[useMOSmodel] Ofstream to save to file option "save_maplog"
Definition at line 314 of file CGasConcentrationGridMap2D.h.
std::vector<float> mrpt::slam::CGasConcentrationGridMap2D::m_DM_gaussWindow [protected] |
Definition at line 341 of file CGasConcentrationGridMap2D.h.
float mrpt::slam::CGasConcentrationGridMap2D::m_DM_lastCutOff [protected] |
Definition at line 340 of file CGasConcentrationGridMap2D.h.
bool mrpt::slam::CGasConcentrationGridMap2D::m_hasToRecoverMeanAndCov [mutable, protected] |
Only for the KF2 implementation.
Definition at line 336 of file CGasConcentrationGridMap2D.h.
std::vector<TdataMap> mrpt::slam::CGasConcentrationGridMap2D::m_lastObservations [protected] |
Definition at line 309 of file CGasConcentrationGridMap2D.h.
The map representation type of this map, as passed in the constructor.
Definition at line 326 of file CGasConcentrationGridMap2D.h.
Definition at line 308 of file CGasConcentrationGridMap2D.h.
[useMOSmodel] The last N GasObservations, used for the MOS MODEL estimation.
Definition at line 308 of file CGasConcentrationGridMap2D.h.
The compressed band diagonal matrix for the KF2 implementation.
The format is a Nx(W^2+2W+1) matrix, one row per cell in the grid map with the cross-covariances between each cell and half of the window around it in the grid.
Definition at line 334 of file CGasConcentrationGridMap2D.h.
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011 |