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

Detailed Description

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

Important implemented features are:

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

Definition at line 41 of file maps/CReflectivityGridMap2D.h.

#include <mrpt/maps/CReflectivityGridMap2D.h>

Inheritance diagram for mrpt::maps::CReflectivityGridMap2D:
Inheritance graph

Classes

struct  TInsertionOptions
 Parameters related with inserting observations into the map. More...
 
struct  TMapDefinition
 
struct  TMapDefinitionBase
 

Public Types

typedef int8_t cell_t
 The type of cells.
 
typedef detail::logoddscell_traits< int8_ttraits_t
 

Public Member Functions

void clear ()
 Calls the base CMetricMap::clear Declared here to avoid ambiguity between the two clear() in both base classes.
 
float cell2float (const int8_t &c) const MRPT_OVERRIDE
 The user must implement this in order to provide "saveToTextFile" a way to convert each cell into a numeric value.
 
 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 MRPT_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 MRPT_OVERRIDE
 See docs in base class: in this class this always returns 0.
 
void saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const MRPT_OVERRIDE
 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).
 
void getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
 Returns a 3D object representing the map.
 
void getAsImage (utils::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)
 
void loadFromProbabilisticPosesAndObservations (const mrpt::maps::CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map.
 
void loadFromSimpleMap (const mrpt::maps::CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map.
 
bool insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL)
 Insert the observation information into this map.
 
bool insertObservationPtr (const mrpt::obs::CObservationPtr &obs, const mrpt::poses::CPose3D *robotPose=NULL)
 A wrapper for smart pointers, just calls the non-smart pointer version.
 
double computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom)
 Computes the log-likelihood of a given observation given an arbitrary robot 3D pose.
 
double computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
virtual bool canComputeObservationLikelihood (const mrpt::obs::CObservation *obs)
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
 
bool canComputeObservationLikelihood (const mrpt::obs::CObservationPtr &obs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
double computeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf, const mrpt::poses::CPose2D &takenFrom)
 Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame.
 
bool canComputeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf)
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
 
virtual void determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams &params, TMatchingExtraResults &extraResults) const
 Computes the matching between this and another 2D point map, which includes finding:
 
virtual void determineMatching3D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams &params, TMatchingExtraResults &extraResults) const
 Computes the matchings between this and another 3D points map - method used in 3D-ICP.
 
virtual void auxParticleFilterCleanUp ()
 This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation".
 
virtual float squareDistanceToClosestCorrespondence (float x0, float y0) const
 Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.
 
virtual const mrpt::maps::CSimplePointsMapgetAsSimplePointsMap () const
 If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it.
 
virtual mrpt::maps::CSimplePointsMapgetAsSimplePointsMap ()
 
void setSize (const double x_min, const double x_max, const double y_min, const double y_max, const double resolution, const int8_t *fill_value=NULL)
 Changes the size of the grid, ERASING all previous contents.
 
void fill (const int8_t &value)
 Fills all the cells with the same value.
 
virtual void resize (double new_x_min, double new_x_max, double new_y_min, double new_y_max, const int8_t &defaultValueNewCells, double additionalMarginMeters=2.0)
 Changes the size of the grid, maintaining previous contents.
 
int8_tcellByPos (double x, double y)
 Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map extensions.
 
const int8_tcellByPos (double x, double y) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
int8_tcellByIndex (unsigned int cx, unsigned int cy)
 Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions.
 
const int8_tcellByIndex (unsigned int cx, unsigned int cy) const
 Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions.
 
size_t getSizeX () const
 Returns the horizontal size of grid map in cells count.
 
size_t getSizeY () const
 Returns the vertical size of grid map in cells count.
 
double getXMin () const
 Returns the "x" coordinate of left side of grid map.
 
double getXMax () const
 Returns the "x" coordinate of right side of grid map.
 
double getYMin () const
 Returns the "y" coordinate of top side of grid map.
 
double getYMax () const
 Returns the "y" coordinate of bottom side of grid map.
 
double getResolution () const
 Returns the resolution of the grid map.
 
int x2idx (double x) const
 Transform a coordinate values into cell indexes.
 
int y2idx (double y) const
 
int xy2idx (double x, double y) const
 
void idx2cxcy (const int &idx, int &cx, int &cy) const
 Transform a global (linear) cell index value into its corresponding (x,y) cell indexes.
 
double idx2x (int cx) const
 Transform a cell index into a coordinate value of the cell central point.
 
