Class CMetricMapBuilder

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

  • public mrpt::system::COutputLogger

Derived Types

Class Documentation

class CMetricMapBuilder : public mrpt::system::COutputLogger

This virtual class is the base for SLAM implementations. See derived classes for more information.

See also

CMetricMap

Subclassed by mrpt::slam::CMetricMapBuilderICP, mrpt::slam::CMetricMapBuilderRBPF

Pure virtual methods to implement in any particular SLAM algorithm

virtual void initialize(const mrpt::maps::CSimpleMap &initialMap = mrpt::maps::CSimpleMap(), const mrpt::poses::CPosePDF *x0 = nullptr) = 0

Initialize the method, starting with a known location PDF “x0”(if supplied, set to nullptr to left unmodified) and a given fixed, past map.

virtual mrpt::poses::CPose3DPDF::Ptr getCurrentPoseEstimation() const = 0

Returns a copy of the current best pose estimation as a pose PDF.

virtual void processActionObservation(mrpt::obs::CActionCollection &action, mrpt::obs::CSensoryFrame &observations) = 0

Process a new action and observations pair to update this map: See the description of the class at the top of this page to see a more complete description.

Parameters:
  • action – The estimation of the incremental pose change in the robot pose.

  • observations – The set of observations that robot senses at the new pose.

virtual void getCurrentlyBuiltMap(mrpt::maps::CSimpleMap &out_map) const = 0

Fills “out_map” with the set of “poses”-“sensory-frames”, thus the so far built map.

virtual unsigned int getCurrentlyBuiltMapSize() = 0

Returns just how many sensory-frames are stored in the currently build map.

virtual const mrpt::maps::CMultiMetricMap &getCurrentlyBuiltMetricMap() const = 0

Returns the map built so far. NOTE that for efficiency a pointer to the internal object is passed, DO NOT delete nor modify the object in any way, if desired, make a copy of ir with “clone()”.

virtual void saveCurrentEstimationToImage(const std::string &file, bool formatEMF_BMP = true) = 0

A useful method for debugging: the current map (and/or poses) estimation is dumped to an image file.

Parameters:
  • file – The output file name

  • formatEMF_BMP – Output format = true:EMF, false:BMP

Public Functions

CMetricMapBuilder()

Constructor

~CMetricMapBuilder() override

Destructor.

void clear()

Clear all elements of the maps, and reset localization to (0,0,0deg).

inline void enableMapUpdating(bool enable)

Enables or disables the map updating (default state is enabled)

void loadCurrentMapFromFile(const std::string &fileName)

Load map (mrpt::maps::CSimpleMap) from a “.simplemap” file

void saveCurrentMapToFile(const std::string &fileName, bool compressGZ = true) const

Save map (mrpt::maps::CSimpleMap) to a “.simplemap” file.

Public Members

TOptions options

Protected Functions

inline void enterCriticalSection()

Enter critical section for map updating

inline void leaveCriticalSection()

Leave critical section for map updating

Protected Attributes

std::mutex critZoneChangingMap

Critical zones

struct TOptions

Options for the algorithm

Public Functions

inline TOptions(mrpt::system::VerbosityLevel &verb_level_ref)

Public Members

mrpt::system::VerbosityLevel &verbosity_level
bool enableMapUpdating = true

Enable map updating, default is true.

bool debugForceInsertion = false

Always insert into map. Default is false: detect if necessary.

mrpt::rtti::CListOfClasses alwaysInsertByClass

A list of observation classes (derived from mrpt::obs::CObservation) which will be always inserted in the map, disregarding the minimum insertion distances). Default: Empty. How to insert classes:

alwaysInserByClass.insert(CLASS_ID(CObservationImage));

See also

mrpt::rtti::CListOfClasses