CRandomFieldGridMap2D represents a 2D grid map where each cell is associated one real-valued property which is estimated by this map, either as a simple value or as a probility distribution (for each cell).
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:
Note that this class is virtual, since derived classes still have to implement:
#include <mrpt/slam/CRandomFieldGridMap2D.h>

Classes | |
| struct | TInsertionOptionsCommon |
| Parameters common to any derived class. 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 TRandomFieldCell &c) const |
| CRandomFieldGridMap2D (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 | ~CRandomFieldGridMap2D () |
| Destructor. | |
| virtual bool | isEmpty () const |
| Returns true if the map is empty/no observation has been inserted (in this class it always return false, unless redefined otherwise in base classes) | |
| virtual void | saveAsBitmapFile (const std::string &filName) const |
| Save the current map as a graphical file (BMP,PNG,...). | |
| virtual void | getAsBitmapFile (mrpt::utils::CImage &out_img) const |
| Returns an image just as described in saveAsBitmapFile. | |
| virtual void | resize (float new_x_min, float new_x_max, float new_y_min, float new_y_max, const TRandomFieldCell &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. | |
| virtual void | saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const |
| The implementation in this class just calls all the corresponding method of the contained metric maps. | |
| virtual 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 | getAsMatlab3DGraphScript (std::string &out_script) const |
| Return a large text block with a MATLAB script to plot the contents of this map. | |
| virtual void | getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const |
| Returns a 3D object representing the map. | |
| TMapRepresentation | getMapType () |
| Return the type of the random-field grid map, according to parameters passed on construction. | |
| virtual 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). | |
Protected Member Functions | |
| virtual CRandomFieldGridMap2D::TInsertionOptionsCommon * | getCommonInsertOptions ()=0 |
| Get the part of the options common to all CRandomFieldGridMap2D classes. | |
| 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. | |
| double | computeMeanCellValue_DM_DMV (const TRandomFieldCell *cell) const |
| Computes the average cell concentration, or the overall average value if it has never been observed. | |
| double | computeVarCellValue_DM_DMV (const TRandomFieldCell *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. | |
Protected Attributes | |
| TInsertionOptionsCommon * | m_insertOptions_common |
| Common options to all random-field grid maps: pointer that is set to the derived-class instance of "insertOptions" upon construction of this class. | |
| 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 < TRandomFieldCell > | BASE |
RTTI stuff | |
| static const mrpt::utils::TRuntimeClassId | classCRandomFieldGridMap2D |
| class | mrpt::utils::CStream |
| static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
| virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
| Returns information about the class of an object in runtime. | |
typedef utils::CDynamicGrid<TRandomFieldCell> mrpt::slam::CRandomFieldGridMap2D::BASE [private] |
Definition at line 114 of file CRandomFieldGridMap2D.h.
The type of map representation to be used.
Definition at line 133 of file CRandomFieldGridMap2D.h.
| mrpt::slam::CRandomFieldGridMap2D::CRandomFieldGridMap2D | ( | 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::CRandomFieldGridMap2D::~CRandomFieldGridMap2D | ( | ) | [virtual] |
Destructor.
| static const mrpt::utils::TRuntimeClassId* mrpt::slam::CRandomFieldGridMap2D::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::slam::CMetricMap.
Reimplemented in mrpt::slam::CWirelessPowerGridMap2D, and mrpt::slam::CGasConcentrationGridMap2D.
| float mrpt::slam::CRandomFieldGridMap2D::cell2float | ( | const TRandomFieldCell & | c | ) | const [inline] |
Definition at line 126 of file CRandomFieldGridMap2D.h.
References mrpt::slam::TRandomFieldCell::kf_mean.
| void mrpt::slam::CRandomFieldGridMap2D::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 123 of file CRandomFieldGridMap2D.h.
| float mrpt::slam::CRandomFieldGridMap2D::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::CRandomFieldGridMap2D::computeMeanCellValue_DM_DMV | ( | const TRandomFieldCell * | cell | ) | const [protected] |
Computes the average cell concentration, or the overall average value if it has never been observed.
| double mrpt::slam::CRandomFieldGridMap2D::computeVarCellValue_DM_DMV | ( | const TRandomFieldCell * | cell | ) | const [protected] |
Computes the estimated variance of the cell concentration, or the overall average variance if it has never been observed.
| virtual void mrpt::slam::CRandomFieldGridMap2D::getAs3DObject | ( | mrpt::opengl::CSetOfObjectsPtr & | outObj | ) | const [virtual] |
Returns a 3D object representing the map.
Implements mrpt::slam::CMetricMap.
Reimplemented in mrpt::slam::CGasConcentrationGridMap2D, and mrpt::slam::CWirelessPowerGridMap2D.
| virtual void mrpt::slam::CRandomFieldGridMap2D::getAsBitmapFile | ( | mrpt::utils::CImage & | out_img | ) | const [virtual] |
Returns an image just as described in saveAsBitmapFile.
Reimplemented in mrpt::slam::CGasConcentrationGridMap2D, and mrpt::slam::CWirelessPowerGridMap2D.
| void mrpt::slam::CRandomFieldGridMap2D::getAsMatlab3DGraphScript | ( | std::string & | out_script | ) | const |
Return a large text block with a MATLAB script to plot the contents of this map.
| virtual CRandomFieldGridMap2D::TInsertionOptionsCommon* mrpt::slam::CRandomFieldGridMap2D::getCommonInsertOptions | ( | ) | [protected, pure virtual] |
Get the part of the options common to all CRandomFieldGridMap2D classes.
Implemented in mrpt::slam::CGasConcentrationGridMap2D, and mrpt::slam::CWirelessPowerGridMap2D.
| TMapRepresentation mrpt::slam::CRandomFieldGridMap2D::getMapType | ( | ) |
Return the type of the random-field grid map, according to parameters passed on construction.
| void mrpt::slam::CRandomFieldGridMap2D::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::CRandomFieldGridMap2D::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::slam::CMetricMap.
Reimplemented in mrpt::slam::CWirelessPowerGridMap2D, and mrpt::slam::CGasConcentrationGridMap2D.
| void mrpt::slam::CRandomFieldGridMap2D::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::CRandomFieldGridMap2D::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::CRandomFieldGridMap2D::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::CRandomFieldGridMap2D::internal_clear | ( | ) | [protected, virtual] |
Erase all the contents of the map.
Implements mrpt::slam::CMetricMap.
Reimplemented in mrpt::slam::CGasConcentrationGridMap2D, and mrpt::slam::CWirelessPowerGridMap2D.
| virtual bool mrpt::slam::CRandomFieldGridMap2D::isEmpty | ( | ) | const [virtual] |
Returns true if the map is empty/no observation has been inserted (in this class it always return false, unless redefined otherwise in base classes)
Implements mrpt::slam::CMetricMap.
| virtual void mrpt::slam::CRandomFieldGridMap2D::predictMeasurement | ( | const double & | x, |
| const double & | y, | ||
| double & | out_predict_response, | ||
| double & | out_predict_response_variance | ||
| ) | [virtual] |
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::CRandomFieldGridMap2D::recoverMeanAndCov | ( | ) | const [protected] |
In the KF2 implementation, takes the auxiliary matrices and from them update the cells' mean and std values.
| virtual void mrpt::slam::CRandomFieldGridMap2D::resize | ( | float | new_x_min, |
| float | new_x_max, | ||
| float | new_y_min, | ||
| float | new_y_max, | ||
| const TRandomFieldCell & | defaultValueNewCells, | ||
| float | additionalMarginMeters = 1.0f |
||
| ) | [virtual] |
Changes the size of the grid, maintaining previous contents.
| virtual void mrpt::slam::CRandomFieldGridMap2D::saveAsBitmapFile | ( | const std::string & | filName | ) | const [virtual] |
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.
| virtual void mrpt::slam::CRandomFieldGridMap2D::saveAsMatlab3DGraph | ( | const std::string & | filName | ) | const [virtual] |
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.
Reimplemented in mrpt::slam::CGasConcentrationGridMap2D, and mrpt::slam::CWirelessPowerGridMap2D.
| virtual void mrpt::slam::CRandomFieldGridMap2D::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.
Reimplemented in mrpt::slam::CGasConcentrationGridMap2D, and mrpt::slam::CWirelessPowerGridMap2D.
friend class mrpt::utils::CStream [friend] |
Reimplemented from mrpt::slam::CMetricMap.
Definition at line 117 of file CRandomFieldGridMap2D.h.
const mrpt::utils::TRuntimeClassId mrpt::slam::CRandomFieldGridMap2D::classCRandomFieldGridMap2D [static] |
Definition at line 117 of file CRandomFieldGridMap2D.h.
size_t mrpt::slam::CRandomFieldGridMap2D::m_average_normreadings_count [protected] |
Definition at line 298 of file CRandomFieldGridMap2D.h.
double mrpt::slam::CRandomFieldGridMap2D::m_average_normreadings_mean [protected] |
Definition at line 297 of file CRandomFieldGridMap2D.h.
double mrpt::slam::CRandomFieldGridMap2D::m_average_normreadings_var [protected] |
Definition at line 297 of file CRandomFieldGridMap2D.h.
CMatrixD mrpt::slam::CRandomFieldGridMap2D::m_cov [protected] |
The whole covariance matrix, used for the Kalman Filter map representation.
Definition at line 284 of file CRandomFieldGridMap2D.h.
std::vector<float> mrpt::slam::CRandomFieldGridMap2D::m_DM_gaussWindow [protected] |
Definition at line 296 of file CRandomFieldGridMap2D.h.
float mrpt::slam::CRandomFieldGridMap2D::m_DM_lastCutOff [protected] |
Definition at line 295 of file CRandomFieldGridMap2D.h.
bool mrpt::slam::CRandomFieldGridMap2D::m_hasToRecoverMeanAndCov [mutable, protected] |
Only for the KF2 implementation.
Definition at line 291 of file CRandomFieldGridMap2D.h.
Common options to all random-field grid maps: pointer that is set to the derived-class instance of "insertOptions" upon construction of this class.
Definition at line 276 of file CRandomFieldGridMap2D.h.
The map representation type of this map, as passed in the constructor.
Definition at line 282 of file CRandomFieldGridMap2D.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 290 of file CRandomFieldGridMap2D.h.
| Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Sun Oct 16 12:16:33 UTC 2011 |