double idx2y (int cy) const
 
void getAsMatrix (MAT &m) const
 Get the entire grid as a matrix.
 
bool saveToTextFile (const std::string &fileName) const
 Saves a float representation of the grid (via "cell2float()") to a text file.
 

Static Public Member Functions

static void updateCell_fast_occupied (const unsigned x, const unsigned y, const cell_t logodd_obs, const cell_t thres, cell_t *mapArray, const unsigned _size_x)
 Performs the Bayesian fusion of a new observation of a cell, without checking for grid limits nor updateInfoChangeOnly.
 
static void updateCell_fast_occupied (cell_t *theCell, const cell_t logodd_obs, const cell_t thres)
 Performs the Bayesian fusion of a new observation of a cell, without checking for grid limits nor updateInfoChangeOnly.
 
static void updateCell_fast_free (const unsigned x, const unsigned y, const cell_t logodd_obs, const cell_t thres, cell_t *mapArray, const unsigned _size_x)
 Performs the Bayesian fusion of a new observation of a cell, without checking for grid limits nor updateInfoChangeOnly.
 
static void updateCell_fast_free (cell_t *theCell, const cell_t logodd_obs, const cell_t thres)
 Performs the Bayesian fusion of a new observation of a cell, without checking for grid limits nor updateInfoChangeOnly.
 

Public Attributes

mrpt::maps::CReflectivityGridMap2D::TInsertionOptions insertionOptions
 
TMapGenericParams genericMapParams
 Common params to all maps.
 

Static Public Attributes

RTTI stuff <br>
static const mrpt::utils::TRuntimeClassId classCMetricMap
 

Protected Member Functions

void internal_clear () MRPT_OVERRIDE
 Internal method called by clear()
 
bool internal_insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
 Internal method called by insertObservation()
 
double internal_computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE
 Internal method called by computeObservationLikelihood()
 
void publishEvent (const mrptEvent &e) const
 Called when you want this object to emit an event to all the observers currently subscribed to this object.
 
bool hasSubscribers () const
 Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.
 
std::vector< int8_t > & m_map_castaway_const () const
 Used only from logically const method that really need to modify the object.
 
void dyngridcommon_writeToStream (mrpt::utils::CStream &out) const
 
void dyngridcommon_readFromStream (mrpt::utils::CStream &in, bool cast_from_float=false)
 
CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const MRPT_OVERRIDE
 
void readFromStream (mrpt::utils::CStream &in, int version) MRPT_OVERRIDE
 

Protected Attributes

std::vector< int8_tm_map
 The cells.
 
double m_x_min
 
double m_x_max
 
double m_y_min
 
double m_y_max
 
double m_resolution
 
size_t m_size_x
 
size_t m_size_y
 

Static Protected Attributes

static CLogOddsGridMapLUT< cell_tm_logodd_lut
 Lookup tables for log-odds.
 

Private Member Functions

virtual bool internal_canComputeObservationLikelihood (const mrpt::obs::CObservation *obs)
 Internal method called by canComputeObservationLikelihood()
 
virtual void OnPostSuccesfulInsertObs (const mrpt::obs::CObservation *)
 Hook for each time a "internal_insertObservation" returns "true" This is called automatically from insertObservation() when internal_insertObservation returns true.
 
void internal_observer_begin (CObserver *)
 
void internal_observer_end (CObserver *)
 

Private Attributes

std::set< CObserver * > m_subscribers
 

RTTI stuff <br>

typedef CReflectivityGridMap2DPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CReflectivityGridMap2D
 
static mrpt::utils::TRuntimeClassId classCReflectivityGridMap2D
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const MRPT_OVERRIDE
 
virtual mrpt::utils::CObjectduplicate () const MRPT_OVERRIDE
 
static mrpt::utils::CObjectCreateObject ()
 
static CReflectivityGridMap2DPtr Create ()
 

Map Definition Interface stuff (see mrpt::maps::TMetricMapInitializer) @{

static const size_t m_private_map_register_id
 ID used to initialize class registration (just ignore it)
 
static mrpt::maps::TMetricMapInitializerMapDefinition ()
 Returns default map definition initializer.
 
static CReflectivityGridMap2DCreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def)
 Constructor from a map definition structure: initializes the map and its parameters accordingly.
 
static mrpt::maps::CMetricMapinternal_CreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def)
 

Member Typedef Documentation

◆ cell_t

typedef int8_t mrpt::maps::CLogOddsGridMap2D< int8_t >::cell_t
inherited

