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 MRF grid-map, depending on the value of TMapRepresentation maptype
passed in the constructor.
The following papers describe the mapping alternatives implemented here:
mrKernelDM
: A Gaussian kernel-based method. See:mrKernelDMV
: A kernel-based method. See:mrKalmanFilter
: A "brute-force" approach to estimate the entire map with a dense (linear) Kalman filter. Will be very slow for mid or large maps. It's provided just for comparison purposes, not useful in practice.mrKalmanApproximate
: A compressed/sparse Kalman filter approach. See:mrGMRF_G
and mrGMRF_SD
: A Gaussian Markov Random Field (GMRF) estimator, with these constraints:mrGMRF_G
: Each cell connected to a square area of neighbors cells.mrGMRF_SD
: Each cell only connected to its 4 immediate neighbors (Up, down, left, right).Note that this class is virtual, since derived classes still have to implement:
Definition at line 113 of file maps/CRandomFieldGridMap2D.h.
#include <mrpt/maps/CRandomFieldGridMap2D.h>
Classes | |
struct | TInsertionOptionsCommon |
Parameters common to any derived class. More... | |
struct | TobservationGMRF |
Public Types | |
enum | TMapRepresentation { mrKernelDM = 0 , mrAchim = 0 , mrKalmanFilter , mrKalmanApproximate , mrKernelDMV , mrGMRF_G , mrGMRF_SD } |
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion. More... | |
enum | TGridInterpolationMethod { gimNearest = 0 , gimBilinear } |
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 MRPT_OVERRIDE |
CRandomFieldGridMap2D (TMapRepresentation mapType=mrKernelDM, double x_min=-2, double x_max=2, double y_min=-2, double y_max=2, double resolution=0.1) | |
Constructor. | |
virtual | ~CRandomFieldGridMap2D () |
Destructor. | |
virtual bool | isEmpty () const MRPT_OVERRIDE |
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 | getAsMatrix (mrpt::math::CMatrixDouble &out_mat) const |
Like saveAsBitmapFile(), but returns the data in matrix form (first row in the matrix is the upper (y_max) part of the map) | |
virtual void | resize (double new_x_min, double new_x_max, double new_y_min, double new_y_max, const TRandomFieldCell &defaultValueNewCells, double additionalMarginMeters=1.0f) MRPT_OVERRIDE |
Changes the size of the grid, maintaining previous contents. | |
virtual void | setSize (const double x_min, const double x_max, const double y_min, const double y_max, const double resolution, const TRandomFieldCell *fill_value=NULL) |
Changes the size of the grid, erasing previous contents. | |
float | compute3DMatchingRatio (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const MRPT_OVERRIDE |
See docs in base class: in this class this always returns 0. | |
virtual void | saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const MRPT_OVERRIDE |
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 MRPT_OVERRIDE |
Returns a 3D object representing the map (mean) | |
virtual void | getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &meanObj, mrpt::opengl::CSetOfObjectsPtr &varObj) const |
Returns two 3D objects representing the mean and variance maps. | |
TMapRepresentation | getMapType () |
Return the type of the random-field grid map, according to parameters passed on construction. | |
void | insertIndividualReading (const double sensorReading, const mrpt::math::TPoint2D &point, const bool update_map=true, const bool time_invariant=true) |
Direct update of the map with a reading in a given position of the map, using the appropriate method according to mapType passed in the constructor. | |
virtual void | predictMeasurement (const double x, const double y, double &out_predict_response, double &out_predict_response_variance, bool do_sensor_normalization, const TGridInterpolationMethod interp_method=gimNearest) |
Returns the prediction of the measurement at some (x,y) coordinates, and its certainty (in the form of the expected variance). | |
void | getMeanAndCov (mrpt::math::CVectorDouble &out_means, mrpt::math::CMatrixDouble &out_cov) const |
Return the mean and covariance vector of the full Kalman filter estimate (works for all KF-based methods). | |
void | getMeanAndSTD (mrpt::math::CVectorDouble &out_means, mrpt::math::CVectorDouble &out_STD) const |
Return the mean and STD vectors of the full Kalman filter estimate (works for all KF-based methods). | |
void | setMeanAndSTD (mrpt::math::CVectorDouble &out_means, mrpt::math::CVectorDouble &out_STD) |
Load the mean and STD vectors of the full Kalman filter estimate (works for all KF-based methods). | |
void | updateMapEstimation () |
Run the method-specific procedure required to ensure that the mean & variances are up-to-date with all inserted observations. | |
void | enableVerbose (bool enable_verbose) |
bool | isEnabledVerbose () const |
void | loadFromProbabilisticPosesAndObservations (const mrpt::maps::CSimpleMap &Map) |
Load the map contents from a CSimpleMap object, erasing all previous content of the map. | |
void | loadFromSimpleMap (const mrpt::maps::CSimpleMap &Map) |
Load the map contents from a CSimpleMap object, erasing all previous content of the map. | |
bool | insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) |
Insert the observation information into this map. | |
bool | insertObservationPtr (const mrpt::obs::CObservationPtr &obs, const mrpt::poses::CPose3D *robotPose=NULL) |
A wrapper for smart pointers, just calls the non-smart pointer version. | |
double | computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) |
Computes the log-likelihood of a given observation given an arbitrary robot 3D pose. | |
double | computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
virtual bool | canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. | |
bool | canComputeObservationLikelihood (const mrpt::obs::CObservationPtr &obs) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
double | computeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf, const mrpt::poses::CPose2D &takenFrom) |
Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame. | |
bool | canComputeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf) |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. | |
virtual void | determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams ¶ms, TMatchingExtraResults &extraResults) const |
Computes the matching between this and another 2D point map, which includes finding: | |
virtual void | determineMatching3D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams ¶ms, TMatchingExtraResults &extraResults) const |
Computes the matchings between this and another 3D points map - method used in 3D-ICP. | |
virtual void | auxParticleFilterCleanUp () |
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". | |
virtual float | squareDistanceToClosestCorrespondence (float x0, float y0) const |
Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map. | |
virtual const mrpt::maps::CSimplePointsMap * | getAsSimplePointsMap () const |
If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it. | |
virtual mrpt::maps::CSimplePointsMap * | getAsSimplePointsMap () |
void | setSize (const double x_min, const double x_max, const double y_min, const double y_max, const double resolution, const TRandomFieldCell *fill_value=NULL) |
Changes the size of the grid, ERASING all previous contents. | |
void | fill (const TRandomFieldCell &value) |
Fills all the cells with the same value. | |
virtual void | resize (double new_x_min, double new_x_max, double new_y_min, double new_y_max, const TRandomFieldCell &defaultValueNewCells, double additionalMarginMeters=2.0) |
Changes the size of the grid, maintaining previous contents. | |
TRandomFieldCell * | 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 extensions. | |
const TRandomFieldCell * | cellByPos (double x, double y) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
TRandomFieldCell * | 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 map extensions. | |
const TRandomFieldCell * | cellByIndex (unsigned int cx, unsigned int cy) const |
Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions. | |
size_t | getSizeX () const |
Returns the horizontal size of grid map in cells count. | |
size_t | getSizeY () const |
Returns the vertical size of grid map in cells count. | |
double | getXMin () const |
Returns the "x" coordinate of left side of grid map. | |
double | getXMax () const |
Returns the "x" coordinate of right side of grid map. | |
double | getYMin () const |
Returns the "y" coordinate of top side of grid map. | |
double | getYMax () const |
Returns the "y" coordinate of bottom side of grid map. | |
double | getResolution () const |
Returns the resolution of the grid map. | |
int | x2idx (double x) const |
Transform a coordinate values into cell indexes. | |
int | y2idx (double y) const |
int | xy2idx (double x, double y) const |
void | idx2cxcy (const int &idx, int &cx, int &cy) const |
Transform a global (linear) cell index value into its corresponding (x,y) cell indexes. | |
double | idx2x (int cx) const |
Transform a cell index into a coordinate value of the cell central point. | |
double | idx2y (int cy) const |
void | getAsMatrix (MAT &m) const |
Get the entire grid as a matrix. | |
virtual float | cell2float (const TRandomFieldCell &c) const |
The user must implement this in order to provide "saveToTextFile" a way to convert each cell into a numeric value. | |
bool | saveToTextFile (const std::string &fileName) const |
Saves a float representation of the grid (via "cell2float()") to a text file. | |
Public Attributes | |
TMapGenericParams | genericMapParams |
Common params to all maps. | |
Static Public Attributes | |
static bool | ENABLE_GMRF_PROFILER |
[default:false] Enables a profiler to show a performance report at application end. | |
RTTI stuff <br> | |
static const mrpt::utils::TRuntimeClassId | classCMetricMap |
Protected Member Functions | |
virtual CRandomFieldGridMap2D::TInsertionOptionsCommon * | getCommonInsertOptions ()=0 |
Get the part of the options common to all CRandomFieldGridMap2D classes. | |
void | insertObservation_KernelDM_DMV (double normReading, const mrpt::math::TPoint2D &point, bool is_DMV) |
The implementation of "insertObservation" for Achim Lilienthal's map models DM & DM+V. | |
void | insertObservation_KF (double normReading, const mrpt::math::TPoint2D &point) |
The implementation of "insertObservation" for the (whole) Kalman Filter map model. | |
void | insertObservation_KF2 (double normReading, const mrpt::math::TPoint2D &point) |
The implementation of "insertObservation" for the Efficient Kalman Filter map model. | |
void | insertObservation_GMRF (double normReading, const mrpt::math::TPoint2D &point, const bool update_map, const bool time_invariant) |
The implementation of "insertObservation" for the Gaussian Markov Random Field map model. | |
void | updateMapEstimation_GMRF () |
solves the minimum quadratic system to determine the new concentration of each cell | |
double | computeConfidenceCellValue_DM_DMV (const TRandomFieldCell *cell) const |
Computes the confidence of the cell concentration (alpha) | |
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 () MRPT_OVERRIDE |
Erase all the contents of the map. | |
bool | exist_relation_between2cells (const mrpt::maps::COccupancyGridMap2D *m_Ocgridmap, size_t cxo_min, size_t cxo_max, size_t cyo_min, size_t cyo_max, const size_t seed_cxo, const size_t seed_cyo, const size_t objective_cxo, const size_t objective_cyo) |
Check if two cells of the gridmap (m_map) are connected, based on the provided occupancy gridmap. | |
void | publishEvent (const mrptEvent &e) const |
Called when you want this object to emit an event to all the observers currently subscribed to this object. | |
bool | hasSubscribers () const |
Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read. | |
std::vector< TRandomFieldCell > & | m_map_castaway_const () const |
Used only from logically const method that really need to modify the object. | |
void | dyngridcommon_writeToStream (mrpt::utils::CStream &out) const |
void | dyngridcommon_readFromStream (mrpt::utils::CStream &in, bool cast_from_float=false) |
Protected Attributes | |
bool | m_rfgm_verbose |
Enable verbose debug output for Random Field grid map operations (Default: false) | |
bool | m_rfgm_run_update_upon_clear |
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. | |
mrpt::math::CMatrixD | m_cov |
The whole covariance matrix, used for the Kalman Filter map representation. | |
mrpt::math::CMatrixD | m_stackedCov |
The compressed band diagonal matrix for the KF2 implementation. | |
bool | m_hasToRecoverMeanAndCov |
Only for the KF2 implementation. | |
std::vector< TRandomFieldCell > | m_map |
The cells. | |
double | m_x_min |
double | m_x_max |
double | m_y_min |
double | m_y_max |
double | m_resolution |
size_t | m_size_x |
size_t | m_size_y |
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 |
Auxiliary vars for GMRF method | |
Eigen::VectorXd | g |
size_t | nPriorFactors |
size_t | nObsFactors |
size_t | nFactors |
std::multimap< size_t, size_t > | cell_interconnections |
std::vector< float > | gauss_val |
std::vector< std::vector< TobservationGMRF > > | activeObs |
Private Types | |
typedef utils::CDynamicGrid< TRandomFieldCell > | BASE |
Private Member Functions | |
virtual bool | internal_insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL)=0 |
Internal method called by insertObservation() | |
virtual double | internal_computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom)=0 |
Internal method called by computeObservationLikelihood() | |
virtual bool | internal_canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) |
Internal method called by canComputeObservationLikelihood() | |
virtual void | OnPostSuccesfulInsertObs (const mrpt::obs::CObservation *) |
Hook for each time a "internal_insertObservation" returns "true" This is called automatically from insertObservation() when internal_insertObservation returns true. | |
void | internal_observer_begin (CObserver *) |
void | internal_observer_end (CObserver *) |
Private Attributes | |
std::set< CObserver * > | m_subscribers |
RTTI stuff <br> | |
static const mrpt::utils::TRuntimeClassId | classCRandomFieldGridMap2D |
class | mrpt::utils::CStream |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const MRPT_OVERRIDE |
|
private |
Definition at line 115 of file maps/CRandomFieldGridMap2D.h.
Enumerator | |
---|---|
gimNearest | |
gimBilinear |
Definition at line 272 of file maps/CRandomFieldGridMap2D.h.
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion.
Enumerator | |
---|---|
mrKernelDM | Gaussian kernel-based estimator (see discussion in mrpt::maps::CRandomFieldGridMap2D) |
mrAchim | Another alias for "mrKernelDM", for backwards compatibility (see discussion in mrpt::maps::CRandomFieldGridMap2D) |
mrKalmanFilter | "Brute-force" Kalman filter (see discussion in mrpt::maps::CRandomFieldGridMap2D) |
mrKalmanApproximate | (see discussion in mrpt::maps::CRandomFieldGridMap2D) |
mrKernelDMV | Double mean + variance Gaussian kernel-based estimator (see discussion in mrpt::maps::CRandomFieldGridMap2D) |
mrGMRF_G | Gaussian Markov Random Field, Gaussian prior weights between neighboring cells up to a certain distance (see discussion in mrpt::maps::CRandomFieldGridMap2D) |
mrGMRF_SD | Gaussian Markov Random Field, squared differences prior weights between 4 neighboring cells (see discussion in mrpt::maps::CRandomFieldGridMap2D) |
Definition at line 135 of file maps/CRandomFieldGridMap2D.h.
mrpt::maps::CRandomFieldGridMap2D::CRandomFieldGridMap2D | ( | TMapRepresentation | mapType = mrKernelDM , |
double | x_min = -2 , |
||
double | x_max = 2 , |
||
double | y_min = -2 , |
||
double | y_max = 2 , |
||
double | resolution = 0.1 |
||
) |
Constructor.
|
virtual |
Destructor.
|
staticprotected |
|
inlinevirtualinherited |
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.
Reimplemented in mrpt::maps::CMultiMetricMap, and mrpt::maps::CLandmarksMap.
Definition at line 235 of file maps/CMetricMap.h.
|
virtualinherited |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
an occupancy grid map cannot with an image).
obs | The observation. |
|
inherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inherited |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
an occupancy grid map cannot with an image).
sf | The observations. |
|
inlinevirtualinherited |
The user must implement this in order to provide "saveToTextFile" a way to convert each cell into a numeric value.
Definition at line 274 of file CDynamicGrid.h.
|
inline |
Definition at line 128 of file maps/CRandomFieldGridMap2D.h.
|
inlineinherited |
Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions.
Definition at line 203 of file CDynamicGrid.h.
|
inlineinherited |
Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions.
Definition at line 212 of file CDynamicGrid.h.
|
inlineinherited |
Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map extensions.
Definition at line 183 of file CDynamicGrid.h.
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 192 of file CDynamicGrid.h.
|
inline |
Calls the base CMetricMap::clear Declared here to avoid ambiguity between the two clear() in both base classes.
Definition at line 125 of file maps/CRandomFieldGridMap2D.h.
References mrpt::maps::CMetricMap::clear().
|
virtual |
See docs in base class: in this class this always returns 0.
Reimplemented from mrpt::maps::CMetricMap.
|
protected |
Computes the confidence of the cell concentration (alpha)
|
protected |
Computes the average cell concentration, or the overall average value if it has never been observed
|
inherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inherited |
Computes the log-likelihood of a given observation given an arbitrary robot 3D pose.
takenFrom | The robot's pose the observation is supposed to be taken from. |
obs | The observation. |
|
inherited |
Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame.
takenFrom | The robot's pose the observation is supposed to be taken from. |
sf | The set of observations in a CSensoryFrame. |
|
protected |
Computes the estimated variance of the cell concentration, or the overall average variance if it has never been observed
|
virtualinherited |
Computes the matching between this and another 2D point map, which includes finding:
The algorithm is:
This method is the most time critical one into ICP-like algorithms.
otherMap | [IN] The other map to compute the matching with. |
otherMapPose | [IN] The pose of the other map as seen from "this". |
params | [IN] Parameters for the determination of pairings. |
correspondences | [OUT] The detected matchings pairs. |
extraResults | [OUT] Other results. |
Reimplemented in mrpt::maps::CMultiMetricMap, mrpt::maps::CBeaconMap, mrpt::maps::COccupancyGridMap2D, and mrpt::maps::CPointsMap.
|
virtualinherited |
Computes the matchings between this and another 3D points map - method used in 3D-ICP.
This method finds the set of point pairs in each map.
The method is the most time critical one into ICP-like algorithms.
The algorithm is:
otherMap | [IN] The other map to compute the matching with. |
otherMapPose | [IN] The pose of the other map as seen from "this". |
params | [IN] Parameters for the determination of pairings. |
correspondences | [OUT] The detected matchings pairs. |
extraResults | [OUT] Other results. |
Reimplemented in mrpt::maps::CPointsMap.
|
inlineprotectedinherited |
Definition at line 300 of file CDynamicGrid.h.
|
inlineprotectedinherited |
Definition at line 295 of file CDynamicGrid.h.
|
inline |
Definition at line 298 of file maps/CRandomFieldGridMap2D.h.
References m_rfgm_verbose.
|
protected |
Check if two cells of the gridmap (m_map) are connected, based on the provided occupancy gridmap.
|
inlineinherited |
Fills all the cells with the same value.
Definition at line 101 of file CDynamicGrid.h.
|
virtual |
Returns two 3D objects representing the mean and variance maps.
Reimplemented in mrpt::maps::CGasConcentrationGridMap2D, and mrpt::maps::CHeightGridMap2D_MRF.
|
virtual |
Returns a 3D object representing the map (mean)
Implements mrpt::maps::CMetricMap.
Reimplemented in mrpt::maps::CGasConcentrationGridMap2D, mrpt::maps::CHeightGridMap2D_MRF, and mrpt::maps::CWirelessPowerGridMap2D.
|
virtual |
Returns an image just as described in saveAsBitmapFile.
void mrpt::maps::CRandomFieldGridMap2D::getAsMatlab3DGraphScript | ( | std::string & | out_script | ) | const |
Return a large text block with a MATLAB script to plot the contents of this map.
|
inlineinherited |
Get the entire grid as a matrix.
MAT | The type of the matrix, typically a mrpt::math::CMatrixDouble. |
[out] | m | The output matrix; will be set automatically to the correct size. Entry (cy,cx) in the matrix contains the grid cell with indices (cx,cy). |
Definition at line 263 of file CDynamicGrid.h.
|
virtual |
Like saveAsBitmapFile(), but returns the data in matrix form (first row in the matrix is the upper (y_max) part of the map)
|
inlinevirtualinherited |
Reimplemented in mrpt::maps::CMultiMetricMap, mrpt::maps::CPointsMap, and mrpt::maps::CSimplePointsMap.
Definition at line 244 of file maps/CMetricMap.h.
|
inlinevirtualinherited |
If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it.
Otherwise, return NULL
Reimplemented in mrpt::maps::CMultiMetricMap, mrpt::maps::CPointsMap, and mrpt::maps::CSimplePointsMap.
Definition at line 243 of file maps/CMetricMap.h.
|
protectedpure virtual |
Get the part of the options common to all CRandomFieldGridMap2D classes.
Implemented in mrpt::maps::CGasConcentrationGridMap2D, mrpt::maps::CHeightGridMap2D_MRF, and mrpt::maps::CWirelessPowerGridMap2D.
TMapRepresentation mrpt::maps::CRandomFieldGridMap2D::getMapType | ( | ) |
Return the type of the random-field grid map, according to parameters passed on construction.
void mrpt::maps::CRandomFieldGridMap2D::getMeanAndCov | ( | mrpt::math::CVectorDouble & | out_means, |
mrpt::math::CMatrixDouble & | out_cov | ||
) | const |
Return the mean and covariance vector of the full Kalman filter estimate (works for all KF-based methods).
void mrpt::maps::CRandomFieldGridMap2D::getMeanAndSTD | ( | mrpt::math::CVectorDouble & | out_means, |
mrpt::math::CVectorDouble & | out_STD | ||
) | const |
Return the mean and STD vectors of the full Kalman filter estimate (works for all KF-based methods).
|
inlineinherited |
Returns the resolution of the grid map.
Definition at line 238 of file CDynamicGrid.h.
|
virtual |
Reimplemented from mrpt::maps::CMetricMap.
Reimplemented in mrpt::maps::CGasConcentrationGridMap2D, mrpt::maps::CHeightGridMap2D_MRF, and mrpt::maps::CWirelessPowerGridMap2D.
|
inlineinherited |
Returns the horizontal size of grid map in cells count.
Definition at line 220 of file CDynamicGrid.h.
|
inlineinherited |
Returns the vertical size of grid map in cells count.
Definition at line 223 of file CDynamicGrid.h.
|
inlineinherited |
Returns the "x" coordinate of right side of grid map.
Definition at line 229 of file CDynamicGrid.h.
|
inlineinherited |
Returns the "x" coordinate of left side of grid map.
Definition at line 226 of file CDynamicGrid.h.
|
inlineinherited |
Returns the "y" coordinate of bottom side of grid map.
Definition at line 235 of file CDynamicGrid.h.
|
inlineinherited |
Returns the "y" coordinate of top side of grid map.
Definition at line 232 of file CDynamicGrid.h.
|
inlineprotectedinherited |
Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.
Definition at line 52 of file CObservable.h.
|
inlineinherited |
Transform a global (linear) cell index value into its corresponding (x,y) cell indexes.
Definition at line 246 of file CDynamicGrid.h.
|
inlineinherited |
Transform a cell index into a coordinate value of the cell central point.
Definition at line 253 of file CDynamicGrid.h.
|
inlineinherited |
Definition at line 254 of file CDynamicGrid.h.
void mrpt::maps::CRandomFieldGridMap2D::insertIndividualReading | ( | const double | sensorReading, |
const mrpt::math::TPoint2D & | point, | ||
const bool | update_map = true , |
||
const bool | time_invariant = true |
||
) |
Direct update of the map with a reading in a given position of the map, using the appropriate method according to mapType passed in the constructor.
This is a direct way to update the map, an alternative to the generic insertObservation() method which works with mrpt::obs::CObservation objects.
[in] | sensorReading | The value observed in the (x,y) position |
[in] | point | The (x,y) location |
[in] | update_map | Run a global map update after inserting this observatin (algorithm-dependant) |
[in] | time_invariant | Whether the observation "vanishes" with time (false) or not (true) [Only for GMRF methods] |
|
inherited |
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 the origin. |
|
protected |
The implementation of "insertObservation" for the Gaussian Markov Random Field map model.
normReading | Is a [0,1] normalized concentration reading. |
point | Is the sensor location on the map |
|
protected |
The implementation of "insertObservation" for Achim Lilienthal's map models DM & DM+V.
normReading | Is a [0,1] normalized concentration reading. |
point | Is the sensor location on the map |
is_DMV | = false -> map type is Kernel DM; true -> map type is DM+V |
|
protected |
The implementation of "insertObservation" for the (whole) Kalman Filter map model.
normReading | Is a [0,1] normalized concentration reading. |
point | Is the sensor location on the map |
|
protected |
The implementation of "insertObservation" for the Efficient Kalman Filter map model.
normReading | Is a [0,1] normalized concentration reading. |
point | Is the sensor location on the map |
|
inherited |
A wrapper for smart pointers, just calls the non-smart pointer version.
|
inlineprivatevirtualinherited |
Internal method called by canComputeObservationLikelihood()
Reimplemented in mrpt::maps::CMultiMetricMap, and mrpt::maps::COccupancyGridMap2D.
Definition at line 71 of file maps/CMetricMap.h.
References MRPT_UNUSED_PARAM.
|
protectedvirtual |
Erase all the contents of the map.
Implements mrpt::maps::CMetricMap.
Reimplemented in mrpt::maps::CGasConcentrationGridMap2D, mrpt::maps::CHeightGridMap2D_MRF, and mrpt::maps::CWirelessPowerGridMap2D.
|
privatepure virtualinherited |
Internal method called by computeObservationLikelihood()
Implemented in mrpt::maps::CMultiMetricMap, mrpt::maps::CBeaconMap, mrpt::maps::CGasConcentrationGridMap2D, mrpt::maps::CHeightGridMap2D, mrpt::maps::CHeightGridMap2D_MRF, mrpt::maps::COccupancyGridMap2D, mrpt::maps::COctoMapBase< OCTREE, OCTREE_NODE >, mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >, mrpt::maps::COctoMapBase< octomap::OcTree, octomap::OcTreeNode >, mrpt::maps::CPointsMap, mrpt::maps::CReflectivityGridMap2D, mrpt::maps::CWirelessPowerGridMap2D, and mrpt::maps::CLandmarksMap.
|
privatepure virtualinherited |
Internal method called by insertObservation()
Implemented in mrpt::maps::CColouredOctoMap, mrpt::maps::COctoMap, mrpt::maps::CPointsMap, mrpt::maps::CBeaconMap, mrpt::maps::CGasConcentrationGridMap2D, mrpt::maps::CHeightGridMap2D, mrpt::maps::CHeightGridMap2D_MRF, mrpt::maps::COccupancyGridMap2D, mrpt::maps::CReflectivityGridMap2D, mrpt::maps::CWirelessPowerGridMap2D, mrpt::maps::CMultiMetricMap, and mrpt::maps::CLandmarksMap.
|
privateinherited |
|
privateinherited |
|
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::maps::CMetricMap.
|
inline |
Definition at line 299 of file maps/CRandomFieldGridMap2D.h.
References m_rfgm_verbose.
|
inherited |
Load the map contents from a CSimpleMap object, erasing all previous content of the map.
This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.
std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
|
inlineinherited |
Load the map contents from a CSimpleMap object, erasing all previous content of the map.
This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.
std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
Definition at line 105 of file maps/CMetricMap.h.
|
inlineprotectedinherited |
Used only from logically const method that really need to modify the object.
Definition at line 45 of file CDynamicGrid.h.
|
inlineprivatevirtualinherited |
Hook for each time a "internal_insertObservation" returns "true" This is called automatically from insertObservation() when internal_insertObservation returns true.
Reimplemented in mrpt::maps::COccupancyGridMap2D.
Definition at line 79 of file maps/CMetricMap.h.
|
virtual |
Returns the prediction of the measurement at some (x,y) coordinates, and its certainty (in the form of the expected variance).
[in] | x | Query X coordinate |
[in] | y | Query Y coordinate |
[out] | out_predict_response | The output value |
[out] | out_predict_response_variance | The output variance |
[in] | do_sensor_normalization | Whether to renormalize the prediction to a predefined interval (R values in insertionOptions) |
[in] | interp_method | Interpolation method |
|
protectedinherited |
Called when you want this object to emit an event to all the observers currently subscribed to this object.
|
protected |
In the KF2 implementation, takes the auxiliary matrices and from them update the cells' mean and std values.
|
virtual |
Changes the size of the grid, maintaining previous contents.
|
inlinevirtualinherited |
Changes the size of the grid, maintaining previous contents.
Definition at line 109 of file CDynamicGrid.h.
|
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
|
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.
|
virtual |
The implementation in this class just calls all the corresponding method of the contained metric maps.
Implements mrpt::maps::CMetricMap.
|
inlineinherited |
Saves a float representation of the grid (via "cell2float()") to a text file.
Definition at line 280 of file CDynamicGrid.h.
void mrpt::maps::CRandomFieldGridMap2D::setMeanAndSTD | ( | mrpt::math::CVectorDouble & | out_means, |
mrpt::math::CVectorDouble & | out_STD | ||
) |
Load the mean and STD vectors of the full Kalman filter estimate (works for all KF-based methods).
|
inlineinherited |
Changes the size of the grid, ERASING all previous contents.
If fill_value is left as NULL, the contents of cells may be undefined (some will remain with their old values, the new ones will have the default cell value, but the location of old values may change wrt their old places). If fill_value is not NULL, it is assured that all cells will have a copy of that value after resizing.
Definition at line 69 of file CDynamicGrid.h.
|
virtual |
Changes the size of the grid, erasing previous contents.
|
virtualinherited |
Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.
Reimplemented in mrpt::maps::CPointsMap.
void mrpt::maps::CRandomFieldGridMap2D::updateMapEstimation | ( | ) |
Run the method-specific procedure required to ensure that the mean & variances are up-to-date with all inserted observations.
|
protected |
solves the minimum quadratic system to determine the new concentration of each cell
|
inlineinherited |
Transform a coordinate values into cell indexes.
Definition at line 241 of file CDynamicGrid.h.
|
inlineinherited |
Definition at line 243 of file CDynamicGrid.h.
|
inlineinherited |
Definition at line 242 of file CDynamicGrid.h.
|
friend |
Definition at line 118 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Definition at line 350 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Definition at line 339 of file maps/CRandomFieldGridMap2D.h.
|
staticinherited |
Definition at line 57 of file maps/CMetricMap.h.
|
static |
Definition at line 118 of file maps/CRandomFieldGridMap2D.h.
|
static |
[default:false] Enables a profiler to show a performance report at application end.
Definition at line 120 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Definition at line 335 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Definition at line 341 of file maps/CRandomFieldGridMap2D.h.
|
inherited |
Common params to all maps.
Definition at line 230 of file maps/CMetricMap.h.
|
protected |
Definition at line 327 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Definition at line 326 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Definition at line 326 of file maps/CRandomFieldGridMap2D.h.
|
protected |
The whole covariance matrix, used for the Kalman Filter map representation.
Definition at line 313 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Definition at line 325 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Definition at line 324 of file maps/CRandomFieldGridMap2D.h.
|
mutableprotected |
Only for the KF2 implementation.
Definition at line 320 of file maps/CRandomFieldGridMap2D.h.
|
protected |
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 306 of file maps/CRandomFieldGridMap2D.h.
|
protectedinherited |
The cells.
Definition at line 43 of file CDynamicGrid.h.
|
protected |
The map representation type of this map, as passed in the constructor.
Definition at line 311 of file maps/CRandomFieldGridMap2D.h.
|
protectedinherited |
Definition at line 47 of file CDynamicGrid.h.
|
protected |
Definition at line 303 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Enable verbose debug output for Random Field grid map operations (Default: false)
Definition at line 302 of file maps/CRandomFieldGridMap2D.h.
Referenced by enableVerbose(), and isEnabledVerbose().
|
protectedinherited |
Definition at line 48 of file CDynamicGrid.h.
|
protectedinherited |
Definition at line 48 of file CDynamicGrid.h.
|
protected |
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 319 of file maps/CRandomFieldGridMap2D.h.
|
privateinherited |
Definition at line 42 of file CObservable.h.
|
protectedinherited |
Definition at line 47 of file CDynamicGrid.h.
|
protectedinherited |
Definition at line 47 of file CDynamicGrid.h.
|
protectedinherited |
Definition at line 47 of file CDynamicGrid.h.
|
protectedinherited |
Definition at line 47 of file CDynamicGrid.h.
|
protected |
Definition at line 338 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Definition at line 337 of file maps/CRandomFieldGridMap2D.h.
|
protected |
Definition at line 336 of file maps/CRandomFieldGridMap2D.h.
Page generated by Doxygen 1.9.7 for MRPT 1.4.0 SVN: at Tue Jun 13 13:45:58 UTC 2023 |