Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Types | Public Member Functions | Static Protected Member Functions | Protected Attributes
mrpt::maps::TSetOfMetricMapInitializers Class Reference

Detailed Description

A set of TMetricMapInitializer structures, passed to the constructor CMultiMetricMap::CMultiMetricMap See the comments for TSetOfMetricMapInitializers::loadFromConfigFile, and "CMultiMetricMap::setListOfMaps" for effectively creating the list of desired maps.

See also
CMultiMetricMap::CMultiMetricMap, CLoadableOptions

Definition at line 91 of file TMetricMapInitializer.h.

#include <mrpt/maps/TMetricMapInitializer.h>

Inheritance diagram for mrpt::maps::TSetOfMetricMapInitializers:
Inheritance graph

Public Types

using iterator = std::deque< TMetricMapInitializer::Ptr >::iterator
 
using const_iterator = std::deque< TMetricMapInitializer::Ptr >::const_iterator
 

Public Member Functions

 TSetOfMetricMapInitializers ()
 
template<typename MAP_DEFINITION >
void push_back (const MAP_DEFINITION &o)
 
void push_back (const TMetricMapInitializer::Ptr &o)
 
size_t size () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
void clear ()
 
void loadFromConfigFile (const mrpt::config::CConfigFileBase &source, const std::string &sectionName) override
 Loads the configuration for the set of internal maps from a textual definition in an INI-like file. More...
 
void saveToConfigFile (mrpt::config::CConfigFileBase &target, const std::string &section) const override
 This method saves the options to a ".ini"-like file or memory-stored string list. More...
 
void dumpToTextStream (std::ostream &out) const override
 This method dumps the options of the multi-metric map AND those of every internal map. More...
 
void loadFromConfigFileName (const std::string &config_file, const std::string &section)
 Behaves like loadFromConfigFile, but you can pass directly a file name and a temporary CConfigFile object will be created automatically to load the file. More...
 
void saveToConfigFileName (const std::string &config_file, const std::string &section) const
 Behaves like saveToConfigFile, but you can pass directly a file name and a temporary CConfigFile object will be created automatically to save the file. More...
 
void dumpToConsole () const
 Just like dumpToTextStream() but sending the text to the console (std::cout) More...
 

Static Protected Member Functions

static void dumpVar_int (std::ostream &out, const char *varName, int v)
 Used to print variable info from dumpToTextStream with the macro LOADABLEOPTS_DUMP_VAR. More...
 
static void dumpVar_float (std::ostream &out, const char *varName, float v)
 
static void dumpVar_double (std::ostream &out, const char *varName, double v)
 
static void dumpVar_bool (std::ostream &out, const char *varName, bool v)
 
static void dumpVar_string (std::ostream &out, const char *varName, const std::string &v)
 

Protected Attributes

std::deque< TMetricMapInitializer::Ptrm_list
 

Member Typedef Documentation

◆ const_iterator

Definition at line 108 of file TMetricMapInitializer.h.

◆ iterator

Definition at line 106 of file TMetricMapInitializer.h.

Constructor & Destructor Documentation

◆ TSetOfMetricMapInitializers()

mrpt::maps::TSetOfMetricMapInitializers::TSetOfMetricMapInitializers ( )
inline

Definition at line 97 of file TMetricMapInitializer.h.

Member Function Documentation

◆ begin() [1/2]

iterator mrpt::maps::TSetOfMetricMapInitializers::begin ( )
inline

Definition at line 109 of file TMetricMapInitializer.h.

References m_list.

Referenced by dumpToTextStream(), and mrpt::maps::CMultiMetricMap::setListOfMaps().

◆ begin() [2/2]

const_iterator mrpt::maps::TSetOfMetricMapInitializers::begin ( ) const
inline

Definition at line 111 of file TMetricMapInitializer.h.

References m_list.

◆ clear()

void mrpt::maps::TSetOfMetricMapInitializers::clear ( )
inline

Definition at line 113 of file TMetricMapInitializer.h.