The type of cells.

Definition at line 52 of file maps/CLogOddsGridMap2D.h.

◆ SmartPtr

A typedef for the associated smart pointer

Definition at line 47 of file maps/CReflectivityGridMap2D.h.

◆ traits_t

Definition at line 53 of file maps/CLogOddsGridMap2D.h.

Constructor & Destructor Documentation

◆ CReflectivityGridMap2D()

mrpt::maps::CReflectivityGridMap2D::CReflectivityGridMap2D ( double  x_min = -2,
double  x_max = 2,
double  y_min = -2,
double  y_max = 2,
double  resolution = 0.1 
)

Constructor

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId * mrpt::maps::CReflectivityGridMap2D::_GetBaseClass ( )
staticprotected

◆ auxParticleFilterCleanUp()

virtual void mrpt::maps::CMetricMap::auxParticleFilterCleanUp ( )
inlinevirtualinherited

This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation".

This method should normally do nothing, but in some cases can be used to free auxiliary cached variables.

Reimplemented in mrpt::maps::CMultiMetricMap, and mrpt::maps::CLandmarksMap.

Definition at line 235 of file maps/CMetricMap.h.

◆ canComputeObservationLikelihood() [1/2]

virtual bool mrpt::maps::CMetricMap::canComputeObservationLikelihood ( const mrpt::obs::CObservation obs)
virtualinherited

Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.

an occupancy grid map cannot with an image).

Parameters
obsThe observation.
See also
computeObservationLikelihood, genericMapParams.enableObservationLikelihood

◆ canComputeObservationLikelihood() [2/2]

bool mrpt::maps::CMetricMap::canComputeObservationLikelihood ( const mrpt::obs::CObservationPtr obs)
inherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ canComputeObservationsLikelihood()

bool mrpt::maps::CMetricMap::canComputeObservationsLikelihood ( const mrpt::obs::CSensoryFrame sf)
inherited

Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.

an occupancy grid map cannot with an image).

Parameters
sfThe observations.
See also
canComputeObservationLikelihood

◆ cell2float()

float mrpt::maps::CReflectivityGridMap2D::cell2float ( const int8_t c) const
inlinevirtual

The user must implement this in order to provide "saveToTextFile" a way to convert each cell into a numeric value.

Reimplemented from mrpt::utils::CDynamicGrid< int8_t >.

Definition at line 59 of file maps/CReflectivityGridMap2D.h.

References mrpt::maps::CLogOddsGridMapLUT< TCELL >::l2p().

◆ cellByIndex() [1/2]

int8_t * mrpt::utils::CDynamicGrid< int8_t >::cellByIndex ( unsigned int  cx,
unsigned int  cy 
)
inlineinherited

Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions.

Definition at line 203 of file CDynamicGrid.h.

◆ cellByIndex() [2/2]

const int8_t * mrpt::utils::CDynamicGrid< int8_t >::cellByIndex ( unsigned int  cx,
unsigned int  cy 
) const
inlineinherited

Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions.

Definition at line 212 of file CDynamicGrid.h.

◆ cellByPos() [1/2]

int8_t * mrpt::utils::CDynamicGrid< int8_t >::cellByPos ( double  x,
double  y 
)
inlineinherited

Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map extensions.

Definition at line 183 of file CDynamicGrid.h.

◆ cellByPos() [2/2]

const int8_t * mrpt::utils::CDynamicGrid< int8_t >::cellByPos ( double  x,
double  y 
) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 192 of file CDynamicGrid.h.

◆ clear()

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

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

Definition at line 57 of file maps/CReflectivityGridMap2D.h.

References mrpt::maps::CMetricMap::clear().

◆ compute3DMatchingRatio()

float mrpt::maps::CReflectivityGridMap2D::compute3DMatchingRatio ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose3D otherMapPose,
const TMatchingRatioParams params 
) const
virtual

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

Reimplemented from mrpt::maps::CMetricMap.

◆ computeObservationLikelihood() [1/2]

double mrpt::maps::CMetricMap::computeObservationLikelihood ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose2D takenFrom 
)
inherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ computeObservationLikelihood() [2/2]

double mrpt::maps::CMetricMap::computeObservationLikelihood ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D takenFrom 
)
inherited

Computes the log-likelihood of a given observation given an arbitrary robot 3D pose.

Parameters
takenFromThe robot's pose the observation is supposed to be taken from.
obsThe observation.
Returns
This method returns a log-likelihood.
See also
Used in particle filter algorithms, see: CMultiMetricMapPDF::update

