Main MRPT website > C++ reference for MRPT 1.5.0
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | Friends
mrpt::maps::COccupancyGridMap2D Class Referenceabstract

Detailed Description

A class for storing an occupancy grid map.

COccupancyGridMap2D is a class for storing a metric map representation in the form of a probabilistic occupancy grid map: value of 0 means certainly occupied, 1 means a certainly empty cell. Initially 0.5 means uncertainty.

The cells keep the log-odd representation of probabilities instead of the probabilities themselves. More details can be found at http://www.mrpt.org/Occupancy_Grids

The algorithm for updating the grid from a laser scanner can optionally take into account the progressive widening of the beams, as described in this page

Some implemented methods are:

Definition at line 61 of file maps/COccupancyGridMap2D.h.

#include <mrpt/maps/COccupancyGridMap2D.h>

Inheritance diagram for mrpt::maps::COccupancyGridMap2D:
Inheritance graph
[legend]
Collaboration diagram for mrpt::maps::COccupancyGridMap2D:
Collaboration graph
[legend]

Classes

struct  TCriticalPointsList
 The structure used to store the set of Voronoi diagram critical points. More...
 
struct  TEntropyInfo
 Used for returning entropy related information. More...
 
class  TInsertionOptions
 With this struct options are provided to the observation insertion process. More...
 
struct  TLaserSimulUncertaintyParams
 Input params for laserScanSimulatorWithUncertainty() More...
 
struct  TLaserSimulUncertaintyResult
 Output params for laserScanSimulatorWithUncertainty() More...
 
class  TLikelihoodOptions
 With this struct options are provided to the observation likelihood computation process. More...
 
class  TLikelihoodOutput
 Some members of this struct will contain intermediate or output data after calling "computeObservationLikelihood" for some likelihood functions. More...
 
struct  TUpdateCellsInfoChangeOnly
 An internal structure for storing data related to counting the new information apported by some observation. More...
 

Public Types

enum  TLikelihoodMethod {
  lmMeanInformation = 0, lmRayTracing, lmConsensus, lmCellsDifference,
  lmLikelihoodField_Thrun, lmLikelihoodField_II, lmConsensusOWA
}
 The type for selecting a likelihood computation method. More...
 
typedef int16_t cellType
 The type of the map cells: More...
 
typedef uint16_t cellTypeUnsigned
 
typedef std::pair< double, mrpt::math::TPoint2DTPairLikelihoodIndex
 Auxiliary private class. More...
 
typedef int16_t cell_t
 The type of cells. More...
 
typedef detail::logoddscell_traits< int16_t > traits_t
 

Public Member Functions

const std::vector< cellType > & getRawMap () const
 Read-only access to the raw cell contents (cells are in log-odd units) More...
 
void updateCell (int x, int y, float v)
 Performs the Bayesian fusion of a new observation of a cell. More...
 
void fill (float default_value=0.5f)
 Fills all the cells with a default value. More...
 
 COccupancyGridMap2D (float min_x=-20.0f, float max_x=20.0f, float min_y=-20.0f, float max_y=20.0f, float resolution=0.05f)
 Constructor. More...
 
virtual ~COccupancyGridMap2D ()
 Destructor. More...
 
void setSize (float x_min, float x_max, float y_min, float y_max, float resolution, float default_value=0.5f)
 Change the size of gridmap, erasing all its previous contents. More...
 
void resizeGrid (float new_x_min, float new_x_max, float new_y_min, float new_y_max, float new_cells_default_value=0.5f, bool additionalMargin=true) MRPT_NO_THROWS
 Change the size of gridmap, maintaining previous contents. More...
 
double getArea () const
 Returns the area of the gridmap, in square meters. More...
 
unsigned int getSizeX () const
 Returns the horizontal size of grid map in cells count. More...
 
unsigned int getSizeY () const
 Returns the vertical size of grid map in cells count. More...
 
float getXMin () const
 Returns the "x" coordinate of left side of grid map. More...
 
float getXMax () const
 Returns the "x" coordinate of right side of grid map. More...
 
float getYMin () const
 Returns the "y" coordinate of top side of grid map. More...
 
float getYMax () const
 Returns the "y" coordinate of bottom side of grid map. More...
 
float getResolution () const
 Returns the resolution of the grid map. More...
 
int x2idx (float x) const
 Transform a coordinate value into a cell index. More...
 
int y2idx (float y) const
 
int x2idx (double x) const
 
int y2idx (double y) const
 
float idx2x (const size_t cx) const
 Transform a cell index into a coordinate value. More...
 
float idx2y (const size_t cy) const
 
int x2idx (float x, float x_min) const
 Transform a coordinate value into a cell index, using a diferent "x_min" value. More...
 
int y2idx (float y, float y_min) const
 
void setCell (int x, int y, float value)
 Change the contents [0,1] of a cell, given its index. More...
 
float getCell (int x, int y) const
 Read the real valued [0,1] contents of a cell, given its index. More...
 
cellTypegetRow (int cy)
 Access to a "row": mainly used for drawing grid as a bitmap efficiently, do not use it normally. More...
 
const cellTypegetRow (int cy) const
 Access to a "row": mainly used for drawing grid as a bitmap efficiently, do not use it normally. More...
 
void setPos (float x, float y, float value)
 Change the contents [0,1] of a cell, given its coordinates. More...
 
float getPos (float x, float y) const
 Read the real valued [0,1] contents of a cell, given its coordinates. More...
 
bool isStaticPos (float x, float y, float threshold=0.7f) const
 Returns "true" if cell is "static", i.e.if its occupancy is below a given threshold. More...
 
bool isStaticCell (int cx, int cy, float threshold=0.7f) const
 
void setBasisCell (int x, int y, uint8_t value)
 Change a cell in the "basis" maps.Used for Voronoi calculation. More...
 
unsigned char getBasisCell (int x, int y) const
 Reads a cell in the "basis" maps.Used for Voronoi calculation. More...
 
void copyMapContentFrom (const COccupancyGridMap2D &otherMap)
 copy the gridmap contents, but not all the options, from another map instance More...
 
void subSample (int downRatio)
 Performs a downsampling of the gridmap, by a given factor: resolution/=ratio. More...
 
void computeEntropy (TEntropyInfo &info) const
 Computes the entropy and related values of this grid map. More...
 
int computeClearance (int cx, int cy, int *basis_x, int *basis_y, int *nBasis, bool GetContourPoint=false) const
 Compute the clearance of a given cell, and returns its two first basis (closest obstacle) points.Used to build Voronoi and critical points. More...
 
float computeClearance (float x, float y, float maxSearchDistance) const
 An alternative method for computing the clearance of a given location (in meters). More...
 
float computePathCost (float x1, float y1, float x2, float y2) const
 Compute the 'cost' of traversing a segment of the map according to the occupancy of traversed cells. More...
 
double computeLikelihoodField_Thrun (const CPointsMap *pm, const mrpt::poses::CPose2D *relativePose=NULL)
 Computes the likelihood [0,1] of a set of points, given the current grid map as reference. More...
 
double computeLikelihoodField_II (const CPointsMap *pm, const mrpt::poses::CPose2D *relativePose=NULL)
 Computes the likelihood [0,1] of a set of points, given the current grid map as reference. More...
 
bool saveAsBitmapFile (const std::string &file) const
 Saves the gridmap as a graphical file (BMP,PNG,...). More...
 