References m_list.

Referenced by loadFromConfigFile().

◆ dumpToConsole()

void CLoadableOptions::dumpToConsole ( ) const
inherited

Just like dumpToTextStream() but sending the text to the console (std::cout)

Definition at line 44 of file CLoadableOptions.cpp.

References mrpt::config::CLoadableOptions::dumpToTextStream().

Referenced by mrpt::hmtslam::CTopLCDetector_GridMatching::computeTopologicalObservationModel().

◆ dumpToTextStream()

void TSetOfMetricMapInitializers::dumpToTextStream ( std::ostream &  out) const
overridevirtual

This method dumps the options of the multi-metric map AND those of every internal map.

Reimplemented from mrpt::config::CLoadableOptions.

Definition at line 125 of file TMetricMapInitializer.cpp.

References begin(), end(), mrpt::format(), MRPT_END, MRPT_START, and size().

◆ dumpVar_bool()

void CLoadableOptions::dumpVar_bool ( std::ostream &  out,
const char *  varName,
bool  v 
)
staticprotectedinherited

Definition at line 63 of file CLoadableOptions.cpp.

References mrpt::format(), and LOADABLEOPTS_COLUMN_WIDTH.

◆ dumpVar_double()

void CLoadableOptions::dumpVar_double ( std::ostream &  out,
const char *  varName,
double  v 
)
staticprotectedinherited

Definition at line 57 of file CLoadableOptions.cpp.

References mrpt::format(), and LOADABLEOPTS_COLUMN_WIDTH.

◆ dumpVar_float()

void CLoadableOptions::dumpVar_float ( std::ostream &  out,
const char *  varName,
float  v 
)
staticprotectedinherited

Definition at line 51 of file CLoadableOptions.cpp.

References mrpt::format(), and LOADABLEOPTS_COLUMN_WIDTH.

◆ dumpVar_int()

void CLoadableOptions::dumpVar_int ( std::ostream &  out,
const char *  varName,
int  v 
)
staticprotectedinherited

Used to print variable info from dumpToTextStream with the macro LOADABLEOPTS_DUMP_VAR.

Definition at line 45 of file CLoadableOptions.cpp.

References mrpt::format(), and LOADABLEOPTS_COLUMN_WIDTH.

◆ dumpVar_string()

void CLoadableOptions::dumpVar_string ( std::ostream &  out,
const char *  varName,
const std::string v 
)
staticprotectedinherited

Definition at line 70 of file CLoadableOptions.cpp.

References mrpt::format(), and LOADABLEOPTS_COLUMN_WIDTH.

◆ end() [1/2]

iterator mrpt::maps::TSetOfMetricMapInitializers::end ( )
inline

Definition at line 110 of file TMetricMapInitializer.h.

References m_list.

Referenced by dumpToTextStream(), and mrpt::maps::CMultiMetricMap::setListOfMaps().

◆ end() [2/2]

const_iterator mrpt::maps::TSetOfMetricMapInitializers::end ( ) const
inline

Definition at line 112 of file TMetricMapInitializer.h.

References m_list.

◆ loadFromConfigFile()

void TSetOfMetricMapInitializers::loadFromConfigFile ( const mrpt::config::CConfigFileBase source,
const std::string sectionName 
)
overridevirtual

Loads the configuration for the set of internal maps from a textual definition in an INI-like file.

The format of the ini file is defined in CConfigFile. The list of maps and their options will be loaded from a handle of sections:

[<sectionName>]
// Creation of maps:
occupancyGrid_count=<Number of mrpt::maps::COccupancyGridMap2D maps>
octoMap_count=<Number of mrpt::maps::COctoMap maps>
colourOctoMap_count=<Number of mrpt::slam::CColourOctoMap maps>
gasGrid_count=<Number of mrpt::maps::CGasConcentrationGridMap2D maps>
wifiGrid_count=<Number of mrpt::maps::CWirelessPowerGridMap2D maps>
landmarksMap_count=<0 or 1, for creating a mrpt::maps::CLandmarksMap
*map>
beaconMap_count=<0 or 1, for creating a mrpt::maps::CBeaconMap map>
pointsMap_count=<Number of mrpt::maps::CSimplePointsMap map>
heightMap_count=<Number of mrpt::maps::CHeightGridMap2D maps>
reflectivityMap_count=<Number of mrpt::maps::CReflectivityGridMap2D
*maps>
colourPointsMap_count=<0 or 1, for creating a
weightedPointsMap_count=<0 or 1, for creating a
// ====================================================
// Creation Options for OccupancyGridMap ##:
[<sectionName>+"_occupancyGrid_##_creationOpts"]
min_x=<value>
max_x=<value>
min_y=<value>
max_y=<value>
resolution=<value>
# Common params for all maps:
#enableSaveAs3DObject = {true|false}
#enableObservationLikelihood = {true|false}
#enableObservationInsertion = {true|false}
// Insertion Options for OccupancyGridMap ##:
[<sectionName>+"_occupancyGrid_##_insertOpts"]
<See COccupancyGridMap2D::TInsertionOptions>
// Likelihood Options for OccupancyGridMap ##:
[<sectionName>+"_occupancyGrid_##_likelihoodOpts"]
<See COccupancyGridMap2D::TLikelihoodOptions>
// ====================================================
// Creation Options for OctoMap ##:
[<sectionName>+"_octoMap_##_creationOpts"]
resolution=<value>
// Insertion Options for OctoMap ##:
[<sectionName>+"_octoMap_##_insertOpts"]
<See COctoMap::TInsertionOptions>
// Likelihood Options for OctoMap ##:
[<sectionName>+"_octoMap_##_likelihoodOpts"]
<See COctoMap::TLikelihoodOptions>
// ====================================================
// Creation Options for ColourOctoMap ##:
[<sectionName>+"_colourOctoMap_##_creationOpts"]
resolution=<value>
// Insertion Options for ColourOctoMap ##:
[<sectionName>+"_colourOctoMap_##_insertOpts"]
<See CColourOctoMap::TInsertionOptions>
// Likelihood Options for ColourOctoMap ##:
[<sectionName>+"_colourOctoMap_##_likelihoodOpts"]
<See CColourOctoMap::TLikelihoodOptions>
// ====================================================
// Insertion Options for mrpt::maps::CSimplePointsMap ##:
[<sectionName>+"_pointsMap_##_insertOpts"]
<See CPointsMap::TInsertionOptions>
// Likelihood Options for mrpt::maps::CSimplePointsMap ##:
[<sectionName>+"_pointsMap_##_likelihoodOpts"]
<See CPointsMap::TLikelihoodOptions>
// ====================================================
// Creation Options for CGasConcentrationGridMap2D ##:
[<sectionName>+"_gasGrid_##_creationOpts"]
mapType= <0-1> ; See
min_x=<value>
max_x=<value>
min_y=<value>
max_y=<value>
resolution=<value>
// Insertion Options for CGasConcentrationGridMap2D ##:
[<sectionName>+"_gasGrid_##_insertOpts"]
<See CGasConcentrationGridMap2D::TInsertionOptions>
// ====================================================
// Creation Options for CWirelessPowerGridMap2D ##:
[<sectionName>+"_wifiGrid_##_creationOpts"]
min_x=<value>
max_x=<value>
min_y=<value>
max_y=<value>
resolution=<value>
// Insertion Options for CWirelessPowerGridMap2D ##:
[<sectionName>+"_wifiGrid_##_insertOpts"]
<See CWirelessPowerGridMap2D::TInsertionOptions>
// ====================================================
// Creation Options for CLandmarksMap ##:
[<sectionName>+"_landmarksMap_##_creationOpts"]
nBeacons=<# of beacons>
beacon_001_ID=67 ; The ID and 3D coordinates of each beacon
beacon_001_X=<x>
beacon_001_Y=<x>
beacon_001_Z=<x>
// Insertion Options for CLandmarksMap ##:
[<sectionName>+"_landmarksMap_##_insertOpts"]
<See CLandmarksMap::TInsertionOptions>
// Likelihood Options for CLandmarksMap ##:
[<sectionName>+"_landmarksMap_##_likelihoodOpts"]
<See CLandmarksMap::TLikelihoodOptions>
// ====================================================
// Insertion Options for CBeaconMap ##:
[<sectionName>+"_beaconMap_##_insertOpts"]
<See CBeaconMap::TInsertionOptions>
// Likelihood Options for CBeaconMap ##:
[<sectionName>+"_beaconMap_##_likelihoodOpts"]
<See CBeaconMap::TLikelihoodOptions>
// ====================================================
// Creation Options for HeightGridMap ##:
[<sectionName>+"_heightGrid_##_creationOpts"]
mapType= <0-1> // See CHeightGridMap2D::CHeightGridMap2D
min_x=<value>
max_x=<value>
min_y=<value>
max_y=<value>
resolution=<value>
// Insertion Options for HeightGridMap ##:
[<sectionName>+"_heightGrid_##_insertOpts"]
<See CHeightGridMap2D::TInsertionOptions>
// ====================================================
// Creation Options for ReflectivityGridMap ##:
[<sectionName>+"_reflectivityMap_##_creationOpts"]
min_x=<value> // See CReflectivityGridMap2D::CReflectivityGridMap2D
max_x=<value>
min_y=<value>
max_y=<value>
resolution=<value>
// Insertion Options for HeightGridMap ##:
[<sectionName>+"_reflectivityMap_##_insertOpts"]
<See CReflectivityGridMap2D::TInsertionOptions>
// ====================================================
// Insertion Options for CColouredPointsMap ##:
[<sectionName>+"_colourPointsMap_##_insertOpts"]
<See CPointsMap::TInsertionOptions>
// Color Options for CColouredPointsMap ##:
[<sectionName>+"_colourPointsMap_##_colorOpts"]
<See CColouredPointsMap::TColourOptions>
// Likelihood Options for mrpt::maps::CSimplePointsMap ##:
[<sectionName>+"_colourPointsMap_##_likelihoodOpts"]
<See CPointsMap::TLikelihoodOptions>
// ====================================================
// Insertion Options for CWeightedPointsMap ##:
[<sectionName>+"_weightedPointsMap_##_insertOpts"]
<See CPointsMap::TInsertionOptions>
// Likelihood Options for CWeightedPointsMap ##:
[<sectionName>+"_weightedPointsMap_##_likelihoodOpts"]
<See CPointsMap::TLikelihoodOptions>