◆ computeObservationsLikelihood()

double mrpt::maps::CMetricMap::computeObservationsLikelihood ( const mrpt::obs::CSensoryFrame sf,
const mrpt::poses::CPose2D takenFrom 
)
inherited

Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame.

Parameters
takenFromThe robot's pose the observation is supposed to be taken from.
sfThe set of observations in a CSensoryFrame.
Returns
This method returns a log-likelihood.
See also
canComputeObservationsLikelihood

◆ Create()

static CReflectivityGridMap2DPtr mrpt::maps::CReflectivityGridMap2D::Create ( )
static

◆ CreateFromMapDefinition()

static CReflectivityGridMap2D * mrpt::maps::CReflectivityGridMap2D::CreateFromMapDefinition ( const mrpt::maps::TMetricMapInitializer def)
static

Constructor from a map definition structure: initializes the map and its parameters accordingly.

◆ CreateObject()

static mrpt::utils::CObject * mrpt::maps::CReflectivityGridMap2D::CreateObject ( )
static

◆ determineMatching2D()

virtual void mrpt::maps::CMetricMap::determineMatching2D ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose2D otherMapPose,
mrpt::utils::TMatchingPairList correspondences,
const TMatchingParams params,
TMatchingExtraResults extraResults 
) const
virtualinherited

Computes the matching between this and another 2D point map, which includes finding:

  • The set of points pairs in each map
  • The mean squared distance between corresponding pairs.

The algorithm is:

  • For each point in "otherMap":
    • Transform the point according to otherMapPose
    • Search with a KD-TREE the closest correspondences in "this" map.
    • Add to the set of candidate matchings, if it passes all the thresholds in params.

This method is the most time critical one into ICP-like algorithms.

Parameters
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The pose of the other map as seen from "this".
params[IN] Parameters for the determination of pairings.
correspondences[OUT] The detected matchings pairs.
extraResults[OUT] Other results.
See also
compute3DMatchingRatio

Reimplemented in mrpt::maps::CMultiMetricMap, mrpt::maps::CBeaconMap, mrpt::maps::COccupancyGridMap2D, and mrpt::maps::CPointsMap.

◆ determineMatching3D()

virtual void mrpt::maps::CMetricMap::determineMatching3D ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose3D otherMapPose,
mrpt::utils::TMatchingPairList correspondences,
const TMatchingParams params,
TMatchingExtraResults extraResults 
) const
virtualinherited

Computes the matchings between this and another 3D points map - method used in 3D-ICP.

This method finds the set of point pairs in each map.

The method is the most time critical one into ICP-like algorithms.

The algorithm is:

  • For each point in "otherMap":
    • Transform the point according to otherMapPose
    • Search with a KD-TREE the closest correspondences in "this" map.
    • Add to the set of candidate matchings, if it passes all the thresholds in params.
Parameters
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The pose of the other map as seen from "this".
params[IN] Parameters for the determination of pairings.
correspondences[OUT] The detected matchings pairs.
extraResults[OUT] Other results.
See also
compute3DMatchingRatio

Reimplemented in mrpt::maps::CPointsMap.

◆ duplicate()

virtual mrpt::utils::CObject * mrpt::maps::CReflectivityGridMap2D::duplicate ( ) const
virtual

◆ dyngridcommon_readFromStream()

void mrpt::utils::CDynamicGrid< int8_t >::dyngridcommon_readFromStream ( mrpt::utils::CStream in,
bool  cast_from_float = false 
)
inlineprotectedinherited

Definition at line 300 of file CDynamicGrid.h.

◆ dyngridcommon_writeToStream()

void mrpt::utils::CDynamicGrid< int8_t >::dyngridcommon_writeToStream ( mrpt::utils::CStream out) const
inlineprotectedinherited

Definition at line 295 of file CDynamicGrid.h.

◆ fill()

void mrpt::utils::CDynamicGrid< int8_t >::fill ( const int8_t value)
inlineinherited

Fills all the cells with the same value.

Definition at line 101 of file CDynamicGrid.h.

◆ getAs3DObject()

void mrpt::maps::CReflectivityGridMap2D::getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr outObj) const
virtual

Returns a 3D object representing the map.

See also
genericMapParams, TMapGenericParams::enableSaveAs3DObject

Implements mrpt::maps::CMetricMap.

◆ getAsImage()

void mrpt::maps::CReflectivityGridMap2D::getAsImage ( utils::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)

◆ getAsMatrix()

void mrpt::utils::CDynamicGrid< int8_t >::getAsMatrix ( MAT &  m) const
inlineinherited

Get the entire grid as a matrix.

Template Parameters
MATThe type of the matrix, typically a mrpt::math::CMatrixDouble.
Parameters
[out]mThe output matrix; will be set automatically to the correct size. Entry (cy,cx) in the matrix contains the grid cell with indices (cx,cy).
Note
This method will compile only for cell types that can be converted to the type of the matrix elements (e.g. double).

Definition at line 263 of file CDynamicGrid.h.

◆ getAsSimplePointsMap() [1/2]

virtual mrpt::maps::CSimplePointsMap * mrpt::maps::CMetricMap::getAsSimplePointsMap ( )
inlinevirtualinherited

◆ getAsSimplePointsMap() [2/2]

virtual const mrpt::maps::CSimplePointsMap * mrpt::maps::CMetricMap::getAsSimplePointsMap ( ) const
inlinevirtualinherited

If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it.

Otherwise, return NULL

Reimplemented in mrpt::maps::CMultiMetricMap, mrpt::maps::CPointsMap, and mrpt::maps::CSimplePointsMap.

Definition at line 243 of file maps/CMetricMap.h.

◆ getResolution()

double mrpt::utils::CDynamicGrid< int8_t >::getResolution ( ) const
inlineinherited

Returns the resolution of the grid map.

Definition at line 238 of file CDynamicGrid.h.

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId * mrpt::maps::CReflectivityGridMap2D::GetRuntimeClass ( ) const
virtual

Reimplemented from mrpt::maps::CMetricMap.

◆ getSizeX()

size_t mrpt::utils::CDynamicGrid< int8_t >::getSizeX ( ) const
inlineinherited

Returns the horizontal size of grid map in cells count.

Definition at line 220 of file CDynamicGrid.h.

◆ getSizeY()

size_t mrpt::utils::CDynamicGrid< int8_t >::getSizeY ( ) const
inlineinherited

Returns the vertical size of grid map in cells count.

Definition at line 223 of file CDynamicGrid.h.

◆ getXMax()

double mrpt::utils::CDynamicGrid< int8_t >::getXMax ( ) const
inlineinherited

Returns the "x" coordinate of right side of grid map.

Definition at line 229 of file CDynamicGrid.h.

◆ getXMin()

double mrpt::utils::CDynamicGrid< int8_t >::getXMin ( ) const
inlineinherited

Returns the "x" coordinate of left side of grid map.

Definition at line 226 of file CDynamicGrid.h.

◆ getYMax()

double mrpt::utils::CDynamicGrid< int8_t >::getYMax ( ) const
inlineinherited

Returns the "y" coordinate of bottom side of grid map.

Definition at line 235 of file CDynamicGrid.h.

◆ getYMin()

double mrpt::utils::CDynamicGrid< int8_t >::getYMin ( ) const
inlineinherited

Returns the "y" coordinate of top side of grid map.

Definition at line 232 of file CDynamicGrid.h.

◆ hasSubscribers()

bool mrpt::utils::CObservable::hasSubscribers ( ) const
inlineprotectedinherited

Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.

Definition at line 52 of file CObservable.h.

◆ idx2cxcy()

void mrpt::utils::CDynamicGrid< int8_t >::idx2cxcy ( const int &  idx,
int &  cx,
int &  cy 
) const
inlineinherited

Transform a global (linear) cell index value into its corresponding (x,y) cell indexes.

Definition at line 246 of file CDynamicGrid.h.

◆ idx2x()

double mrpt::utils::CDynamicGrid< int8_t >::idx2x ( int  cx) const
inlineinherited

Transform a cell index into a coordinate value of the cell central point.

Definition at line 253 of file CDynamicGrid.h.

◆ idx2y()

double mrpt::utils::CDynamicGrid< int8_t >::idx2y ( int  cy) const
inlineinherited

Definition at line 254 of file CDynamicGrid.h.

◆ insertObservation()

bool mrpt::maps::CMetricMap::insertObservation ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D robotPose = NULL 
)
inherited

Insert the observation information into this map.

This method must be implemented in derived classes.

Parameters
obsThe observation
robotPoseThe 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use the origin.
See also
CObservation::insertObservationInto

◆ insertObservationPtr()

bool mrpt::maps::CMetricMap::insertObservationPtr ( const mrpt::obs::CObservationPtr obs,
const mrpt::poses::CPose3D robotPose = NULL 
)
inherited

A wrapper for smart pointers, just calls the non-smart pointer version.

◆ internal_canComputeObservationLikelihood()

virtual bool mrpt::maps::CMetricMap::internal_canComputeObservationLikelihood ( const mrpt::obs::CObservation obs)
inlineprivatevirtualinherited

Internal method called by canComputeObservationLikelihood()

Reimplemented in mrpt::maps::CMultiMetricMap, and mrpt::maps::COccupancyGridMap2D.

Definition at line 71 of file maps/CMetricMap.h.

References MRPT_UNUSED_PARAM.

◆ internal_clear()

void mrpt::maps::CReflectivityGridMap2D::internal_clear ( )
protectedvirtual

Internal method called by clear()

Implements mrpt::maps::CMetricMap.

◆ internal_computeObservationLikelihood()

double mrpt::maps::CReflectivityGridMap2D::internal_computeObservationLikelihood ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D takenFrom 
)
protectedvirtual

Internal method called by computeObservationLikelihood()

Implements mrpt::maps::CMetricMap.

◆ internal_CreateFromMapDefinition()

static mrpt::maps::CMetricMap * mrpt::maps::CReflectivityGridMap2D::internal_CreateFromMapDefinition ( const mrpt::maps::TMetricMapInitializer def)
static

◆ internal_insertObservation()

bool mrpt::maps::CReflectivityGridMap2D::internal_insertObservation ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D robotPose = NULL 
)
protectedvirtual

Internal method called by insertObservation()

Implements mrpt::maps::CMetricMap.

◆ internal_observer_begin()

void mrpt::utils::CObservable::internal_observer_begin ( CObserver )
privateinherited

◆ internal_observer_end()

void mrpt::utils::CObservable::internal_observer_end ( CObserver )
privateinherited

◆ isEmpty()

bool mrpt::maps::CReflectivityGridMap2D::isEmpty ( ) const
virtual

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

Implements mrpt::maps::CMetricMap.

◆ loadFromProbabilisticPosesAndObservations()

void mrpt::maps::CMetricMap::loadFromProbabilisticPosesAndObservations ( const mrpt::maps::CSimpleMap Map)
inherited

Load the map contents from a CSimpleMap object, erasing all previous content of the map.

This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.

See also
insertObservation, CSimpleMap
Exceptions
std::exceptionSome internal steps in invoked methods can raise exceptions on invalid parameters, etc...

◆ loadFromSimpleMap()

void mrpt::maps::CMetricMap::loadFromSimpleMap ( const mrpt::maps::CSimpleMap Map)
inlineinherited

Load the map contents from a CSimpleMap object, erasing all previous content of the map.

This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.

See also
insertObservation, CSimpleMap
Exceptions
std::exceptionSome internal steps in invoked methods can raise exceptions on invalid parameters, etc...

Definition at line 105 of file maps/CMetricMap.h.

◆ m_map_castaway_const()

std::vector< int8_t > & mrpt::utils::CDynamicGrid< int8_t >::m_map_castaway_const ( ) const
inlineprotectedinherited

Used only from logically const method that really need to modify the object.

Definition at line 45 of file CDynamicGrid.h.

◆ MapDefinition()

static mrpt::maps::TMetricMapInitializer * mrpt::maps::CReflectivityGridMap2D::MapDefinition ( )
static

Returns default map definition initializer.

See mrpt::maps::TMetricMapInitializer

◆ OnPostSuccesfulInsertObs()

virtual void mrpt::maps::CMetricMap::OnPostSuccesfulInsertObs ( const mrpt::obs::CObservation )
inlineprivatevirtualinherited

Hook for each time a "internal_insertObservation" returns "true" This is called automatically from insertObservation() when internal_insertObservation returns true.

Reimplemented in mrpt::maps::COccupancyGridMap2D.

Definition at line 79 of file maps/CMetricMap.h.

◆ publishEvent()

void mrpt::utils::CObservable::publishEvent ( const mrptEvent e) const
protectedinherited

Called when you want this object to emit an event to all the observers currently subscribed to this object.

◆ readFromStream()

void mrpt::maps::CReflectivityGridMap2D::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protected

◆ resize()

virtual void mrpt::utils::CDynamicGrid< int8_t >::resize ( double  new_x_min,
double  new_x_max,
double  new_y_min,
double  new_y_max,
const int8_t defaultValueNewCells,
double  additionalMarginMeters = 2.0 
)
inlinevirtualinherited

Changes the size of the grid, maintaining previous contents.

See also
setSize

Definition at line 109 of file CDynamicGrid.h.

◆ saveMetricMapRepresentationToFile()

void mrpt::maps::CReflectivityGridMap2D::saveMetricMapRepresentationToFile ( const std::string &  filNamePrefix) const
virtual

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).

Implements mrpt::maps::CMetricMap.

◆ saveToTextFile()

bool mrpt::utils::CDynamicGrid< int8_t >::saveToTextFile ( const std::string &  fileName) const
inlineinherited

Saves a float representation of the grid (via "cell2float()") to a text file.

Returns
false on error

Definition at line 280 of file CDynamicGrid.h.

◆ setSize()

void mrpt::utils::CDynamicGrid< int8_t >::setSize ( const double  x_min,
const double  x_max,
const double  y_min,
const double  y_max,
const double  resolution,
const int8_t fill_value = NULL 
)
inlineinherited

Changes the size of the grid, ERASING all previous contents.

If fill_value is left as NULL, the contents of cells may be undefined (some will remain with their old values, the new ones will have the default cell value, but the location of old values may change wrt their old places). If fill_value is not NULL, it is assured that all cells will have a copy of that value after resizing.

See also
resize, fill

Definition at line 69 of file CDynamicGrid.h.

◆ squareDistanceToClosestCorrespondence()

virtual float mrpt::maps::CMetricMap::squareDistanceToClosestCorrespondence ( float  x0,
float  y0 
) const
virtualinherited

Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.

Reimplemented in mrpt::maps::CPointsMap.

◆ updateCell_fast_free() [1/2]

static void mrpt::maps::CLogOddsGridMap2D< int8_t >::updateCell_fast_free ( cell_t theCell,
const cell_t  logodd_obs,
const cell_t  thres 
)
inlinestaticinherited

Performs the Bayesian fusion of a new observation of a cell, without checking for grid limits nor updateInfoChangeOnly.

This method increases the "free-ness" of a cell, managing possible saturation.

Parameters
xCell index in X axis.
yCell index in Y axis.
logodd_obsObservation of the cell, in log-odd form as transformed by p2l.
thresThis must be CELLTYPE_MAX-logodd_obs
See also
updateCell_fast_occupied

Definition at line 124 of file maps/CLogOddsGridMap2D.h.

◆ updateCell_fast_free() [2/2]

static void mrpt::maps::CLogOddsGridMap2D< int8_t >::updateCell_fast_free ( const unsigned  x,
const unsigned  y,
const cell_t  logodd_obs,
const cell_t  thres,
cell_t mapArray,
const unsigned  _size_x 
)
inlinestaticinherited

Performs the Bayesian fusion of a new observation of a cell, without checking for grid limits nor updateInfoChangeOnly.

This method increases the "free-ness" of a cell, managing possible saturation.

Parameters
xCell index in X axis.
yCell index in Y axis.
logodd_obsObservation of the cell, in log-odd form as transformed by p2l.
thresThis must be CELLTYPE_MAX-logodd_obs
See also
updateCell_fast_occupied

Definition at line 102 of file maps/CLogOddsGridMap2D.h.

◆ updateCell_fast_occupied() [1/2]

static void mrpt::maps::CLogOddsGridMap2D< int8_t >::updateCell_fast_occupied ( cell_t theCell,
const cell_t  logodd_obs,
const cell_t  thres 
)
inlinestaticinherited

Performs the Bayesian fusion of a new observation of a cell, without checking for grid limits nor updateInfoChangeOnly.

This method increases the "occupancy-ness" of a cell, managing possible saturation.

Parameters
theCellThe cell to modify
logodd_obsObservation of the cell, in log-odd form as transformed by p2l.
thresThis must be CELLTYPE_MIN+logodd_obs
See also
updateCell, updateCell_fast_free

Definition at line 84 of file maps/CLogOddsGridMap2D.h.

◆ updateCell_fast_occupied() [2/2]

static void mrpt::maps::CLogOddsGridMap2D< int8_t >::updateCell_fast_occupied ( const unsigned  x,
const unsigned  y,
const cell_t  logodd_obs,
const cell_t  thres,
cell_t mapArray,
const unsigned  _size_x 
)
inlinestaticinherited

Performs the Bayesian fusion of a new observation of a cell, without checking for grid limits nor updateInfoChangeOnly.

This method increases the "occupancy-ness" of a cell, managing possible saturation.

Parameters
xCell index in X axis.
yCell index in Y axis.
logodd_obsObservation of the cell, in log-odd form as transformed by p2l.
thresThis must be CELLTYPE_MIN+logodd_obs
See also
updateCell, updateCell_fast_free

Definition at line 63 of file maps/CLogOddsGridMap2D.h.

◆ writeToStream()

void mrpt::maps::CReflectivityGridMap2D::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
protected

◆ x2idx()

int mrpt::utils::CDynamicGrid< int8_t >::x2idx ( double  x) const
inlineinherited

Transform a coordinate values into cell indexes.

Definition at line 241 of file CDynamicGrid.h.

◆ xy2idx()

int mrpt::utils::CDynamicGrid< int8_t >::xy2idx ( double  x,
double  y 
) const
inlineinherited

Definition at line 243 of file CDynamicGrid.h.

◆ y2idx()

int mrpt::utils::CDynamicGrid< int8_t >::y2idx ( double  y) const
inlineinherited

Definition at line 242 of file CDynamicGrid.h.

Member Data Documentation

◆ _init_CReflectivityGridMap2D

mrpt::utils::CLASSINIT mrpt::maps::CReflectivityGridMap2D::_init_CReflectivityGridMap2D
staticprotected

Definition at line 47 of file maps/CReflectivityGridMap2D.h.

◆ classCMetricMap

const mrpt::utils::TRuntimeClassId mrpt::maps::CMetricMap::classCMetricMap
staticinherited

Definition at line 57 of file maps/CMetricMap.h.

◆ classCReflectivityGridMap2D

mrpt::utils::TRuntimeClassId mrpt::maps::CReflectivityGridMap2D::classCReflectivityGridMap2D
static

Definition at line 47 of file maps/CReflectivityGridMap2D.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::maps::CReflectivityGridMap2D::classinfo
static

Definition at line 47 of file maps/CReflectivityGridMap2D.h.

◆ genericMapParams

TMapGenericParams mrpt::maps::CMetricMap::genericMapParams
inherited

Common params to all maps.

Definition at line 230 of file maps/CMetricMap.h.

◆ insertionOptions

mrpt::maps::CReflectivityGridMap2D::TInsertionOptions mrpt::maps::CReflectivityGridMap2D::insertionOptions

◆ m_logodd_lut

CLogOddsGridMapLUT<cell_t> mrpt::maps::CReflectivityGridMap2D::m_logodd_lut
staticprotected

Lookup tables for log-odds.

Definition at line 50 of file maps/CReflectivityGridMap2D.h.

◆ m_map

std::vector<int8_t > mrpt::utils::CDynamicGrid< int8_t >::m_map
protectedinherited

The cells.

Definition at line 43 of file CDynamicGrid.h.

◆ m_private_map_register_id

const size_t mrpt::maps::CReflectivityGridMap2D::m_private_map_register_id
static

ID used to initialize class registration (just ignore it)

Definition at line 102 of file maps/CReflectivityGridMap2D.h.

◆ m_resolution

double mrpt::utils::CDynamicGrid< int8_t >::m_resolution
protectedinherited

Definition at line 47 of file CDynamicGrid.h.

◆ m_size_x

size_t mrpt::utils::CDynamicGrid< int8_t >::m_size_x
protectedinherited

Definition at line 48 of file CDynamicGrid.h.

◆ m_size_y

size_t mrpt::utils::CDynamicGrid< int8_t >::m_size_y
protectedinherited

Definition at line 48 of file CDynamicGrid.h.

◆ m_subscribers

std::set<CObserver*> mrpt::utils::CObservable::m_subscribers
privateinherited

Definition at line 42 of file CObservable.h.

◆ m_x_max

double mrpt::utils::CDynamicGrid< int8_t >::m_x_max
protectedinherited

Definition at line 47 of file CDynamicGrid.h.

◆ m_x_min

double mrpt::utils::CDynamicGrid< int8_t >::m_x_min
protectedinherited

Definition at line 47 of file CDynamicGrid.h.

◆ m_y_max

double mrpt::utils::CDynamicGrid< int8_t >::m_y_max
protectedinherited

Definition at line 47 of file CDynamicGrid.h.

◆ m_y_min

double mrpt::utils::CDynamicGrid< int8_t >::m_y_min
protectedinherited

Definition at line 47 of file CDynamicGrid.h.




Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Tue Jan 17 22:40:29 UTC 2023