10 #ifndef CRandomFieldGridMap2D_H 11 #define CRandomFieldGridMap2D_H 23 #if EIGEN_VERSION_AT_LEAST(3,1,0) // eigen 3.1+ 24 #include <Eigen/SparseCore> 25 #include <Eigen/SparseCholesky> 35 #if defined(MRPT_IS_X86_AMD64) 46 kf_mean (kfmean_dm_mean),
47 kf_std (kfstd_dmmeanw),
49 last_updated(
mrpt::system::
now()),
50 updated_std (kfstd_dmmeanw)
81 #if defined(MRPT_IS_X86_AMD64) 151 float resolution = 0.1
160 virtual bool isEmpty()
const;
171 virtual void saveAsBitmapFile(
const std::string &filName)
const;
186 void internal_loadFromConfigFile_common(
188 const std::string §ion);
230 virtual void resize(
float new_x_min,
235 float additionalMarginMeters = 1.0f );
238 float compute3DMatchingRatio(
241 float maxDistForCorr = 0.10f,
242 float maxMahaDistForCorr = 2.0f
248 virtual void saveMetricMapRepresentationToFile(
249 const std::string &filNamePrefix
256 virtual void saveAsMatlab3DGraph(
const std::string &filName)
const;
261 void getAsMatlab3DGraphScript(std::string &out_script)
const;
265 virtual void getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr &outObj )
const;
269 virtual void getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr &meanObj, mrpt::opengl::CSetOfObjectsPtr &varObj )
const;
285 virtual void predictMeasurement(
288 double &out_predict_response,
289 double &out_predict_response_variance );
329 #if EIGEN_VERSION_AT_LEAST(3,1,0) 330 std::vector<Eigen::Triplet<double> > H_prior;
357 void insertObservation_KernelDM_DMV(
366 void insertObservation_KF(
374 void insertObservation_KF2(
382 void insertObservation_GMRF(
387 void updateMapEstimation_GMRF();
390 double computeConfidenceCellValue_DM_DMV (
const TRandomFieldCell *cell )
const;
401 void recoverMeanAndCov()
const;
404 virtual void internal_clear();
407 bool exist_relation_between2cells(
413 const size_t seed_cxo,
414 const size_t seed_cyo,
415 const size_t objective_cxo,
416 const size_t objective_cyo);
std::multimap< size_t, size_t > cell_interconnections
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
std::string GMRF_gridmap_image_file
image name of the occupancy_gridmap
float sigma
The sigma of the "Parzen"-kernel Gaussian.
static void fill(bimap< enum_t, std::string > &m_map)
This class is a "CSerializable" wrapper for "CMatrixTemplateNumeric<double>".
float KF_defaultCellMeanValue
The default value for the mean of cells' concentration.
A class for storing images as grayscale or RGB bitmaps.
uint16_t GMRF_constraintsSize
The size of the Gaussian window to impose fixed restrictions between cells.
float GMRF_lambdaObsLoss
The loss of information of the observations with each iteration.
void clear()
Erase all the contents of the map.
mrpt::math::CMatrixD m_cov
The whole covariance matrix, used for the Kalman Filter map representation.
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
std::vector< float > m_DM_gaussWindow
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
mrpt::system::TTimeStamp last_updated
[Dynamic maps only] The timestamp of the last time the cell was updated
TMapRepresentation
The type of map representation to be used, see CRandomFieldGridMap2D for a discussion.
double gmrf_mean
[GMRF only] The mean value of this cell
Only specializations of this class are defined for each enum type of interest.
std::vector< float > gauss_val
float cutoffRadius
The cutoff radius for updating cells.
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:
TMapRepresentation m_mapType
The map representation type of this map, as passed in the constructor.
double dm_mean_w
[Kernel-methods only] The cumulative weights (concentration = alpha * dm_mean / dm_mean_w + (1-alpha)...
Parameters common to any derived class.
float KF_observationModelNoise
The sensor model noise (in normalized concentration units).
TInsertionOptionsCommon * m_insertOptions_common
Common options to all random-field grid maps: pointer that is set to the derived-class instance of "i...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
TRandomFieldCell(double kfmean_dm_mean=1e-20, double kfstd_dmmeanw=0)
Constructor.
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...
double kf_mean
[KF-methods only] The mean value of this cell
The contents of each cell in a CRandomFieldGridMap2D map.
size_t m_average_normreadings_count
A bidirectional version of std::map, declared as bimap<KEY,VALUE> and which actually contains two std...
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) ...
bool m_hasToRecoverMeanAndCov
Only for the KF2 implementation.
float GMRF_gridmap_image_res
occupancy_gridmap resolution: size of each pixel (m)
double updated_std
[Dynamic maps only] The std cell value that was updated (to be used in the Forgetting_curve ...
A class for storing an occupancy grid map.
float GMRF_lambdaPrior
The information (Lambda) of fixed map constraints.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
CRandomFieldGridMap2D represents a 2D grid map where each cell is associated one real-valued property...
float KF_covSigma
The "sigma" for the initial covariance value between cells (in meters).
Declares a virtual base class for all metric maps storage classes.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
double m_average_normreadings_var
double dmv_var_mean
[Kernel DM-V only] The cumulative weighted variance of this cell
bool GMRF_use_occupancy_information
wether to use information of an occupancy_gridmap map for buidling the GMRF
std::string GMRF_simplemap_file
simplemap_file name of the occupancy_gridmap
uint16_t KF_W_size
[mrKalmanApproximate] The size of the window of neighbor cells.
float GMRF_constraintsSigma
The sigma of the Gaussian window to impose fixed restrictions between cells.
mrpt::math::CMatrixD m_stackedCov
The compressed band diagonal matrix for the KF2 implementation.
void insert(const KEY &k, const VALUE &v)
Insert a new pair KEY<->VALUE in the bi-map.
double dm_mean
[Kernel-methods only] The cumulative weighted readings of this cell
size_t GMRF_gridmap_image_cx
Pixel coordinates of the origin for the occupancy_gridmap.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
float cell2float(const TRandomFieldCell &c) const
float KF_initialCellStd
The initial standard deviation of each cell's concentration (will be stored both at each cell's struc...
size_t GMRF_gridmap_image_cy
Pixel coordinates of the origin for the occupancy_gridmap.
utils::CDynamicGrid< TRandomFieldCell > BASE
double kf_std
[KF-methods only] The standard deviation value of this cell
std::vector< std::vector< TobservationGMRF > > activeObs
maps::CRandomFieldGridMap2D::TMapRepresentation enum_t