Main MRPT website > C++ reference
MRPT logo
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Types

mrpt::slam::CGasConcentrationGridMap2D Class Reference


Detailed Description

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:

See also:
mrpt::slam::CMetricMap, mrpt::utils::CDynamicGrid, The application icp-slam, mrpt::slam::CMultiMetricMap

Definition at line 101 of file CGasConcentrationGridMap2D.h.

#include <mrpt/slam/CGasConcentrationGridMap2D.h>

Inheritance diagram for mrpt::slam::CGasConcentrationGridMap2D:
Inheritance graph
[legend]

List of all members.

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< TdataMapm_lastObservations
std::vector< TdataMapm_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::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static
CGasConcentrationGridMap2DPtr 
Create ()

Member Typedef Documentation

Definition at line 103 of file CGasConcentrationGridMap2D.h.

A typedef for the associated smart pointer

Definition at line 106 of file CGasConcentrationGridMap2D.h.


Member Enumeration Documentation

The type of map representation to be used.

Enumerator:
mrKernelDM 
mrAchim 
mrKalmanFilter 
mrKalmanApproximate 
mrKernelDMV 

Definition at line 122 of file CGasConcentrationGridMap2D.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]
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.

Parameters:
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.
Returns:
The matching ratio [0,1]
See also:
computeMatchingWith2D

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.

Parameters:
takenFromThe robot's pose the observation is supposed to be taken from.
obsThe observation.
Returns:
This method returns a likelihood in the range [0,1].
See also:
Used in particle filter algorithms, see: CMultiMetricMapPDF::update

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.

Parameters:
normReadingIs a [0,1] normalized concentration reading.
sensorPoseIs 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.

Parameters:
normReadingIs a [0,1] normalized concentration reading.
sensorPoseIs 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.

Parameters:
normReadingIs a [0,1] normalized concentration reading.
sensorPoseIs 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.

Parameters:
obsThe observation
robotPoseThe 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use CPose2D(0,0,deg)
See also:
CObservation::insertObservationInto

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.

See also:
m_hasToRecoverMeanAndCov
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.

See also:
setSize
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 $ \sum{\frac{wR}{w}} $ 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.


Member Data Documentation

Definition at line 106 of file CGasConcentrationGridMap2D.h.

Definition at line 106 of file CGasConcentrationGridMap2D.h.

Definition at line 106 of file CGasConcentrationGridMap2D.h.

[useMOSmodel] Decimate value for oversampled enose readings

Definition at line 318 of file CGasConcentrationGridMap2D.h.

Definition at line 323 of file CGasConcentrationGridMap2D.h.

[useMOSmodel] To force e-nose samples to have fixed time increments

Definition at line 322 of file CGasConcentrationGridMap2D.h.

Definition at line 310 of file CGasConcentrationGridMap2D.h.

Definition at line 343 of file CGasConcentrationGridMap2D.h.

Definition at line 342 of file CGasConcentrationGridMap2D.h.

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.

[useMOSmodel] Ofstream to save to file option "save_maplog"

Definition at line 314 of file CGasConcentrationGridMap2D.h.

Definition at line 341 of file CGasConcentrationGridMap2D.h.

Definition at line 340 of file CGasConcentrationGridMap2D.h.

Only for the KF2 implementation.

Definition at line 336 of file CGasConcentrationGridMap2D.h.

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.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:30:30 UTC 2011