10 #ifndef CRandomFieldGridMap2D_H
11 #define CRandomFieldGridMap2D_H
24 #if EIGEN_VERSION_AT_LEAST(3,1,0)
26 # include <Eigen/Sparse>
40 #if defined(MRPT_IS_X86_AMD64)
51 kf_mean (kfmean_dm_mean),
52 kf_std (kfstd_dmmeanw),
54 last_updated(
mrpt::system::
now()),
55 updated_std (kfstd_dmmeanw)
86 #if defined(MRPT_IS_X86_AMD64)
151 TMapRepresentation mapType = mrAchim,
156 float resolution = 0.1
165 virtual bool isEmpty()
const;
176 virtual void saveAsBitmapFile(
const std::string &filName)
const;
191 void internal_loadFromConfigFile_common(
193 const std::string §ion);
195 void internal_dumpToTextStream_common(
CStream &out)
const;
235 virtual void resize(
float new_x_min,
240 float additionalMarginMeters = 1.0f );
243 float compute3DMatchingRatio(
246 float maxDistForCorr = 0.10f,
247 float maxMahaDistForCorr = 2.0f
253 virtual void saveMetricMapRepresentationToFile(
254 const std::string &filNamePrefix
261 virtual void saveAsMatlab3DGraph(
const std::string &filName)
const;
266 void getAsMatlab3DGraphScript(std::string &out_script)
const;
270 virtual void getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr &outObj )
const;
274 virtual void getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr &meanObj, mrpt::opengl::CSetOfObjectsPtr &varObj )
const;
290 virtual void predictMeasurement(
293 double &out_predict_response,
294 double &out_predict_response_variance );
334 #if EIGEN_VERSION_AT_LEAST(3,1,0)
335 std::vector<Eigen::Triplet<double> > H_prior;
362 void insertObservation_KernelDM_DMV(
371 void insertObservation_KF(
379 void insertObservation_KF2(
387 void insertObservation_GMRF(
392 void updateMapEstimation_GMRF();
395 double computeConfidenceCellValue_DM_DMV (
const TRandomFieldCell *cell )
const;
406 void recoverMeanAndCov()
const;
409 virtual void internal_clear();
412 bool exist_relation_between2cells(
418 const size_t seed_cxo,
419 const size_t seed_cyo,
420 const size_t objective_cxo,
421 const size_t objective_cyo);
mrpt::system::TTimeStamp last_updated
[Dynamic maps only] The timestamp of the last time the cell was updated
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
The contents of each cell in a CRandomFieldGridMap2D map.
TMapRepresentation
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion.
bool GMRF_use_occupancy_information
wether to use information of an occupancy_gridmap map for buidling the GMRF
void clear()
Erase all the contents of the map.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
slam::CRandomFieldGridMap2D::TMapRepresentation enum_t
This class is a "CSerializable" wrapper for "CMatrixTemplateNumeric".
float KF_initialCellStd
The initial standard deviation of each cell's concentration (will be stored both at each cell's struc...
static void fill(bimap< enum_t, std::string > &m_map)
float GMRF_gridmap_image_res
occupancy_gridmap resolution: size of each pixel (m)
A class for storing images as grayscale or RGB bitmaps.
float KF_defaultCellMeanValue
The default value for the mean of cells' concentration.
uint16_t KF_W_size
[mrKalmanApproximate] The size of the window of neighbor cells.
double dm_sigma_omega
[DM/DM+V methods] The scaling parameter for the confidence "alpha" values (see the IROS 2009 paper; s...
float GMRF_lambdaObs
The initial information (Lambda) of each observation (this information will decrease with time) ...
double updated_std
[Dynamic maps only] The std cell value that was updated (to be used in the Forgetting_curve ...
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
CMatrixD m_cov
The whole covariance matrix, used for the Kalman Filter map representation.
float GMRF_lambdaObsLoss
The loss of information of the observations with each iteration.
float KF_covSigma
The "sigma" for the initial covariance value between cells (in meters).
Only specializations of this class are defined for each enum type of interest.
double kf_mean
[KF-methods only] The mean value of this cell
bool m_hasToRecoverMeanAndCov
Only for the KF2 implementation.
This class allows loading and storing values and vectors of different types from a configuration text...
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
float KF_observationModelNoise
The sensor model noise (in normalized concentration units).
Declares a virtual base class for all metric maps storage classes.
TRandomFieldCell(double kfmean_dm_mean=1e-20, double kfstd_dmmeanw=0)
Constructor.
uint16_t GMRF_constraintsSize
The size of the Gaussian window to impose fixed restrictions between cells.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
double kf_std
[KF-methods only] The standard deviation value of this cell
float GMRF_lambdaPrior
The information (Lambda) of fixed map constraints.
This base provides a set of functions for maths stuff.
A 2D grid of dynamic size which stores any kind of data at each cell.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
size_t GMRF_gridmap_image_cy
Pixel coordinates of the origin for the occupancy_gridmap.
std::string GMRF_simplemap_file
simplemap_file name of the occupancy_gridmap
CRandomFieldGridMap2D represents a 2D grid map where each cell is associated one real-valued property...
double dm_mean_w
[Kernel-methods only] The cumulative weights (concentration = alpha * dm_mean / dm_mean_w + (1-alpha)...
A bidirectional version of std::map, declared as bimap and which actually contains two std...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
std::vector< float > m_DM_gaussWindow
size_t m_average_normreadings_count
double dmv_var_mean
[Kernel DM-V only] The cumulative weighted variance of this cell
double dm_mean
[Kernel-methods only] The cumulative weighted readings of this cell
TMapRepresentation m_mapType
The map representation type of this map, as passed in the constructor.
double gmrf_mean
[GMRF only] The mean value of this cell
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class for storing an occupancy grid map.
Parameters common to any derived class.
std::vector< float > gauss_val
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
float GMRF_constraintsSigma
The sigma of the Gaussian window to impose fixed restrictions between cells.
std::string GMRF_gridmap_image_file
image name of the occupancy_gridmap
CMatrixD m_stackedCov
The compressed band diagonal matrix for the KF2 implementation.
size_t GMRF_gridmap_image_cx
Pixel coordinates of the origin for the occupancy_gridmap.
std::multimap< size_t, size_t > cell_interconnections
dynamic_vector< double > CVectorDouble
Column vector, like Eigen::MatrixXd, but automatically initialized to zeros since construction...
void insert(const KEY &k, const VALUE &v)
Insert a new pair KEY<->VALUE in the bi-map.
std::vector< std::vector< TobservationGMRF > > activeObs
utils::CDynamicGrid< TRandomFieldCell > BASE
TInsertionOptionsCommon * m_insertOptions_common
Common options to all random-field grid maps: pointer that is set to the derived-class instance of "i...
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
float cell2float(const TRandomFieldCell &c) const
float sigma
The sigma of the "Parzen"-kernel Gaussian.
float cutoffRadius
The cutoff radius for updating cells.
double m_average_normreadings_var