Class CReflectivityGridMap2D

Nested Relationships

Nested Types

Inheritance Relationships

Base Types

Class Documentation

class CReflectivityGridMap2D : public mrpt::maps::CMetricMap, public mrpt::containers::CDynamicGrid<int8_t>, public mrpt::maps::CLogOddsGridMap2D<int8_t>

A 2D grid map representing the reflectivity of the environment (for example, measured with an IR proximity sensor).

Important implemented features are:

  • Insertion of mrpt::obs::CObservationReflectivity observations.

  • Probability estimation of observations. See base class.

  • Rendering as 3D object: a 2D textured plane.

  • Automatic resizing of the map limits when inserting observations close to the border.

Each cell contains the up-to-date average height from measured falling in that cell. Algorithms that can be used:

  • mrSimpleAverage: Each cell only stores the current average value.

Public Functions

inline void clear()

Calls the base CMetricMap::clear Declared here to avoid ambiguity between the two clear() in both base classes.

inline float cell2float(const int8_t &c) const override
CReflectivityGridMap2D(double x_min = -2, double x_max = 2, double y_min = -2, double y_max = 2, double resolution = 0.1)

Constructor

bool isEmpty() const override

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

float compute3DMatchingRatio(const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams &params) const override

See docs in base class: in this class this always returns 0

void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const override
void getVisualizationInto(mrpt::viz::CSetOfObjects &outObj) const override
void getAsImage(mrpt::img::CImage &img, bool verticalFlip = false, bool forceRGB = false) const

Returns the grid as a 8-bit graylevel image, where each pixel is a cell (output image is RGB only if forceRGB is true)

inline std::string asString() const override

Returns a short description of the map.

Public Members

mrpt::maps::CReflectivityGridMap2D::TInsertionOptions insertionOptions

Protected Functions

void internal_clear() override
bool internal_insertObservation(const mrpt::obs::CObservation &obs, const std::optional<const mrpt::poses::CPose3D> &robotPose) override
double internal_computeObservationLikelihood(const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D &takenFrom) const override

Protected Attributes

double min_x = {-10.0f}

See CReflectivityGridMap2DOptions::CReflectivityGridMap2DOptions

double max_x = {10.0f}
double min_y = {-10.0f}
double max_y = {10.0f}
double resolution = {0.10f}
mrpt::maps::CReflectivityGridMap2D::TInsertionOptions insertionOpts

Protected Static Attributes

static CLogOddsGridMapLUT<cell_t> m_logodd_lut

Lookup tables for log-odds

struct TInsertionOptions : public mrpt::config::CLoadableOptions

Parameters related with inserting observations into the map.

Public Functions

TInsertionOptions()

Default values loader

void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string &section) override
void dumpToTextStream(std::ostream &out) const override

Public Members

int16_t channel = {-1}

The reflectivity channel for this map. If channel=-1, then any channel will be accepted. Otherwise, the map will ignore CObservationReflectivity instances with a differing channel. (Default=-1)