template<class CLANDMARKSMAP >
bool saveAsBitmapFileWithLandmarks (const std::string &file, const CLANDMARKSMAP *landmarks, bool addTextLabels=false, const mrpt::utils::TColor &marks_color=mrpt::utils::TColor(0, 0, 255)) const
 Saves the gridmap as a graphical bitmap file, 8 bit gray scale, 1 pixel is 1 cell, and with an overlay of landmarks. More...
 
void getAsImage (utils::CImage &img, bool verticalFlip=false, bool forceRGB=false, bool tricolor=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) If "tricolor" is true, only three gray levels will appear in the image: gray for unobserved cells, and black/white for occupied/empty cells respectively. More...
 
void getAsImageFiltered (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) - This method filters the image for easy feature detection If "tricolor" is true, only three gray levels will appear in the image: gray for unobserved cells, and black/white for occupied/empty cells respectively. More...
 
void getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
 Returns a 3D plane with its texture being the occupancy grid and transparency proportional to "uncertainty" (i.e. More...
 
void getAsPointCloud (mrpt::maps::CSimplePointsMap &pm, const float occup_threshold=0.5f) const
 Get a point cloud with all (border) occupied cells as points. More...
 
bool isEmpty () const MRPT_OVERRIDE
 Returns true upon map construction or after calling clear(), the return changes to false upon successful insertObservation() or any other method to load data in the map. More...
 
bool loadFromBitmapFile (const std::string &file, float resolution, float xCentralPixel=-1, float yCentralPixel=-1)
 Load the gridmap from a image in a file (the format can be any supported by CImage::loadFromFile). More...
 
bool loadFromBitmap (const mrpt::utils::CImage &img, float resolution, float xCentralPixel=-1, float yCentralPixel=-1)
 Load the gridmap from a image in a file (the format can be any supported by CImage::loadFromFile). More...
 
virtual void determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams &params, TMatchingExtraResults &extraResults) const MRPT_OVERRIDE
 See the base class for more details: In this class it is implemented as correspondences of the passed points map to occupied cells. More...
 
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. More...
 
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). More...
 
void clear ()
 Erase all the contents of the map. More...
 
void loadFromProbabilisticPosesAndObservations (const mrpt::maps::CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map. More...
 
void loadFromSimpleMap (const mrpt::maps::CSimpleMap &Map)
 Load the map contents from a CSimpleMap object, erasing all previous content of the map. More...
 
bool insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL)
 Insert the observation information into this map. More...
 
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. More...
 
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. More...
 
double computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom)
 
virtual bool canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) const
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More...
 
bool canComputeObservationLikelihood (const mrpt::obs::CObservationPtr &obs) const
 
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. More...
 
bool canComputeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf) const
 Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More...
 
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. More...
 
virtual void auxParticleFilterCleanUp ()
 This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". More...
 
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. More...
 
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. More...
 
virtual mrpt::maps::CSimplePointsMapgetAsSimplePointsMap ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const
 Returns information about the class of an object in runtime. More...
 
virtual CObject * duplicate () const =0
 Returns a copy of the object, indepently of its class. More...
 
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). More...
 
CObject * clone () const
 Cloning interface for smart pointers. More...
 

Static Public Member Functions

static float l2p (const cellType l)
 Scales an integer representation of the log-odd into a real valued probability in [0,1], using p=exp(l)/(1+exp(l)) More...
 
static uint8_t l2p_255 (const cellType l)
 Scales an integer representation of the log-odd into a linear scale [0,255], using p=exp(l)/(1+exp(l)) More...
 
static cellType p2l (const float p)
 Scales a real valued probability in [0,1] to an integer representation of: log(p)-log(1-p) in the valid range of cellType. More...
 
static bool saveAsBitmapTwoMapsWithCorrespondences (const std::string &fileName, const COccupancyGridMap2D *m1, const COccupancyGridMap2D *m2, const mrpt::utils::TMatchingPairList &corrs)
 Saves a composite image with two gridmaps and lines representing a set of correspondences between them. More...
 
static bool saveAsEMFTwoMapsWithCorrespondences (const std::string &fileName, const COccupancyGridMap2D *m1, const COccupancyGridMap2D *m2, const mrpt::utils::TMatchingPairList &corrs)
 Saves a composite image with two gridmaps and numbers for the correspondences between them. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Public Attributes

struct MAPS_IMPEXP mrpt::maps::COccupancyGridMap2D::TUpdateCellsInfoChangeOnly updateInfoChangeOnly
 
TInsertionOptions insertionOptions
 With this struct options are provided to the observation insertion process. More...
 
mrpt::maps::COccupancyGridMap2D::TLikelihoodOptions likelihoodOptions
 
class mrpt::maps::COccupancyGridMap2D::TLikelihoodOutput likelihoodOutputs
 
struct MAPS_IMPEXP mrpt::maps::COccupancyGridMap2D::TCriticalPointsList CriticalPointsList
 
TMapGenericParams genericMapParams
 Common params to all maps. More...
 

Static Public Attributes

static const cellType OCCGRID_CELLTYPE_MIN = CLogOddsGridMap2D<cellType>::CELLTYPE_MIN
 Discrete to float conversion factors: The min/max values of the integer cell type, eg. More...
 
static const cellType OCCGRID_CELLTYPE_MAX = CLogOddsGridMap2D<cellType>::CELLTYPE_MAX
 
static const cellType OCCGRID_P2LTABLE_SIZE = CLogOddsGridMap2D<cellType>::P2LTABLE_SIZE
 
static double RAYTRACE_STEP_SIZE_IN_CELL_UNITS
 (Default:1.0) Can be set to <1 if a more fine raytracing is needed in sonarSimulator() and laserScanSimulator(), or >1 to speed it up. More...
 
static const mrpt::utils::TRuntimeClassId classCObject
 
static const int16_t CELLTYPE_MIN = -32767
 
static const int16_t CELLTYPE_MAX = 32767
 
static const int16_t P2LTABLE_SIZE = CELLTYPE_MAX
 
static const size_t LOGODDS_LUT_ENTRIES = 1<<16
 

Protected Member Functions

void freeMap ()
 Frees the dynamic memory buffers of map. More...
 
virtual void OnPostSuccesfulInsertObs (const mrpt::obs::CObservation *) MRPT_OVERRIDE
 See base class. More...
 
void setCell_nocheck (int x, int y, float value)
 Change the contents [0,1] of a cell, given its index. More...
 
float getCell_nocheck (int x, int y) const
 Read the real valued [0,1] contents of a cell, given its index. More...
 
void setRawCell (unsigned int cellIndex, cellType b)
 Changes a cell by its absolute index (Do not use it normally) More...
 
double computeObservationLikelihood_Consensus (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom)
 One of the methods that can be selected for implementing "computeObservationLikelihood" (This method is the Range-Scan Likelihood Consensus for gridmaps, see the ICRA2007 paper by Blanco et al.) More...
 
double computeObservationLikelihood_ConsensusOWA (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom)
 One of the methods that can be selected for implementing "computeObservationLikelihood". More...
 
double computeObservationLikelihood_CellsDifference (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom)
 One of the methods that can be selected for implementing "computeObservationLikelihood". More...
 
double computeObservationLikelihood_MI (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom)
 One of the methods that can be selected for implementing "computeObservationLikelihood". More...
 
double computeObservationLikelihood_rayTracing (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom)
 One of the methods that can be selected for implementing "computeObservationLikelihood". More...
 
double computeObservationLikelihood_likelihoodField_Thrun (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom)
 One of the methods that can be selected for implementing "computeObservationLikelihood". More...
 
double computeObservationLikelihood_likelihoodField_II (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom)
 One of the methods that can be selected for implementing "computeObservationLikelihood". More...
 
virtual void internal_clear () MRPT_OVERRIDE
 Clear the map: It set all cells to their default occupancy value (0.5), without changing the resolution (the grid extension is reset to the default values). More...
 
virtual bool internal_insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
 Insert the observation information into this map. More...
 
virtual void writeToStream (mrpt::utils::CStream &out, int *getVersion) const =0
 Introduces a pure virtual method responsible for writing to a CStream. More...
 
virtual void readFromStream (mrpt::utils::CStream &in, int version)=0
 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. More...
 
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. More...
 
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. More...
 

Static Protected Member Functions

static double H (double p)
 Entropy computation internal function: More...
 
static mrpt::utils::TRuntimeClassId_GetBaseClass ()
 

Protected Attributes

std::vector< cellTypemap
 Store of cell occupancy values. Order: row by row, from left to right. More...
 
uint32_t size_x
 
uint32_t size_y
 The size of the grid in cells. More...
 
float x_min
 
float x_max
 
float y_min
 
float y_max
 The limits of the grid in "units" (meters) More...
 
float resolution
 Cell size, i.e. resolution of the grid map. More...
 
std::vector< double > precomputedLikelihood
 Auxiliary variables to speed up the computation of observation likelihood values for LF method among others, at a high cost in memory (see TLikelihoodOptions::enableLikelihoodCache). More...
 
bool precomputedLikelihoodToBeRecomputed
 
mrpt::utils::CDynamicGrid< uint8_t > m_basis_map
 Used for Voronoi calculation.Same struct as "map", but contains a "0" if not a basis point. More...
 
mrpt::utils::CDynamicGrid< uint16_t > m_voronoi_diagram
 Used to store the Voronoi diagram. More...
 
bool m_is_empty
 True upon construction; used by isEmpty() More...
 
float voroni_free_threshold
 The free-cells threshold used to compute the Voronoi diagram. More...
 

Static Protected Attributes

static CLogOddsGridMapLUT< cellTypem_logodd_lut
 Lookup tables for log-odds. More...
 
static std::vector< float > entropyTable
 Internally used to speed-up entropy calculation. More...
 

Private Member Functions

double internal_computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE
 Internal method called by computeObservationLikelihood() More...
 
bool internal_canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) const MRPT_OVERRIDE
 Internal method called by canComputeObservationLikelihood() More...
 
unsigned char GetNeighborhood (int cx, int cy) const
 Returns a byte with the occupancy of the 8 sorrounding cells. More...
 
int direction2idx (int dx, int dy)
 Returns the index [0,7] of the given movement, or -1 if invalid one. More...
 

Private Attributes

int direccion_vecino_x [8]
 Used to store the 8 possible movements from a cell to the sorrounding ones.Filled in the constructor. More...
 
int direccion_vecino_y [8]
 
float min_x
 
float max_x
 
float min_y
 
float max_y
 
mrpt::maps::COccupancyGridMap2D::TInsertionOptions insertionOpts
 Observations insertion options. More...
 
mrpt::maps::COccupancyGridMap2D::TLikelihoodOptions likelihoodOpts
 Probabilistic observation likelihood options. More...
 

Friends

class CMultiMetricMap
 Backward compatible typedef. More...
 
class CMultiMetricMapPDF
 Backward compatible typedef. More...
 

Voronoi methods

void setVoroniClearance (int cx, int cy, uint16_t dist)
 Used to set the clearance of a cell, while building the Voronoi diagram. More...
 
void buildVoronoiDiagram (float threshold, float robot_size, int x1=0, int x2=0, int y1=0, int y2=0)
 Build the Voronoi diagram of the grid map. More...
 
uint16_t getVoroniClearance (int cx, int cy) const
 Reads a the clearance of a cell (in centimeters), after building the Voronoi diagram with buildVoronoiDiagram. More...
 
const mrpt::utils::CDynamicGrid< uint8_t > & getBasisMap () const
 Return the auxiliary "basis" map built while building the Voronoi diagram. More...
 
const mrpt::utils::CDynamicGrid< uint16_t > & getVoronoiDiagram () const
 Return the Voronoi diagram; each cell contains the distance to its closer obstacle, or 0 if not part of the Voronoi diagram. More...
 
void findCriticalPoints (float filter_distance)
 Builds a list with the critical points from Voronoi diagram, which must must be built before calling this method. More...
 

Sensor simulators

enum  TLaserSimulUncertaintyMethod { sumUnscented = 0, sumMonteCarlo }
 Methods for TLaserSimulUncertaintyParams in laserScanSimulatorWithUncertainty() More...
 
void laserScanSimulator (mrpt::obs::CObservation2DRangeScan &inout_Scan, const mrpt::poses::CPose2D &robotPose, float threshold=0.6f, size_t N=361, float noiseStd=0, unsigned int decimation=1, float angleNoiseStd=mrpt::utils::DEG2RAD(0)) const
 Simulates a laser range scan into the current grid map. More...
 
void sonarSimulator (mrpt::obs::CObservationRange &inout_observation, const mrpt::poses::CPose2D &robotPose, float threshold=0.5f, float rangeNoiseStd=0.f, float angleNoiseStd=mrpt::utils::DEG2RAD(0.f)) const
 Simulates the observations of a sonar rig into the current grid map. More...
 
void simulateScanRay (const double x, const double y, const double angle_direction, float &out_range, bool &out_valid, const double max_range_meters, const float threshold_free=0.4f, const double noiseStd=.0, const double angleNoiseStd=.0) const
 Simulate just one "ray" in the grid map. More...
 
void laserScanSimulatorWithUncertainty (const TLaserSimulUncertaintyParams &in_params, TLaserSimulUncertaintyResult &out_results) const
 Like laserScanSimulatorWithUncertainty() (see it for a discussion of most parameters) but taking into account the robot pose uncertainty and generating a vector of predicted variances for each ray. More...
 

Member Typedef Documentation

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

The type of cells.

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

The type of the map cells:

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

Definition at line 80 of file maps/COccupancyGridMap2D.h.

Auxiliary private class.

Definition at line 431 of file maps/COccupancyGridMap2D.h.

typedef detail::logoddscell_traits<int16_t > mrpt::maps::CLogOddsGridMap2D< int16_t >::traits_t
inherited

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

Member Enumeration Documentation

Methods for TLaserSimulUncertaintyParams in laserScanSimulatorWithUncertainty()

Enumerator
sumUnscented 

Performs an unscented transform.

sumMonteCarlo 

Montecarlo-based estimation.

Definition at line 587 of file maps/COccupancyGridMap2D.h.

The type for selecting a likelihood computation method.

Enumerator
lmMeanInformation 
lmRayTracing 
lmConsensus 
lmCellsDifference 
lmLikelihoodField_Thrun 
lmLikelihoodField_II 
lmConsensusOWA 

Definition at line 379 of file maps/COccupancyGridMap2D.h.

Constructor & Destructor Documentation

mrpt::maps::COccupancyGridMap2D::COccupancyGridMap2D ( float  min_x = -20.0f,
float  max_x = 20.0f,
float  min_y = -20.0f,
float  max_y = 20.0f,
float  resolution = 0.05f 
)

Constructor.

virtual mrpt::maps::COccupancyGridMap2D::~COccupancyGridMap2D ( )
virtual

Destructor.

Member Function Documentation

static mrpt::utils::TRuntimeClassId* mrpt::utils::CObject::_GetBaseClass ( )
staticprotectedinherited
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::CLandmarksMap, and mrpt::maps::CMultiMetricMap.

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

void mrpt::maps::COccupancyGridMap2D::buildVoronoiDiagram ( float  threshold,
float  robot_size,
int  x1 = 0,
int  x2 = 0,
int  y1 = 0,
int  y2 = 0 
)

Build the Voronoi diagram of the grid map.

Parameters
thresholdThe threshold for binarizing the map.
robot_sizeSize in "units" (meters) of robot, approx.
x1Left coordinate of area to be computed. Default, entire map.
x2Right coordinate of area to be computed. Default, entire map.
y1Top coordinate of area to be computed. Default, entire map.
y2Bottom coordinate of area to be computed. Default, entire map.
See also
findCriticalPoints
virtual bool mrpt::maps::CMetricMap::canComputeObservationLikelihood ( const mrpt::obs::CObservation obs) const
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). See: Maps and observations compatibility matrix

Parameters
obsThe observation.
See also
computeObservationLikelihood, genericMapParams.enableObservationLikelihood
bool mrpt::maps::CMetricMap::canComputeObservationLikelihood ( const mrpt::obs::CObservationPtr &  obs) const
inherited

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

bool mrpt::maps::CMetricMap::canComputeObservationsLikelihood ( const mrpt::obs::CSensoryFrame sf) const
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). See: Maps and observations compatibility matrix

Parameters
sfThe observations.
See also
canComputeObservationLikelihood
void mrpt::maps::CMetricMap::clear ( )
inherited
CObject* mrpt::utils::CObject::clone ( ) const
inlineinherited

Cloning interface for smart pointers.

Definition at line 143 of file CObject.h.

float mrpt::maps::COccupancyGridMap2D::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.

int mrpt::maps::COccupancyGridMap2D::computeClearance ( int  cx,
int  cy,
int *  basis_x,
int *  basis_y,
int *  nBasis,
bool  GetContourPoint = false 
) const

Compute the clearance of a given cell, and returns its two first basis (closest obstacle) points.Used to build Voronoi and critical points.

Returns
The clearance of the cell, in 1/100 of "cell".
Parameters
cxThe cell index
cyThe cell index
basis_xTarget buffer for coordinates of basis, having a size of two "ints".
basis_yTarget buffer for coordinates of basis, having a size of two "ints".
nBasisThe number of found basis: Can be 0,1 or 2.
GetContourPointIf "true" the basis are not returned, but the closest free cells.Default at false.
See also
Build_VoronoiDiagram
float mrpt::maps::COccupancyGridMap2D::computeClearance ( float  x,
float  y,
float  maxSearchDistance 
) const

An alternative method for computing the clearance of a given location (in meters).

Returns
The clearance (distance to closest OCCUPIED cell), in meters.
void mrpt::maps::COccupancyGridMap2D::computeEntropy ( TEntropyInfo info) const

Computes the entropy and related values of this grid map.

The entropy is computed as the summed entropy of each cell, taking them as discrete random variables following a Bernoulli distribution:

Parameters
infoThe output information is returned here
double mrpt::maps::COccupancyGridMap2D::computeLikelihoodField_II ( const CPointsMap pm,
const mrpt::poses::CPose2D relativePose = NULL 
)

Computes the likelihood [0,1] of a set of points, given the current grid map as reference.

Parameters
pmThe points map
relativePoseThe relative pose of the points map in this map's coordinates, or NULL for (0,0,0). See "likelihoodOptions" for configuration parameters.
double mrpt::maps::COccupancyGridMap2D::computeLikelihoodField_Thrun ( const CPointsMap pm,
const mrpt::poses::CPose2D relativePose = NULL 
)

Computes the likelihood [0,1] of a set of points, given the current grid map as reference.

Parameters
pmThe points map
relativePoseThe relative pose of the points map in this map's coordinates, or NULL for (0,0,0). See "likelihoodOptions" for configuration parameters.
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.

See: Maps and observations compatibility matrix

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

double mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_CellsDifference ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose2D takenFrom 
)
protected

One of the methods that can be selected for implementing "computeObservationLikelihood".

double mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_Consensus ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose2D takenFrom 
)
protected

One of the methods that can be selected for implementing "computeObservationLikelihood" (This method is the Range-Scan Likelihood Consensus for gridmaps, see the ICRA2007 paper by Blanco et al.)

double mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_ConsensusOWA ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose2D takenFrom 
)
protected

One of the methods that can be selected for implementing "computeObservationLikelihood".

TODO: This method is described in....

double mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_likelihoodField_II ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose2D takenFrom 
)
protected

One of the methods that can be selected for implementing "computeObservationLikelihood".

double mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_likelihoodField_Thrun ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose2D takenFrom 
)
protected

One of the methods that can be selected for implementing "computeObservationLikelihood".

double mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_MI ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose2D takenFrom 
)
protected

One of the methods that can be selected for implementing "computeObservationLikelihood".

double mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_rayTracing ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose2D takenFrom 
)
protected

One of the methods that can be selected for implementing "computeObservationLikelihood".

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.

See: Maps and observations compatibility matrix

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
float mrpt::maps::COccupancyGridMap2D::computePathCost ( float  x1,
float  y1,
float  x2,
float  y2 
) const

Compute the 'cost' of traversing a segment of the map according to the occupancy of traversed cells.

Returns
This returns '1-mean(traversed cells occupancy)', i.e. 0.5 for unknown cells, 1 for a free path.
void mrpt::maps::COccupancyGridMap2D::copyMapContentFrom ( const COccupancyGridMap2D otherMap)

copy the gridmap contents, but not all the options, from another map instance

Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_t >::getOccupancyGridMap2D().

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

See the base class for more details: In this class it is implemented as correspondences of the passed points map to occupied cells.

NOTICE: That the "z" dimension is ignored in the points. Clip the points as appropiated if needed before calling this method.

See also
computeMatching3DWith

Reimplemented from mrpt::maps::CMetricMap.

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.

int mrpt::maps::COccupancyGridMap2D::direction2idx ( int  dx,
int  dy 
)
private

Returns the index [0,7] of the given movement, or -1 if invalid one.

See also
direccion_vecino_x,direccion_vecino_y,GetNeighborhood
virtual CObject* mrpt::utils::CObject::duplicate ( ) const
pure virtualinherited

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

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 140 of file CObject.h.

void mrpt::maps::COccupancyGridMap2D::fill ( float  default_value = 0.5f)

Fills all the cells with a default value.

void mrpt::maps::COccupancyGridMap2D::findCriticalPoints ( float  filter_distance)

Builds a list with the critical points from Voronoi diagram, which must must be built before calling this method.

Parameters
filter_distanceThe minimum distance between two critical points.
See also
buildVoronoiDiagram
void mrpt::maps::COccupancyGridMap2D::freeMap ( )
protected

Frees the dynamic memory buffers of map.

double mrpt::maps::COccupancyGridMap2D::getArea ( ) const
inline

Returns the area of the gridmap, in square meters.

Definition at line 214 of file maps/COccupancyGridMap2D.h.

