class mrpt::maps::CMetricMap

Declares a virtual base class for all metric maps storage classes.

In this class virtual methods are provided to allow the insertion of any type of “CObservation” objects into the metric map, thus updating the map (doesn’t matter if it is a 2D/3D grid, a point map, etc.).

Observations don’t include any information about the robot pose, just the raw observation and information about the sensor pose relative to the robot mobile base coordinates origin.

Note that all metric maps implement this mrpt::system::CObservable interface, emitting the following events:

  • mrpt::obs::mrptEventMetricMapClear: Upon call of the clear() method.

mrpt::obs::mrptEventMetricMapInsert: Upon insertion of an observation that effectively modifies the map (e.g. inserting an image into a grid map will NOT raise an event, inserting a laser scan will).

To check what observations are supported by each metric map, see Maps and observations compatibility matrices.

All derived class must implement a static class factory <metric_map_class>::MapDefinition() that builds a default TMetricMapInitializer

See also:

CObservation, CSensoryFrame, CMultiMetricMap

#include <mrpt/maps/CMetricMap.h>

class CMetricMap:
    public mrpt::serialization::CSerializable,
    public mrpt::system::CObservable,
    public mrpt::Stringifyable,
    public mrpt::opengl::Visualizable
    // construction



    virtual bool isEmpty() const = 0;
    virtual void saveMetricMapRepresentationToFile(const std::string& filNamePrefix) const = 0;
    virtual std::string asString() const = 0;
    virtual void getVisualizationInto(mrpt::opengl::CSetOfObjects& o) const = 0;

// direct descendants

template <class octree_t, class octree_node_t>
class COctoMapBase;

template <typename node_t>
class CVoxelMapBase;

class CBeaconMap;
class CHeightGridMap2D;
class CLandmarksMap;
class CMultiMetricMap;
class COccupancyGridMap2D;
class COccupancyGridMap3D;
class CPointsMap;
class CRandomFieldGridMap2D;
class CReflectivityGridMap2D;





virtual bool isEmpty() const = 0

Returns true if the map is empty/no observation has been inserted.

virtual void saveMetricMapRepresentationToFile(const std::string& filNamePrefix) const = 0

This virtual method saves the map to a file “filNamePrefix”+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface).

virtual std::string asString() const = 0

Returns a human-friendly textual description of the object.

For classes with a large/complex internal state, only a summary should be returned instead of the exhaustive enumeration of all data members.

virtual void getVisualizationInto(mrpt::opengl::CSetOfObjects& o) const = 0

Inserts 3D primitives representing this object into the provided container.

Note that the former contents of o are not cleared.

See also: