Main MRPT website > C++ reference
MRPT logo
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
mrpt::slam::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 66 of file CReflectivityGridMap2D.h.

#include <mrpt/slam/CReflectivityGridMap2D.h>

Inheritance diagram for mrpt::slam::CReflectivityGridMap2D:
Inheritance graph
[legend]

Classes

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

Public Types

typedef int8_t cell_t
 The type of cells.
 
typedef
detail::logoddscell_traits
< int8_t > 
traits_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
 The user must implement this in order to provide "saveToTextFile" a way to convert each cell into a numeric value.
 
 CReflectivityGridMap2D (float x_min=-2, float x_max=2, float y_min=-2, float y_max=2, float resolution=0.1)
 Constructor.
 
bool isEmpty () const
 Returns true if the map is empty/no observation has been inserted.
 
double computeObservationLikelihood (const CObservation *obs, const CPose3D &takenFrom)
 Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map.
 
float compute3DMatchingRatio (const CMetricMap *otherMap, const CPose3D &otherMapPose, float minDistForCorr=0.10f, float minMahaDistForCorr=2.0f) const
 Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps.
 
void saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const
 The implementation in this class just calls all the corresponding method of the contained metric maps.
 
void getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const
 Returns a 3D object representing the map: by default, it will be a mrpt::opengl::CMesh object, unless it is specified otherwise in mrpt::
 
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 CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map.
 
void loadFromSimpleMap (const CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map.
 
bool insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL)
 Insert the observation information into this map.
 
bool insertObservationPtr (const CObservationPtr &obs, const CPose3D *robotPose=NULL)
 A wrapper for smart pointers, just calls the non-smart pointer version.
 
double computeObservationLikelihood (const CObservation *obs, const CPose2D &takenFrom)
 Computes the log-likelihood of a given observation given an arbitrary robot 2D pose.
 
virtual bool canComputeObservationLikelihood (const CObservation *obs)
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
 
double computeObservationsLikelihood (const CSensoryFrame &sf, const CPose2D &takenFrom)
 Returns the sum of the log-likelihoods of each individual observation within a mrpt::slam::CSensoryFrame.
 
bool canComputeObservationsLikelihood (const CSensoryFrame &sf)
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
 
virtual void computeMatchingWith2D (const CMetricMap *otherMap, const CPose2D &otherMapPose, float maxDistForCorrespondence, float maxAngularDistForCorrespondence, const CPose2D &angularDistPivotPoint, TMatchingPairList &correspondences, float &correspondencesRatio, float *sumSqrDist=NULL, bool onlyKeepTheClosest=true, bool onlyUniqueRobust=false, const size_t decimation_other_map_points=1, const size_t offset_other_map_points=0) const
 Computes the matchings between this and another 2D points map.
 
virtual void computeMatchingWith3D (const CMetricMap *otherMap, const CPose3D &otherMapPose, float maxDistForCorrespondence, float maxAngularDistForCorrespondence, const CPoint3D &angularDistPivotPoint, TMatchingPairList &correspondences, float &correspondencesRatio, float *sumSqrDist=NULL, bool onlyKeepTheClosest=true, bool onlyUniqueRobust=false, const size_t decimation_other_map_points=1, const size_t offset_other_map_points=0) 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 (const float &x0, const float &y0) const
 Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.
 
virtual const 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 CSimplePointsMapgetAsSimplePointsMap ()
 
mrpt::utils::CObjectPtr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).
 
CObjectclone () const
 Cloning interface for smart pointers.
 
void setSize (float x_min, float x_max, float y_min, float y_max, float resolution)
 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 (float new_x_min, float new_x_max, float new_y_min, float new_y_max, const int8_t &defaultValueNewCells, float additionalMarginMeters=2.0f)
 Changes the size of the grid, maintaining previous contents.
 
int8_t * cellByPos (float x, float 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_t * cellByPos (float x, float y) const
 Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map extensions.
 
int8_t * cellByIndex (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_t * cellByIndex (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.
 
float getXMin () const
 Returns the "x" coordinate of left side of grid map.
 
float getXMax () const
 Returns the "x" coordinate of right side of grid map.
 
float getYMin () const
 Returns the "y" coordinate of top side of grid map.
 
float getYMax () const
 Returns the "y" coordinate of bottom side of grid map.
 
float getResolution () const
 Returns the resolution of the grid map.
 
void saveToTextFile (const std::string &fileName) const
 
int x2idx (float x) const
 Transform a coordinate values into cell indexes.
 
int x2idx (float x, float x_min) const
 Transform a coordinate value into a cell index, using a diferent "x_min" value.
 
int y2idx (float y) const
 
int y2idx (float y, float y_min) const
 
int xy2idx (float x, float 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.
 
float idx2x (int cx) const
 Transform a cell index into a coordinate value.
 
float idx2y (int cy) const
 
void getAsMatrix (MAT &m) const
 Get the entire grid as a matrix.
 

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::slam::CReflectivityGridMap2D::TInsertionOptions insertionOptions
 
bool m_disableSaveAs3DObject
 When set to true (default=false), calling "getAs3DObject" will have no effects.
 

Static Public Attributes

static const
mrpt::utils::TRuntimeClassId 
classCObject
 
static const int8_t CELLTYPE_MIN = -127
 
static const int8_t CELLTYPE_MAX = 127
 
static const int8_t P2LTABLE_SIZE = CELLTYPE_MAX
 
static const size_t LOGODDS_LUT_ENTRIES = 1<<8
 
RTTI stuff
static const
mrpt::utils::TRuntimeClassId 
classCMetricMap
 
RTTI stuff
static const
mrpt::utils::TRuntimeClassId 
classCSerializable
 

Protected Member Functions

virtual void internal_clear ()
 Erase all the contents of the map.
 
virtual bool internal_insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL)
 Insert the observation information into this map.
 
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.
 
CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const
 Introduces a pure virtual method responsible for writing to a CStream.
 
void readFromStream (mrpt::utils::CStream &in, int version)
 Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.
 

Protected Attributes

std::vector< int8_t > m_map
 The cells.
 
float m_x_min
 
float m_x_max
 
float m_y_min
 
float m_y_max
 
float 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.
 

RTTI stuff

typedef CReflectivityGridMap2DPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CReflectivityGridMap2D
 
static mrpt::utils::TRuntimeClassId classCReflectivityGridMap2D
 
static const
mrpt::utils::TRuntimeClassId
classinfo
 
static const
mrpt::utils::TRuntimeClassId
_GetBaseClass ()
 
virtual const
mrpt::utils::TRuntimeClassId
GetRuntimeClass () const
 Returns information about the class of an object in runtime.
 
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
 
static mrpt::utils::CObjectCreateObject ()
 
static CReflectivityGridMap2DPtr Create ()
 

Member Typedef Documentation

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

The type of cells.

Definition at line 69 of file CLogOddsGridMap2D.h.

A typedef for the associated smart pointer

Definition at line 72 of file CReflectivityGridMap2D.h.

typedef detail::logoddscell_traits<int8_t > mrpt::slam::CLogOddsGridMap2D< int8_t >::traits_t
inherited

Definition at line 70 of file CLogOddsGridMap2D.h.

Constructor & Destructor Documentation

mrpt::slam::CReflectivityGridMap2D::CReflectivityGridMap2D ( float  x_min = -2,
float  x_max = 2,
float  y_min = -2,
float  y_max = 2,
float  resolution = 0.1 
)

Constructor.

Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::slam::CReflectivityGridMap2D::_GetBaseClass ( )
staticprotected
virtual void mrpt::slam::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::slam::CLandmarksMap, and mrpt::slam::CMultiMetricMap.

Definition at line 326 of file CMetricMap.h.

virtual bool mrpt::slam::CMetricMap::canComputeObservationLikelihood ( const CObservation obs)
inlinevirtualinherited

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

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

Definition at line 184 of file CMetricMap.h.

bool mrpt::slam::CMetricMap::canComputeObservationsLikelihood ( const 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
float mrpt::slam::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 84 of file CReflectivityGridMap2D.h.

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 236 of file CDynamicGrid.h.

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 245 of file CDynamicGrid.h.

int8_t * mrpt::utils::CDynamicGrid< int8_t >::cellByPos ( float  x,
float  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 210 of file CDynamicGrid.h.

const int8_t * mrpt::utils::CDynamicGrid< int8_t >::cellByPos ( float  x,
float  y 
) const
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 223 of file CDynamicGrid.h.

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

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

Definition at line 82 of file CReflectivityGridMap2D.h.

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

CObject* mrpt::utils::CObject::clone ( ) const
inlineinherited

Cloning interface for smart pointers.

Definition at line 154 of file CObject.h.

float mrpt::slam::CReflectivityGridMap2D::compute3DMatchingRatio ( const CMetricMap otherMap,
const CPose3D otherMapPose,
float  minDistForCorr = 0.10f,
float  minMahaDistForCorr = 2.0f 
) const
virtual

Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps.

This method always return 0 for grid maps.

Parameters
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The 6D pose of the other map as seen from "this".
minDistForCorr[IN] The minimum distance between 2 non-probabilistic map elements for counting them as a correspondence.
minMahaDistForCorr[IN] The minimum Mahalanobis distance between 2 probabilistic map elements for counting them as a correspondence.
Returns
The matching ratio [0,1]
See Also
computeMatchingWith2D

Implements mrpt::slam::CMetricMap.

virtual void mrpt::slam::CMetricMap::computeMatchingWith2D ( const CMetricMap otherMap,
const CPose2D otherMapPose,
float  maxDistForCorrespondence,
float  maxAngularDistForCorrespondence,
const CPose2D angularDistPivotPoint,
TMatchingPairList correspondences,
float &  correspondencesRatio,
float *  sumSqrDist = NULL,
bool  onlyKeepTheClosest = true,
bool  onlyUniqueRobust = false,
const size_t  decimation_other_map_points = 1,
const size_t  offset_other_map_points = 0 
) const
inlinevirtualinherited

Computes the matchings between this and another 2D points map.

This includes finding:

  • The set of points pairs in each map
  • The mean squared distance between corresponding pairs. This method is the most time critical one into the ICP algorithm.
Parameters
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The pose of the other map as seen from "this".
maxDistForCorrespondence[IN] Maximum 2D linear distance between two points to be matched.
maxAngularDistForCorrespondence[IN] In radians: The aim is to allow larger distances to more distant correspondences.
angularDistPivotPoint[IN] The point used to calculate distances from in both maps.
correspondences[OUT] The detected matchings pairs.
correspondencesRatio[OUT] The ratio [0,1] of points in otherMap with at least one correspondence.
sumSqrDist[OUT] The sum of all matched points squared distances.If undesired, set to NULL, as default.
onlyKeepTheClosest[IN] If set to true, only the closest correspondence will be returned. If false (default) all are returned.
See Also
compute3DMatchingRatio

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

Definition at line 236 of file CMetricMap.h.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

virtual void mrpt::slam::CMetricMap::computeMatchingWith3D ( const CMetricMap otherMap,
const CPose3D otherMapPose,
float  maxDistForCorrespondence,
float  maxAngularDistForCorrespondence,
const CPoint3D angularDistPivotPoint,
TMatchingPairList correspondences,
float &  correspondencesRatio,
float *  sumSqrDist = NULL,
bool  onlyKeepTheClosest = true,
bool  onlyUniqueRobust = false,
const size_t  decimation_other_map_points = 1,
const size_t  offset_other_map_points = 0 
) const
inlinevirtualinherited

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 the ICP algorithm.

Parameters
otherMap[IN] The other map to compute the matching with.
otherMapPose[IN] The pose of the other map as seen from "this".
maxDistForCorrespondence[IN] Maximum 2D linear distance between two points to be matched.
maxAngularDistForCorrespondence[IN] In radians: The aim is to allow larger distances to more distant correspondences.
angularDistPivotPoint[IN] The point used to calculate distances from in both maps.
correspondences[OUT] The detected matchings pairs.
correspondencesRatio[OUT] The ratio [0,1] of points in otherMap with at least one correspondence.
sumSqrDist[OUT] The sum of all matched points squared distances.If undesired, set to NULL, as default.
onlyKeepTheClosest[IN] If set to true, only the closest correspondence will be returned. If false (default) all are returned.
See Also
compute3DMatchingRatio

Reimplemented in mrpt::slam::CPointsMap.

Definition at line 272 of file CMetricMap.h.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

double mrpt::slam::CReflectivityGridMap2D::computeObservationLikelihood ( const CObservation obs,
const CPose3D takenFrom 
)
virtual

Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map.

Parameters
takenFromThe robot's pose the observation is supposed to be taken from.
obsThe observation.
Returns
This method returns a likelihood in the range [0,1].
See Also
Used in particle filter algorithms, see: CMultiMetricMapPDF::update

Implements mrpt::slam::CMetricMap.

double mrpt::slam::CMetricMap::computeObservationLikelihood ( const CObservation obs,
const CPose2D takenFrom 
)
inlineinherited

Computes the log-likelihood of a given observation given an arbitrary robot 2D 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

Definition at line 175 of file CMetricMap.h.

double mrpt::slam::CMetricMap::computeObservationsLikelihood ( const CSensoryFrame sf,
const CPose2D takenFrom 
)
inherited

Returns the sum of the log-likelihoods of each individual observation within a mrpt::slam::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
static CReflectivityGridMap2DPtr mrpt::slam::CReflectivityGridMap2D::Create ( )
static
static mrpt::utils::CObject* mrpt::slam::CReflectivityGridMap2D::CreateObject ( )
static
virtual mrpt::utils::CObject* mrpt::slam::CReflectivityGridMap2D::duplicate ( ) const
virtual

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 151 of file CObject.h.

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

Fills all the cells with the same value.

Definition at line 116 of file CDynamicGrid.h.

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

Returns a 3D object representing the map: by default, it will be a mrpt::opengl::CMesh object, unless it is specified otherwise in mrpt::

Implements mrpt::slam::CMetricMap.

void mrpt::slam::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)

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 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 329 of file CDynamicGrid.h.

virtual const CSimplePointsMap* mrpt::slam::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::slam::CPointsMap, mrpt::slam::CMultiMetricMap, and mrpt::slam::CSimplePointsMap.

Definition at line 346 of file CMetricMap.h.

virtual CSimplePointsMap* mrpt::slam::CMetricMap::getAsSimplePointsMap ( )
inlinevirtualinherited
float mrpt::utils::CDynamicGrid< int8_t >::getResolution ( ) const
inlineinherited

Returns the resolution of the grid map.

Definition at line 278 of file CDynamicGrid.h.

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

Returns information about the class of an object in runtime.

Reimplemented from mrpt::slam::CMetricMap.

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

Returns the horizontal size of grid map in cells count.

Definition at line 254 of file CDynamicGrid.h.

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

Returns the vertical size of grid map in cells count.

Definition at line 258 of file CDynamicGrid.h.

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

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

Definition at line 266 of file CDynamicGrid.h.

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

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

Definition at line 262 of file CDynamicGrid.h.

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

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

Definition at line 274 of file CDynamicGrid.h.

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

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

Definition at line 270 of file CDynamicGrid.h.

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 69 of file CObservable.h.

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 306 of file CDynamicGrid.h.

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

Transform a cell index into a coordinate value.

Definition at line 314 of file CDynamicGrid.h.

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

Definition at line 315 of file CDynamicGrid.h.

bool mrpt::slam::CMetricMap::insertObservation ( const CObservation obs,
const CPose3D robotPose = NULL 
)
inlineinherited

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

Definition at line 133 of file CMetricMap.h.

bool mrpt::slam::CMetricMap::insertObservationPtr ( const CObservationPtr obs,
const CPose3D robotPose = NULL 
)
inlineinherited

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

Definition at line 147 of file CMetricMap.h.

References MRPT_END, MRPT_START, mrpt::slam::CObservationPtr::pointer(), mrpt::stlplus::smart_ptr_base< T, C, COUNTER >::present(), and THROW_EXCEPTION.

virtual void mrpt::slam::CReflectivityGridMap2D::internal_clear ( )
protectedvirtual

Erase all the contents of the map.

Implements mrpt::slam::CMetricMap.

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

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 CPose2D(0,0,deg)
See Also
CObservation::insertObservationInto

Implements mrpt::slam::CMetricMap.

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

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

Implements mrpt::slam::CMetricMap.

void mrpt::slam::CMetricMap::loadFromProbabilisticPosesAndObservations ( const 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...
void mrpt::slam::CMetricMap::loadFromSimpleMap ( const 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 124 of file CMetricMap.h.

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 52 of file CDynamicGrid.h.

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.

void mrpt::slam::CReflectivityGridMap2D::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protectedvirtual

Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See Also
CStream

Implements mrpt::utils::CSerializable.

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

Changes the size of the grid, maintaining previous contents.

See Also
setSize

Definition at line 121 of file CDynamicGrid.h.

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

The implementation in this class just calls all the corresponding method of the contained metric maps.

Implements mrpt::slam::CMetricMap.

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

Definition at line 286 of file CDynamicGrid.h.

void mrpt::utils::CDynamicGrid< int8_t >::setSize ( float  x_min,
float  x_max,
float  y_min,
float  y_max,
float  resolution 
)
inlineinherited

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

See Also
resize

Definition at line 83 of file CDynamicGrid.h.

virtual float mrpt::slam::CMetricMap::squareDistanceToClosestCorrespondence ( const float &  x0,
const float &  y0 
) const
inlinevirtualinherited

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

Definition at line 333 of file CMetricMap.h.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

static void mrpt::slam::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 119 of file CLogOddsGridMap2D.h.

static void mrpt::slam::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 141 of file CLogOddsGridMap2D.h.

static void mrpt::slam::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 80 of file CLogOddsGridMap2D.h.

static void mrpt::slam::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 101 of file CLogOddsGridMap2D.h.

void mrpt::slam::CReflectivityGridMap2D::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
protectedvirtual

Introduces a pure virtual method responsible for writing to a CStream.

This can not be used directly be users, instead use "stream << object;" for writing it to a stream.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See Also
CStream

Implements mrpt::utils::CSerializable.

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

Transform a coordinate values into cell indexes.

Definition at line 301 of file CDynamicGrid.h.

int mrpt::utils::CDynamicGrid< int8_t >::x2idx ( float  x,
float  x_min 
) const
inlineinherited

Transform a coordinate value into a cell index, using a diferent "x_min" value.

Definition at line 319 of file CDynamicGrid.h.

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

Definition at line 303 of file CDynamicGrid.h.

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

Definition at line 302 of file CDynamicGrid.h.

int mrpt::utils::CDynamicGrid< int8_t >::y2idx ( float  y,
float  y_min 
) const
inlineinherited

Definition at line 320 of file CDynamicGrid.h.

Member Data Documentation

mrpt::utils::CLASSINIT mrpt::slam::CReflectivityGridMap2D::_init_CReflectivityGridMap2D
staticprotected

Definition at line 72 of file CReflectivityGridMap2D.h.

const int8_t mrpt::slam::detail::logoddscell_traits< int8_t >::CELLTYPE_MAX = 127
staticinherited

Definition at line 45 of file CLogOddsGridMap2D.h.

const int8_t mrpt::slam::detail::logoddscell_traits< int8_t >::CELLTYPE_MIN = -127
staticinherited

Definition at line 44 of file CLogOddsGridMap2D.h.

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

Definition at line 81 of file CMetricMap.h.

const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject
staticinherited

Definition at line 139 of file CObject.h.

mrpt::utils::TRuntimeClassId mrpt::slam::CReflectivityGridMap2D::classCReflectivityGridMap2D
static

Definition at line 72 of file CReflectivityGridMap2D.h.

const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable
staticinherited

Definition at line 56 of file CSerializable.h.

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

Definition at line 72 of file CReflectivityGridMap2D.h.

mrpt::slam::CReflectivityGridMap2D::TInsertionOptions mrpt::slam::CReflectivityGridMap2D::insertionOptions
const size_t mrpt::slam::detail::logoddscell_traits< int8_t >::LOGODDS_LUT_ENTRIES = 1<<8
staticinherited

Definition at line 47 of file CLogOddsGridMap2D.h.

bool mrpt::slam::CMetricMap::m_disableSaveAs3DObject
inherited

When set to true (default=false), calling "getAs3DObject" will have no effects.

Definition at line 321 of file CMetricMap.h.

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

Lookup tables for log-odds.

Definition at line 75 of file CReflectivityGridMap2D.h.

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

The cells.

Definition at line 49 of file CDynamicGrid.h.

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

Definition at line 55 of file CDynamicGrid.h.

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

Definition at line 56 of file CDynamicGrid.h.

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

Definition at line 56 of file CDynamicGrid.h.

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

Definition at line 54 of file CDynamicGrid.h.

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

Definition at line 54 of file CDynamicGrid.h.

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

Definition at line 54 of file CDynamicGrid.h.

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

Definition at line 54 of file CDynamicGrid.h.

const int8_t mrpt::slam::detail::logoddscell_traits< int8_t >::P2LTABLE_SIZE = CELLTYPE_MAX
staticinherited

Definition at line 46 of file CLogOddsGridMap2D.h.




Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013