References mrpt::math::square().

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

Returns a 3D plane with its texture being the occupancy grid and transparency proportional to "uncertainty" (i.e.

a value of 0.5 is fully transparent)

Implements mrpt::maps::CMetricMap.

void mrpt::maps::COccupancyGridMap2D::getAsImage ( utils::CImage img,
bool  verticalFlip = false,
bool  forceRGB = false,
bool  tricolor = 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) If "tricolor" is true, only three gray levels will appear in the image: gray for unobserved cells, and black/white for occupied/empty cells respectively.

See also
getAsImageFiltered
void mrpt::maps::COccupancyGridMap2D::getAsImageFiltered ( 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) - This method filters the image for easy feature detection If "tricolor" is true, only three gray levels will appear in the image: gray for unobserved cells, and black/white for occupied/empty cells respectively.

See also
getAsImage
void mrpt::maps::COccupancyGridMap2D::getAsPointCloud ( mrpt::maps::CSimplePointsMap pm,
const float  occup_threshold = 0.5f 
) const

Get a point cloud with all (border) occupied cells as points.

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::CPointsMap, mrpt::maps::CMultiMetricMap, and mrpt::maps::CSimplePointsMap.

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

virtual mrpt::maps::CSimplePointsMap* mrpt::maps::CMetricMap::getAsSimplePointsMap ( )
inlinevirtualinherited
unsigned char mrpt::maps::COccupancyGridMap2D::getBasisCell ( int  x,
int  y 
) const
inline
const mrpt::utils::CDynamicGrid<uint8_t>& mrpt::maps::COccupancyGridMap2D::getBasisMap ( ) const
inline

Return the auxiliary "basis" map built while building the Voronoi diagram.

See also
buildVoronoiDiagram

Definition at line 495 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::getCell ( int  x,
int  y 
) const
inline

Read the real valued [0,1] contents of a cell, given its index.

Definition at line 275 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::getCell_nocheck ( int  x,
int  y 
) const
inlineprotected

Read the real valued [0,1] contents of a cell, given its index.

Definition at line 129 of file maps/COccupancyGridMap2D.h.

unsigned char mrpt::maps::COccupancyGridMap2D::GetNeighborhood ( int  cx,
int  cy 
) const
inlineprivate

Returns a byte with the occupancy of the 8 sorrounding cells.

Parameters
cxThe cell index
cyThe cell index
See also
direction2idx
float mrpt::maps::COccupancyGridMap2D::getPos ( float  x,
float  y 
) const
inline

Read the real valued [0,1] contents of a cell, given its coordinates.

Definition at line 293 of file maps/COccupancyGridMap2D.h.

const std::vector<cellType>& mrpt::maps::COccupancyGridMap2D::getRawMap ( ) const
inline

Read-only access to the raw cell contents (cells are in log-odd units)

Definition at line 168 of file maps/COccupancyGridMap2D.h.

References exprtk::details::x().

float mrpt::maps::COccupancyGridMap2D::getResolution ( ) const
inline

Returns the resolution of the grid map.

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

cellType* mrpt::maps::COccupancyGridMap2D::getRow ( int  cy)
inline

Access to a "row": mainly used for drawing grid as a bitmap efficiently, do not use it normally.

Definition at line 284 of file maps/COccupancyGridMap2D.h.

const cellType* mrpt::maps::COccupancyGridMap2D::getRow ( int  cy) const
inline

Access to a "row": mainly used for drawing grid as a bitmap efficiently, do not use it normally.

Definition at line 287 of file maps/COccupancyGridMap2D.h.

virtual const mrpt::utils::TRuntimeClassId* mrpt::utils::CObject::GetRuntimeClass ( ) const
inlinevirtualinherited

Returns information about the class of an object in runtime.

Definition at line 131 of file CObject.h.

References CLASS_ID.

unsigned int mrpt::maps::COccupancyGridMap2D::getSizeX ( ) const
inline

Returns the horizontal size of grid map in cells count.

Definition at line 217 of file maps/COccupancyGridMap2D.h.

unsigned int mrpt::maps::COccupancyGridMap2D::getSizeY ( ) const
inline

Returns the vertical size of grid map in cells count.

Definition at line 220 of file maps/COccupancyGridMap2D.h.

uint16_t mrpt::maps::COccupancyGridMap2D::getVoroniClearance ( int  cx,
int  cy 
) const
inline

Reads a the clearance of a cell (in centimeters), after building the Voronoi diagram with buildVoronoiDiagram.

Definition at line 466 of file maps/COccupancyGridMap2D.h.

References ASSERT_ABOVEEQ_, ASSERT_BELOWEQ_, mrpt::utils::CDynamicGrid< T >::cellByIndex(), mrpt::utils::CDynamicGrid< T >::getSizeX(), and mrpt::utils::CDynamicGrid< T >::getSizeY().

const mrpt::utils::CDynamicGrid<uint16_t>& mrpt::maps::COccupancyGridMap2D::getVoronoiDiagram ( ) const
inline

Return the Voronoi diagram; each cell contains the distance to its closer obstacle, or 0 if not part of the Voronoi diagram.

See also
buildVoronoiDiagram

Definition at line 498 of file maps/COccupancyGridMap2D.h.

References mrpt::utils::DEG2RAD().

float mrpt::maps::COccupancyGridMap2D::getXMax ( ) const
inline

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

Definition at line 226 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::getXMin ( ) const
inline

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

Definition at line 223 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::getYMax ( ) const
inline

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

Definition at line 232 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::getYMin ( ) const
inline

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

Definition at line 229 of file maps/COccupancyGridMap2D.h.

static double mrpt::maps::COccupancyGridMap2D::H ( double  p)
staticprotected

Entropy computation internal function:

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.

float mrpt::maps::COccupancyGridMap2D::idx2x ( const size_t  cx) const
inline

Transform a cell index into a coordinate value.

Definition at line 245 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::idx2y ( const size_t  cy) const
inline

Definition at line 246 of file maps/COccupancyGridMap2D.h.

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. See: Maps and observations compatibility matrix

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

Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_t >::computeOccupancyGridMap2D(), mrpt::graphslam::deciders::CRangeScanRegistrationDecider< GRAPH_t >::getICPEdge(), and mrpt::graphslam::CGraphSlamEngine< GRAPH_t >::updateMapVisualization().

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.

See: Maps and observations compatibility matrix

bool mrpt::maps::COccupancyGridMap2D::internal_canComputeObservationLikelihood ( const mrpt::obs::CObservation obs) const
privatevirtual

Internal method called by canComputeObservationLikelihood()

Reimplemented from mrpt::maps::CMetricMap.

virtual void mrpt::maps::COccupancyGridMap2D::internal_clear ( )
protectedvirtual

Clear the map: It set all cells to their default occupancy value (0.5), without changing the resolution (the grid extension is reset to the default values).

Implements mrpt::maps::CMetricMap.

double mrpt::maps::COccupancyGridMap2D::internal_computeObservationLikelihood ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D takenFrom 
)
privatevirtual

Internal method called by computeObservationLikelihood()

Implements mrpt::maps::CMetricMap.

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

Insert the observation information into this map.

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)

After successfull execution, "lastObservationInsertionInfo" is updated.

See also
insertionOptions, CObservation::insertObservationInto

Implements mrpt::maps::CMetricMap.

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

Returns true upon map construction or after calling clear(), the return changes to false upon successful insertObservation() or any other method to load data in the map.

Implements mrpt::maps::CMetricMap.

bool mrpt::maps::COccupancyGridMap2D::isStaticCell ( int  cx,
int  cy,
float  threshold = 0.7f 
) const
inline

Definition at line 297 of file maps/COccupancyGridMap2D.h.

bool mrpt::maps::COccupancyGridMap2D::isStaticPos ( float  x,
float  y,
float  threshold = 0.7f 
) const
inline

Returns "true" if cell is "static", i.e.if its occupancy is below a given threshold.

Definition at line 296 of file maps/COccupancyGridMap2D.h.

static float mrpt::maps::COccupancyGridMap2D::l2p ( const cellType  l)
inlinestatic

Scales an integer representation of the log-odd into a real valued probability in [0,1], using p=exp(l)/(1+exp(l))

Definition at line 253 of file maps/COccupancyGridMap2D.h.

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

static uint8_t mrpt::maps::COccupancyGridMap2D::l2p_255 ( const cellType  l)
inlinestatic

Scales an integer representation of the log-odd into a linear scale [0,255], using p=exp(l)/(1+exp(l))

Definition at line 257 of file maps/COccupancyGridMap2D.h.

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

void mrpt::maps::COccupancyGridMap2D::laserScanSimulator ( mrpt::obs::CObservation2DRangeScan inout_Scan,
const mrpt::poses::CPose2D robotPose,
float  threshold = 0.6f,
size_t  N = 361,
float  noiseStd = 0,
unsigned int  decimation = 1,
float  angleNoiseStd = mrpt::utils::DEG2RAD(0) 
) const

Simulates a laser range scan into the current grid map.

The simulated scan is stored in a CObservation2DRangeScan object, which is also used to pass some parameters: all previously stored characteristics (as aperture,...) are taken into account for simulation. Only a few more parameters are needed. Additive gaussian noise can be optionally added to the simulated scan.

Parameters
inout_Scan[IN/OUT] This must be filled with desired parameters before calling, and will contain the scan samples on return.
robotPose[IN] The robot pose in this map coordinates. Recall that sensor pose relative to this robot pose must be specified in the observation object.
threshold[IN] The minimum occupancy threshold to consider a cell to be occupied (Default: 0.5f)
N[IN] The count of range scan "rays", by default to 361.
noiseStd[IN] The standard deviation of measurement noise. If not desired, set to 0.
decimation[IN] The rays that will be simulated are at indexes: 0, D, 2D, 3D, ... Default is D=1
angleNoiseStd[IN] The sigma of an optional Gaussian noise added to the angles at which ranges are measured (in radians).
See also
laserScanSimulatorWithUncertainty(), sonarSimulator(), COccupancyGridMap2D::RAYTRACE_STEP_SIZE_IN_CELL_UNITS
void mrpt::maps::COccupancyGridMap2D::laserScanSimulatorWithUncertainty ( const TLaserSimulUncertaintyParams in_params,
TLaserSimulUncertaintyResult out_results 
) const

Like laserScanSimulatorWithUncertainty() (see it for a discussion of most parameters) but taking into account the robot pose uncertainty and generating a vector of predicted variances for each ray.

Range uncertainty includes both, sensor noise and large non-linear effects caused by borders and discontinuities in the environment as seen from different robot poses.

Parameters
in_params[IN] Input settings. See TLaserSimulUncertaintyParams
in_params[OUT] Output range + uncertainty.
See also
laserScanSimulator(), COccupancyGridMap2D::RAYTRACE_STEP_SIZE_IN_CELL_UNITS
bool mrpt::maps::COccupancyGridMap2D::loadFromBitmap ( const mrpt::utils::CImage img,
float  resolution,
float  xCentralPixel = -1,
float  yCentralPixel = -1 
)

Load the gridmap from a image in a file (the format can be any supported by CImage::loadFromFile).

See loadFromBitmapFile() for the meaning of parameters

bool mrpt::maps::COccupancyGridMap2D::loadFromBitmapFile ( const std::string &  file,
float  resolution,
float  xCentralPixel = -1,
float  yCentralPixel = -1 
)

Load the gridmap from a image in a file (the format can be any supported by CImage::loadFromFile).

Parameters
fileThe file to be loaded.
resolutionThe size of a pixel (cell), in meters. Recall cells are always squared, so just a dimension is needed.
xCentralPixelThe x coordinate (0=first, increases left to right on the image) for the pixel which will be taken at coordinates origin (0,0). (Default: the center of the image)
yCentralPixelThe y coordinate (0=first, increases BOTTOM upwards on the image) for the pixel which will be taken at coordinates origin (0,0). (Default: the center of the image)
Returns
False on any error.
See also
loadFromBitmap
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...
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.

virtual void mrpt::maps::COccupancyGridMap2D::OnPostSuccesfulInsertObs ( const mrpt::obs::CObservation )
protectedvirtual

See base class.

Reimplemented from mrpt::maps::CMetricMap.

static cellType mrpt::maps::COccupancyGridMap2D::p2l ( const float  p)
inlinestatic

Scales a real valued probability in [0,1] to an integer representation of: log(p)-log(1-p) in the valid range of cellType.

Definition at line 261 of file maps/COccupancyGridMap2D.h.

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

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.

virtual void mrpt::utils::CSerializable::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protectedpure virtualinherited

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

Referenced by mrpt::maps::COctoMapBase< OCTREE, OCTREE_NODE >::TRenderingOptions::TRenderingOptions(), and mrpt::maps::COctoMapBase< OCTREE, OCTREE_NODE >::TLikelihoodOptions::~TLikelihoodOptions().

void mrpt::maps::COccupancyGridMap2D::resizeGrid ( float  new_x_min,
float  new_x_max,
float  new_y_min,
float  new_y_max,
float  new_cells_default_value = 0.5f,
bool  additionalMargin = true 
)

Change the size of gridmap, maintaining previous contents.

Parameters
new_x_minThe "x" coordinates of new left most side of grid.
new_x_maxThe "x" coordinates of new right most side of grid.
new_y_minThe "y" coordinates of new top most side of grid.
new_y_maxThe "y" coordinates of new bottom most side of grid.
new_cells_default_valueThe value of the new cells, tipically 0.5.
additionalMarginIf set to true (default), an additional margin of a few meters will be added to the grid, ONLY if the new coordinates are larger than current ones.
See also
setSize
bool mrpt::maps::COccupancyGridMap2D::saveAsBitmapFile ( const std::string &  file) const

Saves the gridmap as a graphical file (BMP,PNG,...).

The format will be derived from the file extension (see CImage::saveToFile )

Returns
False on any error.
template<class CLANDMARKSMAP >
bool mrpt::maps::COccupancyGridMap2D::saveAsBitmapFileWithLandmarks ( const std::string &  file,
const CLANDMARKSMAP *  landmarks,
bool  addTextLabels = false,
const mrpt::utils::TColor marks_color = mrpt::utils::TColor(0,0,255) 
) const
inline

Saves the gridmap as a graphical bitmap file, 8 bit gray scale, 1 pixel is 1 cell, and with an overlay of landmarks.

Note
The template parameter CLANDMARKSMAP is assumed to be mrpt::maps::CLandmarksMap normally.
Returns
False on any error.

Definition at line 687 of file maps/COccupancyGridMap2D.h.

References mrpt::format(), mrpt::utils::CImage::isOriginTopLeft(), MRPT_END, MRPT_OVERRIDE, MRPT_START, mrpt::utils::CCanvas::rectangle(), mrpt::utils::CImage::saveToFile(), and mrpt::utils::CCanvas::textOut().

static bool mrpt::maps::COccupancyGridMap2D::saveAsBitmapTwoMapsWithCorrespondences ( const std::string &  fileName,
const COccupancyGridMap2D m1,
const COccupancyGridMap2D m2,
const mrpt::utils::TMatchingPairList corrs 
)
static

Saves a composite image with two gridmaps and lines representing a set of correspondences between them.

See also
saveAsEMFTwoMapsWithCorrespondences
Returns
False on any error.
static bool mrpt::maps::COccupancyGridMap2D::saveAsEMFTwoMapsWithCorrespondences ( const std::string &  fileName,
const COccupancyGridMap2D m1,
const COccupancyGridMap2D m2,
const mrpt::utils::TMatchingPairList corrs 
)
static

Saves a composite image with two gridmaps and numbers for the correspondences between them.

See also
saveAsBitmapTwoMapsWithCorrespondences
Returns
False on any error.
void mrpt::maps::COccupancyGridMap2D::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.

void mrpt::maps::COccupancyGridMap2D::setBasisCell ( int  x,
int  y,
uint8_t  value 
)
inline
void mrpt::maps::COccupancyGridMap2D::setCell ( int  x,
int  y,
float  value 
)
inline

Change the contents [0,1] of a cell, given its index.

Definition at line 266 of file maps/COccupancyGridMap2D.h.

void mrpt::maps::COccupancyGridMap2D::setCell_nocheck ( int  x,
int  y,
float  value 
)
inlineprotected

Change the contents [0,1] of a cell, given its index.

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

void mrpt::maps::COccupancyGridMap2D::setPos ( float  x,
float  y,
float  value 
)
inline

Change the contents [0,1] of a cell, given its coordinates.

Definition at line 290 of file maps/COccupancyGridMap2D.h.

void mrpt::maps::COccupancyGridMap2D::setRawCell ( unsigned int  cellIndex,
cellType  b 
)
inlineprotected

Changes a cell by its absolute index (Do not use it normally)

Definition at line 133 of file maps/COccupancyGridMap2D.h.

References MRPT_OVERRIDE.

void mrpt::maps::COccupancyGridMap2D::setSize ( float  x_min,
float  x_max,
float  y_min,
float  y_max,
float  resolution,
float  default_value = 0.5f 
)

Change the size of gridmap, erasing all its previous contents.

Parameters
x_minThe "x" coordinates of left most side of grid.
x_maxThe "x" coordinates of right most side of grid.
y_minThe "y" coordinates of top most side of grid.
y_maxThe "y" coordinates of bottom most side of grid.
resolutionThe new size of cells.
default_valueThe value of cells, tipically 0.5.
See also
ResizeGrid
void mrpt::maps::COccupancyGridMap2D::setVoroniClearance ( int  cx,
int  cy,
uint16_t  dist 
)
inlineprotected

Used to set the clearance of a cell, while building the Voronoi diagram.

Definition at line 480 of file maps/COccupancyGridMap2D.h.

References ASSERT_ABOVEEQ_, ASSERT_BELOWEQ_, mrpt::utils::CDynamicGrid< T >::cellByIndex(), mrpt::utils::CDynamicGrid< T >::getSizeX(), and mrpt::utils::CDynamicGrid< T >::getSizeY().

void mrpt::maps::COccupancyGridMap2D::simulateScanRay ( const double  x,
const double  y,
const double  angle_direction,
float &  out_range,
bool &  out_valid,
const double  max_range_meters,
const float  threshold_free = 0.4f,
const double  noiseStd = .0,
const double  angleNoiseStd = .0 
) const

Simulate just one "ray" in the grid map.

This method is used internally to sonarSimulator and laserScanSimulator.

See also
COccupancyGridMap2D::RAYTRACE_STEP_SIZE_IN_CELL_UNITS
void mrpt::maps::COccupancyGridMap2D::sonarSimulator ( mrpt::obs::CObservationRange inout_observation,
const mrpt::poses::CPose2D robotPose,
float  threshold = 0.5f,
float  rangeNoiseStd = 0.f,
float  angleNoiseStd = mrpt::utils::DEG2RAD(0.f) 
) const

Simulates the observations of a sonar rig into the current grid map.

The simulated ranges are stored in a CObservationRange object, which is also used to pass in some needed parameters, as the poses of the sonar sensors onto the mobile robot.

Parameters
inout_observation[IN/OUT] This must be filled with desired parameters before calling, and will contain the simulated ranges on return.
robotPose[IN] The robot pose in this map coordinates. Recall that sensor pose relative to this robot pose must be specified in the observation object.
threshold[IN] The minimum occupancy threshold to consider a cell to be occupied (Default: 0.5f)
rangeNoiseStd[IN] The standard deviation of measurement noise. If not desired, set to 0.
angleNoiseStd[IN] The sigma of an optional Gaussian noise added to the angles at which ranges are measured (in radians).
See also
laserScanSimulator(), COccupancyGridMap2D::RAYTRACE_STEP_SIZE_IN_CELL_UNITS
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.

void mrpt::maps::COccupancyGridMap2D::subSample ( int  downRatio)

Performs a downsampling of the gridmap, by a given factor: resolution/=ratio.

void mrpt::maps::COccupancyGridMap2D::updateCell ( int  x,
int  y,
float  v 
)

Performs the Bayesian fusion of a new observation of a cell.

See also
updateInfoChangeOnly, updateCell_fast_occupied, updateCell_fast_free
static void mrpt::maps::CLogOddsGridMap2D< int16_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.

static void mrpt::maps::CLogOddsGridMap2D< int16_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.

static void mrpt::maps::CLogOddsGridMap2D< int16_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.

static void mrpt::maps::CLogOddsGridMap2D< int16_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.

virtual void mrpt::utils::CSerializable::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
protectedpure virtualinherited

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

Referenced by mrpt::maps::COctoMapBase< OCTREE, OCTREE_NODE >::TRenderingOptions::TRenderingOptions(), and mrpt::maps::COctoMapBase< OCTREE, OCTREE_NODE >::TLikelihoodOptions::~TLikelihoodOptions().

int mrpt::maps::COccupancyGridMap2D::x2idx ( float  x) const
inline

Transform a coordinate value into a cell index.

Definition at line 238 of file maps/COccupancyGridMap2D.h.

int mrpt::maps::COccupancyGridMap2D::x2idx ( double  x) const
inline

Definition at line 241 of file maps/COccupancyGridMap2D.h.

int mrpt::maps::COccupancyGridMap2D::x2idx ( float  x,
float  x_min 
) const
inline

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

Definition at line 249 of file maps/COccupancyGridMap2D.h.

int mrpt::maps::COccupancyGridMap2D::y2idx ( float  y) const
inline

Definition at line 239 of file maps/COccupancyGridMap2D.h.

int mrpt::maps::COccupancyGridMap2D::y2idx ( double  y) const
inline

Definition at line 242 of file maps/COccupancyGridMap2D.h.

int mrpt::maps::COccupancyGridMap2D::y2idx ( float  y,
float  y_min 
) const
inline

Definition at line 250 of file maps/COccupancyGridMap2D.h.

Friends And Related Function Documentation

friend class CMultiMetricMap
friend

Backward compatible typedef.

Definition at line 92 of file maps/COccupancyGridMap2D.h.

friend class CMultiMetricMapPDF
friend

Backward compatible typedef.

Definition at line 93 of file maps/COccupancyGridMap2D.h.

Member Data Documentation

const int16_t mrpt::maps::detail::logoddscell_traits< int16_t >::CELLTYPE_MAX = 32767
staticinherited

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

const int16_t mrpt::maps::detail::logoddscell_traits< int16_t >::CELLTYPE_MIN = -32767
staticinherited

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

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

Definition at line 128 of file CObject.h.

struct MAPS_IMPEXP mrpt::maps::COccupancyGridMap2D::TCriticalPointsList mrpt::maps::COccupancyGridMap2D::CriticalPointsList
int mrpt::maps::COccupancyGridMap2D::direccion_vecino_x[8]
private

Used to store the 8 possible movements from a cell to the sorrounding ones.Filled in the constructor.

See also
direction2idx

Definition at line 802 of file maps/COccupancyGridMap2D.h.

int mrpt::maps::COccupancyGridMap2D::direccion_vecino_y[8]
private

Definition at line 802 of file maps/COccupancyGridMap2D.h.

std::vector<float> mrpt::maps::COccupancyGridMap2D::entropyTable
staticprotected

Internally used to speed-up entropy calculation.

Definition at line 121 of file maps/COccupancyGridMap2D.h.

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

Common params to all maps.

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

TInsertionOptions mrpt::maps::COccupancyGridMap2D::insertionOptions

With this struct options are provided to the observation insertion process.

See also
CObservation::insertIntoGridMap

Definition at line 376 of file maps/COccupancyGridMap2D.h.

Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_t >::computeOccupancyGridMap2D().

mrpt::maps::COccupancyGridMap2D::TInsertionOptions mrpt::maps::COccupancyGridMap2D::insertionOpts
private

Observations insertion options.

Definition at line 813 of file maps/COccupancyGridMap2D.h.

mrpt::maps::COccupancyGridMap2D::TLikelihoodOptions mrpt::maps::COccupancyGridMap2D::likelihoodOptions
mrpt::maps::COccupancyGridMap2D::TLikelihoodOptions mrpt::maps::COccupancyGridMap2D::likelihoodOpts
private

Probabilistic observation likelihood options.

Definition at line 814 of file maps/COccupancyGridMap2D.h.

class mrpt::maps::COccupancyGridMap2D::TLikelihoodOutput mrpt::maps::COccupancyGridMap2D::likelihoodOutputs
const size_t mrpt::maps::detail::logoddscell_traits< int16_t >::LOGODDS_LUT_ENTRIES = 1<<16
staticinherited

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

mrpt::utils::CDynamicGrid<uint8_t> mrpt::maps::COccupancyGridMap2D::m_basis_map
protected

Used for Voronoi calculation.Same struct as "map", but contains a "0" if not a basis point.

Definition at line 107 of file maps/COccupancyGridMap2D.h.

bool mrpt::maps::COccupancyGridMap2D::m_is_empty
protected

True upon construction; used by isEmpty()

Definition at line 114 of file maps/COccupancyGridMap2D.h.

CLogOddsGridMapLUT<cellType> mrpt::maps::COccupancyGridMap2D::m_logodd_lut
staticprotected

Lookup tables for log-odds.

Definition at line 96 of file maps/COccupancyGridMap2D.h.

mrpt::utils::CDynamicGrid<uint16_t> mrpt::maps::COccupancyGridMap2D::m_voronoi_diagram
protected

Used to store the Voronoi diagram.

Contains the distance of each cell to its closer obstacles in 1/100th distance units (i.e. in centimeters), or 0 if not into the Voronoi diagram

Definition at line 112 of file maps/COccupancyGridMap2D.h.

std::vector<cellType> mrpt::maps::COccupancyGridMap2D::map
protected

Store of cell occupancy values. Order: row by row, from left to right.

Definition at line 98 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::max_x
private

Definition at line 812 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::max_y
private

Definition at line 812 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::min_x
private

Definition at line 812 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::min_y
private

Definition at line 812 of file maps/COccupancyGridMap2D.h.

const cellType mrpt::maps::COccupancyGridMap2D::OCCGRID_CELLTYPE_MAX = CLogOddsGridMap2D<cellType>::CELLTYPE_MAX
static

Definition at line 85 of file maps/COccupancyGridMap2D.h.

const cellType mrpt::maps::COccupancyGridMap2D::OCCGRID_CELLTYPE_MIN = CLogOddsGridMap2D<cellType>::CELLTYPE_MIN
static

Discrete to float conversion factors: The min/max values of the integer cell type, eg.

[0,255] or [0,65535]

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

const cellType mrpt::maps::COccupancyGridMap2D::OCCGRID_P2LTABLE_SIZE = CLogOddsGridMap2D<cellType>::P2LTABLE_SIZE
static

Definition at line 86 of file maps/COccupancyGridMap2D.h.

const int16_t mrpt::maps::detail::logoddscell_traits< int16_t >::P2LTABLE_SIZE = CELLTYPE_MAX
staticinherited

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

std::vector<double> mrpt::maps::COccupancyGridMap2D::precomputedLikelihood
protected

Auxiliary variables to speed up the computation of observation likelihood values for LF method among others, at a high cost in memory (see TLikelihoodOptions::enableLikelihoodCache).

Definition at line 103 of file maps/COccupancyGridMap2D.h.

bool mrpt::maps::COccupancyGridMap2D::precomputedLikelihoodToBeRecomputed
protected

Definition at line 104 of file maps/COccupancyGridMap2D.h.

double mrpt::maps::COccupancyGridMap2D::RAYTRACE_STEP_SIZE_IN_CELL_UNITS
static

(Default:1.0) Can be set to <1 if a more fine raytracing is needed in sonarSimulator() and laserScanSimulator(), or >1 to speed it up.

Definition at line 88 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::resolution
protected

Cell size, i.e. resolution of the grid map.

See COccupancyGridMap2D::COccupancyGridMap2D.

Definition at line 101 of file maps/COccupancyGridMap2D.h.

uint32_t mrpt::maps::COccupancyGridMap2D::size_x
protected

Definition at line 99 of file maps/COccupancyGridMap2D.h.

uint32_t mrpt::maps::COccupancyGridMap2D::size_y
protected

The size of the grid in cells.

Definition at line 99 of file maps/COccupancyGridMap2D.h.

struct MAPS_IMPEXP mrpt::maps::COccupancyGridMap2D::TUpdateCellsInfoChangeOnly mrpt::maps::COccupancyGridMap2D::updateInfoChangeOnly
float mrpt::maps::COccupancyGridMap2D::voroni_free_threshold
protected

The free-cells threshold used to compute the Voronoi diagram.

Definition at line 118 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::x_max
protected

Definition at line 100 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::x_min
protected

Definition at line 100 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::y_max
protected

The limits of the grid in "units" (meters)

Definition at line 100 of file maps/COccupancyGridMap2D.h.

float mrpt::maps::COccupancyGridMap2D::y_min
protected

Definition at line 100 of file maps/COccupancyGridMap2D.h.




Page generated by Doxygen 1.8.11 for MRPT 1.5.0 Git: 23811f3 Mon Apr 24 03:24:28 2017 +0200 at Tue Apr 25 00:00:31 CEST 2017