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 matrix

All derived class must implement a static class factory <metric_map_class>::MapDefinition() that builds a default TMetricMapInitializer [New in MRPT 1.3.0]

CObservation, CSensoryFrame, CMultiMetricMap

#include <mrpt/maps/CMetricMap.h>

class CMetricMap:
public mrpt::serialization::CSerializable,
public mrpt::system::CObservable
{
public:
//
methods

virtual bool isEmpty() const = 0;
virtual void saveMetricMapRepresentationToFile(const std::string& filNamePrefix) const = 0;
virtual void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr& outObj) const = 0;
};

// direct descendants

template <class octree_t, class octree_node_t>
class COctoMapBase;

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

Methods¶

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 void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr& outObj) const = 0

Returns a 3D object representing the map.