Where:

  • ##: Represents the index of the map (e.g. "00","01",...)
  • By default, the variables into each "TOptions" structure of the maps are defined in textual form by the same name of the corresponding C++ variable (e.g. "float resolution;" -> "resolution=0.10")
Note
Examples of map definitions can be found in the '.ini' files provided in the demo directories: "share/mrpt/config-files/"

Implements mrpt::config::CLoadableOptions.

Definition at line 69 of file TMetricMapInitializer.cpp.

References ASSERT_, clear(), mrpt::format(), mrpt::maps::TMetricMapInitializer::loadFromConfigFile(), MRPT_END, MRPT_START, push_back(), and mrpt::config::CConfigFileBase::read_uint64_t().

Referenced by run_test_pf_localization().

◆ loadFromConfigFileName()

void CLoadableOptions::loadFromConfigFileName ( const std::string config_file,
const std::string section 
)
inherited

Behaves like loadFromConfigFile, but you can pass directly a file name and a temporary CConfigFile object will be created automatically to load the file.

See also
loadFromConfigFile

Definition at line 22 of file CLoadableOptions.cpp.

References mrpt::config::CLoadableOptions::loadFromConfigFile().

◆ push_back() [1/2]

template<typename MAP_DEFINITION >
void mrpt::maps::TSetOfMetricMapInitializers::push_back ( const MAP_DEFINITION &  o)
inline

◆ push_back() [2/2]

void mrpt::maps::TSetOfMetricMapInitializers::push_back ( const TMetricMapInitializer::Ptr o)
inline

Definition at line 104 of file TMetricMapInitializer.h.

References m_list.

◆ saveToConfigFile()

void TSetOfMetricMapInitializers::saveToConfigFile ( mrpt::config::CConfigFileBase target,
const std::string section 
) const
overridevirtual

This method saves the options to a ".ini"-like file or memory-stored string list.

See also
loadFromConfigFile, saveToConfigFileName

Reimplemented from mrpt::config::CLoadableOptions.

Definition at line 117 of file TMetricMapInitializer.cpp.

◆ saveToConfigFileName()

void CLoadableOptions::saveToConfigFileName ( const std::string config_file,
const std::string section 
) const
inherited

Behaves like saveToConfigFile, but you can pass directly a file name and a temporary CConfigFile object will be created automatically to save the file.

See also
saveToConfigFile, loadFromConfigFileName

Definition at line 37 of file CLoadableOptions.cpp.

References mrpt::config::CLoadableOptions::saveToConfigFile().

◆ size()

size_t mrpt::maps::TSetOfMetricMapInitializers::size ( ) const
inline

Definition at line 105 of file TMetricMapInitializer.h.

References m_list.

Referenced by dumpToTextStream().

Member Data Documentation

◆ m_list

std::deque<TMetricMapInitializer::Ptr> mrpt::maps::TSetOfMetricMapInitializers::m_list
protected

Definition at line 94 of file TMetricMapInitializer.h.

Referenced by begin(), clear(), end(), push_back(), and size().

mrpt::maps::CGasConcentrationGridMap2D
CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D area.
Definition: CGasConcentrationGridMap2D.h:35
mrpt::maps::CColouredPointsMap
A map of 2D/3D points with individual colours (RGB).
Definition: CColouredPointsMap.h:29
mrpt::maps::CWeightedPointsMap
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
Definition: CWeightedPointsMap.h:30
mrpt::maps::CGasConcentrationGridMap2D::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.
mrpt::maps::CWirelessPowerGridMap2D::CWirelessPowerGridMap2D
CWirelessPowerGridMap2D(TMapRepresentation mapType=mrKernelDM, double x_min=-2, double x_max=2, double y_min=-2, double y_max=2, double resolution=0.1)
Constructor.
mrpt::maps::CWirelessPowerGridMap2D
CWirelessPowerGridMap2D represents a PDF of wifi concentrations over a 2D area.
Definition: CWirelessPowerGridMap2D.h:35
mrpt::maps::CHeightGridMap2D
Digital Elevation Model (DEM), a mesh or grid representation of a surface which keeps the estimated h...
Definition: CHeightGridMap2D.h:63
mrpt::maps::CSimplePointsMap
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
Definition: CSimplePointsMap.h:31
mrpt::maps::COctoMap
A three-dimensional probabilistic occupancy grid, implemented as an octo-tree with the "octomap" C++ ...
Definition: COctoMap.h:35
value
GLsizei const GLfloat * value
Definition: glext.h:4117
mrpt::maps::CBeaconMap
A class for storing a map of 3D probabilistic beacons, using a Montecarlo, Gaussian,...
Definition: CBeaconMap.h:46
mrpt::maps::CReflectivityGridMap2D
A 2D grid map representing the reflectivity of the environment (for example, measured with an IR prox...
Definition: CReflectivityGridMap2D.h:41
mrpt::maps::COccupancyGridMap2D
A class for storing an occupancy grid map.
Definition: COccupancyGridMap2D.h:62
mrpt::maps::CLandmarksMap
A class for storing a map of 3D probabilistic landmarks.
Definition: CLandmarksMap.h:75
x
GLenum GLint x
Definition: glext.h:3538
a
GLubyte GLubyte GLubyte a
Definition: glext.h:6279



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST