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 the wiki (this feature was introduced in MRPT 0.6.4).
Some implemented methods are:
Definition at line 72 of file COccupancyGridMap2D.h.
#include <mrpt/slam/COccupancyGridMap2D.h>

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... | |
| 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::TPoint2D > | TPairLikelihoodIndex |
| 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 | |
| void * | operator new (size_t size) |
| void * | operator new[] (size_t size) |
| void | operator delete (void *ptr) throw () |
| void | operator delete[] (void *ptr) throw () |
| void | operator delete (void *memory, void *ptr) throw () |
| void * | operator new (size_t size, const std::nothrow_t &) throw () |
| void | operator delete (void *ptr, const std::nothrow_t &) throw () |
| 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... | |
| 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... | |
| void | fill (float default_value=0.5f) |
| Fills all the cells with a default value. 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... | |
| cellType * | getRow (int cy) |
| Access to a "row": mainly used for drawing grid as a bitmap efficiently, do not use it normally. More... | |
| const cellType * | getRow (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 | 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 | computeObservationLikelihood (const CObservation *obs, const CPose3D &takenFrom) |
| Computes the log-likelihood of a given observation given an arbitrary robot 3D pose. More... | |
| bool | canComputeObservationLikelihood (const CObservation *obs) |
| Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More... | |
| double | computeLikelihoodField_Thrun (const CPointsMap *pm, const 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 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 |
| Returns a 3D plane with its texture being the occupancy grid and transparency proportional to "uncertainty" (i.e. More... | |
| bool | isEmpty () const |
| 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 CMetricMap *otherMap, const CPose2D &otherMapPose, TMatchingPairList &correspondences, const TMatchingParams ¶ms, TMatchingExtraResults &extraResults) const |
| 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 CMetricMap *otherMap, const CPose3D &otherMapPose, float maxDistForCorr=0.10f, float maxMahaDistForCorr=2.0f) const |
| See docs in base class: in this class this always returns 0. More... | |
| void | saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const |
| 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 CSimpleMap &Map) |
| Load the map contents from a CSimpleMap object, erasing all previous content of the map. More... | |
| void | loadFromSimpleMap (const CSimpleMap &Map) |
| Load the map contents from a CSimpleMap object, erasing all previous content of the map. More... | |
| bool | insertObservation (const CObservation *obs, const CPose3D *robotPose=NULL) |
| Insert the observation information into this map. More... | |
| bool | insertObservationPtr (const CObservationPtr &obs, const CPose3D *robotPose=NULL) |
| A wrapper for smart pointers, just calls the non-smart pointer version. More... | |
| double | computeObservationLikelihood (const CObservation *obs, const CPose2D &takenFrom) |
| Computes the log-likelihood of a given observation given an arbitrary robot 2D pose. More... | |
| bool | canComputeObservationLikelihood (const CObservationPtr &obs) |
| double | computeObservationsLikelihood (const CSensoryFrame &sf, const CPose2D &takenFrom) |
| Returns the sum of the log-likelihoods of each individual observation within a mrpt::slam::CSensoryFrame. More... | |
| bool | canComputeObservationsLikelihood (const CSensoryFrame &sf) |
| Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More... | |
| virtual void | determineMatching3D (const CMetricMap *otherMap, const CPose3D &otherMapPose, TMatchingPairList &correspondences, const TMatchingParams ¶ms, 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 CSimplePointsMap * | getAsSimplePointsMap () 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 CSimplePointsMap * | getAsSimplePointsMap () |
| 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... | |
Sensor simulators | |
| void | laserScanSimulator (CObservation2DRangeScan &inout_Scan, const CPose2D &robotPose, float threshold=0.5f, size_t N=361, float noiseStd=0, unsigned int decimation=1, float angleNoiseStd=DEG2RAD(0)) const |
| Simulates a laser range scan into the current grid map. More... | |
| void | sonarSimulator (CObservationRange &inout_observation, const CPose2D &robotPose, float threshold=0.5f, float rangeNoiseStd=0, float angleNoiseStd=DEG2RAD(0)) 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 unsigned int max_ray_len, const float threshold_free=0.5f, const double noiseStd=0, const double angleNoiseStd=0) const |
| Simulate just one "ray" in the grid map. More... | |
Static Public Member Functions | |
| static void * | operator new (size_t size, void *ptr) |
| 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 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 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::slam::COccupancyGridMap2D::TUpdateCellsInfoChangeOnly | updateInfoChangeOnly |
| TInsertionOptions | insertionOptions |
| With this struct options are provided to the observation insertion process. More... | |
| mrpt::slam::COccupancyGridMap2D::TLikelihoodOptions | likelihoodOptions |
| class mrpt::slam::COccupancyGridMap2D::TLikelihoodOutput | likelihoodOutputs |
| struct MAPS_IMPEXP mrpt::slam::COccupancyGridMap2D::TCriticalPointsList | CriticalPointsList |
| bool | m_disableSaveAs3DObject |
| When set to true (default=false), calling "getAs3DObject" will have no effects. 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 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 |
RTTI stuff | |
| static const mrpt::utils::TRuntimeClassId | classCMetricMap |
RTTI stuff | |
| static const mrpt::utils::TRuntimeClassId | classCSerializable |
Protected Member Functions | |
| virtual void | OnPostSuccesfulInsertObs (const CObservation *) |
| See base class. More... | |
| void | freeMap () |
| Frees the dynamic memory buffers of map. 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 CObservation *obs, const 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 CObservation *obs, const CPose2D &takenFrom) |
| One of the methods that can be selected for implementing "computeObservationLikelihood" TODO: This method is described in.... More... | |
| double | computeObservationLikelihood_CellsDifference (const CObservation *obs, const CPose2D &takenFrom) |
| One of the methods that can be selected for implementing "computeObservationLikelihood". More... | |
| double | computeObservationLikelihood_MI (const CObservation *obs, const CPose2D &takenFrom) |
| One of the methods that can be selected for implementing "computeObservationLikelihood". More... | |
| double | computeObservationLikelihood_rayTracing (const CObservation *obs, const CPose2D &takenFrom) |
| One of the methods that can be selected for implementing "computeObservationLikelihood". More... | |
| double | computeObservationLikelihood_likelihoodField_Thrun (const CObservation *obs, const CPose2D &takenFrom) |
| One of the methods that can be selected for implementing "computeObservationLikelihood". More... | |
| double | computeObservationLikelihood_likelihoodField_II (const CObservation *obs, const CPose2D &takenFrom) |
| One of the methods that can be selected for implementing "computeObservationLikelihood". More... | |
| virtual void | internal_clear () |
| 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 CObservation *obs, const CPose3D *robotPose=NULL) |
| Insert the observation information into this map. 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... | |
CSerializable virtual methods | |
| void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const |
| Introduces a pure virtual method responsible for writing to a CStream. More... | |
| 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. More... | |
Static Protected Member Functions | |
| static double | H (double p) |
| Entropy computation internal function: More... | |
Protected Attributes | |
| std::vector< cellType > | map |
| This is the buffer for storing the cells.In this dynamic size buffer are stored the cell values as "bytes", stored row by row, from left to right cells. More... | |
| uint32_t | size_x |
| The size of the grid in cells. More... | |
| uint32_t | size_y |
| float | x_min |
| The limits of the grid in "units" (meters). More... | |
| float | x_max |
| float | y_min |
| float | y_max |
| float | resolution |
| Cell size, i.e. More... | |
| std::vector< double > | precomputedLikelihood |
| These are 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 |
| CDynamicGrid< uint8_t > | m_basis_map |
| Used for Voronoi calculation.Same struct as "map", but contains a "0" if not a basis point. More... | |
| 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 < cellType > | m_logodd_lut |
| Lookup tables for log-odds. More... | |
| static std::vector< float > | entropyTable |
| Internally used to speed-up entropy calculation. More... | |
Private Member Functions | |
| 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] |
Friends | |
| class | CMultiMetricMap |
| class | CMultiMetricMapPDF |
RTTI stuff | |
| typedef COccupancyGridMap2DPtr | SmartPtr |
| static mrpt::utils::CLASSINIT | _init_COccupancyGridMap2D |
| static mrpt::utils::TRuntimeClassId | classCOccupancyGridMap2D |
| 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. More... | |
| virtual mrpt::utils::CObject * | duplicate () const |
| Returns a copy of the object, indepently of its class. More... | |
| static mrpt::utils::CObject * | CreateObject () |
| static COccupancyGridMap2DPtr | Create () |
Voronoi methods | |
| 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 CDynamicGrid< uint8_t > & | getBasisMap () const |
| Return the auxiliary "basis" map built while building the Voronoi diagram. More... | |
| const 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... | |
| void | setVoroniClearance (int cx, int cy, uint16_t dist) |
| Used to set the clearance of a cell, while building the Voronoi diagram. More... | |
|
inherited |
The type of cells.
Definition at line 52 of file CLogOddsGridMap2D.h.
| typedef int16_t mrpt::slam::COccupancyGridMap2D::cellType |
The type of the map cells:
Definition at line 90 of file COccupancyGridMap2D.h.
| typedef uint16_t mrpt::slam::COccupancyGridMap2D::cellTypeUnsigned |
Definition at line 91 of file COccupancyGridMap2D.h.
| typedef COccupancyGridMap2DPtr mrpt::slam::COccupancyGridMap2D::SmartPtr |
A typedef for the associated smart pointer
Definition at line 82 of file COccupancyGridMap2D.h.
| typedef std::pair<double,mrpt::math::TPoint2D> mrpt::slam::COccupancyGridMap2D::TPairLikelihoodIndex |
Auxiliary private class.
Definition at line 677 of file COccupancyGridMap2D.h.
|
inherited |
Definition at line 53 of file CLogOddsGridMap2D.h.
| mrpt::slam::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 |
Destructor.
|
staticprotected |
|
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 284 of file CMetricMap.h.
| void mrpt::slam::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.
| threshold | The threshold for binarizing the map. |
| robot_size | Size in "units" (meters) of robot, approx. |
| x1 | Left coordinate of area to be computed. Default, entire map. |
| x2 | Right coordinate of area to be computed. Default, entire map. |
| y1 | Top coordinate of area to be computed. Default, entire map. |
| y2 | Bottom coordinate of area to be computed. Default, entire map. |
|
inherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
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).
| obs | The observation. |
Reimplemented from mrpt::slam::CMetricMap.
|
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).
| sf | The observations. |
|
inherited |
Erase all the contents of the map.
Referenced by mrpt::slam::CReflectivityGridMap2D::clear(), mrpt::slam::CHeightGridMap2D::clear(), and mrpt::slam::CRandomFieldGridMap2D::clear().
|
inlineinherited |
|
virtual |
See docs in base class: in this class this always returns 0.
Reimplemented from mrpt::slam::CMetricMap.
| int mrpt::slam::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.
| cx | The cell index |
| cy | The cell index |
| basis_x | Target buffer for coordinates of basis, having a size of two "ints". |
| basis_y | Target buffer for coordinates of basis, having a size of two "ints". |
| nBasis | The number of found basis: Can be 0,1 or 2. |
| GetContourPoint | If "true" the basis are not returned, but the closest free cells.Default at false. |
| float mrpt::slam::COccupancyGridMap2D::computeClearance | ( | float | x, |
| float | y, | ||
| float | maxSearchDistance | ||
| ) | const |
An alternative method for computing the clearance of a given location (in meters).
| void mrpt::slam::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:
| info | The output information is returned here. |
| double mrpt::slam::COccupancyGridMap2D::computeLikelihoodField_II | ( | const CPointsMap * | pm, |
| const CPose2D * | relativePose = NULL |
||
| ) |
Computes the likelihood [0,1] of a set of points, given the current grid map as reference.
| pm | The points map |
| relativePose | The relative pose of the points map in this map's coordinates, or NULL for (0,0,0). See "likelihoodOptions" for configuration parameters. |
| double mrpt::slam::COccupancyGridMap2D::computeLikelihoodField_Thrun | ( | const CPointsMap * | pm, |
| const CPose2D * | relativePose = NULL |
||
| ) |
Computes the likelihood [0,1] of a set of points, given the current grid map as reference.
| pm | The points map |
| relativePose | The relative pose of the points map in this map's coordinates, or NULL for (0,0,0). See "likelihoodOptions" for configuration parameters. |
|
inherited |
Computes the log-likelihood of a given observation given an arbitrary robot 2D pose.
| takenFrom | The robot's pose the observation is supposed to be taken from. |
| obs | The observation. |
|
virtual |
Computes the log-likelihood of a given observation given an arbitrary robot 3D pose.
| takenFrom | The robot's pose the observation is supposed to be taken from. |
| obs | The observation. |
Implements mrpt::slam::CMetricMap.
|
protected |
One of the methods that can be selected for implementing "computeObservationLikelihood".
|
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.)
|
protected |
One of the methods that can be selected for implementing "computeObservationLikelihood" TODO: This method is described in....
|
protected |
One of the methods that can be selected for implementing "computeObservationLikelihood".
|
protected |
One of the methods that can be selected for implementing "computeObservationLikelihood".
|
protected |
One of the methods that can be selected for implementing "computeObservationLikelihood".
|
protected |
One of the methods that can be selected for implementing "computeObservationLikelihood".
|
inherited |
Returns the sum of the log-likelihoods of each individual observation within a mrpt::slam::CSensoryFrame.
| takenFrom | The robot's pose the observation is supposed to be taken from. |
| sf | The set of observations in a CSensoryFrame. |
| float mrpt::slam::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.
|
static |
|
static |
|
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.
Reimplemented from mrpt::slam::CMetricMap.
|
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:
| 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. |
Reimplemented in mrpt::slam::CPointsMap.
|
private |
Returns the index [0,7] of the given movement, or -1 if invalid one.
|
virtual |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
inlineinherited |
| void mrpt::slam::COccupancyGridMap2D::fill | ( | float | default_value = 0.5f | ) |
Fills all the cells with a default value.
| void mrpt::slam::COccupancyGridMap2D::findCriticalPoints | ( | float | filter_distance | ) |
Builds a list with the critical points from Voronoi diagram, which must must be built before calling this method.
| filter_distance | The minimum distance between two critical points. |
|
protected |
Frees the dynamic memory buffers of map.
|
inline |
Returns the area of the gridmap, in square meters.
Definition at line 320 of file COccupancyGridMap2D.h.
References mrpt::utils::square().
|
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::slam::CMetricMap.
| void mrpt::slam::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.
| void mrpt::slam::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.
|
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 297 of file CMetricMap.h.
|
inlinevirtualinherited |
Reimplemented in mrpt::slam::CPointsMap, mrpt::slam::CMultiMetricMap, and mrpt::slam::CSimplePointsMap.
Definition at line 298 of file CMetricMap.h.
|
inline |
Reads a cell in the "basis" maps.Used for Voronoi calculation.
Definition at line 446 of file COccupancyGridMap2D.h.
References ASSERT_ABOVEEQ_, ASSERT_BELOWEQ_, mrpt::utils::CDynamicGrid< T >::cellByIndex(), mrpt::utils::CDynamicGrid< T >::getSizeX(), and mrpt::utils::CDynamicGrid< T >::getSizeY().
|
inline |
Return the auxiliary "basis" map built while building the Voronoi diagram.
Definition at line 751 of file COccupancyGridMap2D.h.
|
inline |
Read the real valued [0,1] contents of a cell, given its index.
Definition at line 401 of file COccupancyGridMap2D.h.
|
inlineprotected |
Read the real valued [0,1] contents of a cell, given its index.
Definition at line 163 of file COccupancyGridMap2D.h.
|
inlineprivate |
Returns a byte with the occupancy of the 8 sorrounding cells.
| cx | The cell index |
| cy | The cell index |
|
inline |
Read the real valued [0,1] contents of a cell, given its coordinates.
Definition at line 423 of file COccupancyGridMap2D.h.
|
inline |
Read-only access to the raw cell contents (cells are in log-odd units)
Definition at line 243 of file COccupancyGridMap2D.h.
|
inline |
Returns the resolution of the grid map.
Definition at line 348 of file COccupancyGridMap2D.h.
|
inline |
Access to a "row": mainly used for drawing grid as a bitmap efficiently, do not use it normally.
Definition at line 411 of file COccupancyGridMap2D.h.
|
inline |
Access to a "row": mainly used for drawing grid as a bitmap efficiently, do not use it normally.
Definition at line 415 of file COccupancyGridMap2D.h.
|
virtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::slam::CMetricMap.
|
inline |
Returns the horizontal size of grid map in cells count.
Definition at line 324 of file COccupancyGridMap2D.h.
|
inline |
Returns the vertical size of grid map in cells count.
Definition at line 328 of file COccupancyGridMap2D.h.
|
inline |
Reads a the clearance of a cell (in centimeters), after building the Voronoi diagram with buildVoronoiDiagram.
Definition at line 722 of file COccupancyGridMap2D.h.
References ASSERT_ABOVEEQ_, ASSERT_BELOWEQ_, mrpt::utils::CDynamicGrid< T >::cellByIndex(), mrpt::utils::CDynamicGrid< T >::getSizeX(), and mrpt::utils::CDynamicGrid< T >::getSizeY().
|
inline |
Return the Voronoi diagram; each cell contains the distance to its closer obstacle, or 0 if not part of the Voronoi diagram.
Definition at line 754 of file COccupancyGridMap2D.h.
|
inline |
Returns the "x" coordinate of right side of grid map.
Definition at line 336 of file COccupancyGridMap2D.h.
|
inline |
Returns the "x" coordinate of left side of grid map.
Definition at line 332 of file COccupancyGridMap2D.h.
|
inline |
Returns the "y" coordinate of bottom side of grid map.
Definition at line 344 of file COccupancyGridMap2D.h.
|
inline |
Returns the "y" coordinate of top side of grid map.
Definition at line 340 of file COccupancyGridMap2D.h.
|
staticprotected |
Entropy computation internal function:
|
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.
|
inline |
Transform a cell index into a coordinate value.
Definition at line 360 of file COccupancyGridMap2D.h.
|
inline |
Definition at line 361 of file COccupancyGridMap2D.h.
|
inherited |
Insert the observation information into this map.
This method must be implemented in derived classes.
| obs | The observation |
| robotPose | The 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use the origin. |
|
inherited |
A wrapper for smart pointers, just calls the non-smart pointer version.
|
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::slam::CMetricMap.
|
protectedvirtual |
Insert the observation information into this map.
| obs | The observation |
| robotPose | The 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.
Implements mrpt::slam::CMetricMap.
|
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::slam::CMetricMap.
|
inline |
Definition at line 428 of file COccupancyGridMap2D.h.
|
inline |
Returns "true" if cell is "static", i.e.if its occupancy is below a given threshold.
Definition at line 427 of file COccupancyGridMap2D.h.
|
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 370 of file COccupancyGridMap2D.h.
References mrpt::slam::CLogOddsGridMapLUT< TCELL >::l2p().
|
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 377 of file COccupancyGridMap2D.h.
References mrpt::slam::CLogOddsGridMapLUT< TCELL >::l2p_255().
| void mrpt::slam::COccupancyGridMap2D::laserScanSimulator | ( | CObservation2DRangeScan & | inout_Scan, |
| const CPose2D & | robotPose, | ||
| float | threshold = 0.5f, |
||
| size_t | N = 361, |
||
| float | noiseStd = 0, |
||
| unsigned int | decimation = 1, |
||
| float | angleNoiseStd = 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.
| 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, for example 0.5. |
| 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). |
| bool mrpt::slam::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).
| img | The image. Only a grayscale image will be used, so RGB components will be mixed if a color image is passed. |
| resolution | The size of a pixel (cell), in meters. Recall cells are always squared, so just a dimension is needed. |
| xCentralPixel | The "x" coordinate (0=first) for the pixel which will be taken at coordinates origin (0,0). If not supplied, it will be used the middle of the map. |
| yCentralPixel | The "y" coordinate (0=first) for the pixel which will be taken at coordinates origin (0,0). If not supplied, it will be used the middle of the map. |
| bool mrpt::slam::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).
| file | The file to be loaded. |
| resolution | The size of a pixel (cell), in meters. Recall cells are always squared, so just a dimension is needed. |
| xCentralPixel | The "x" coordinate (0=first) for the pixel which will be taken at coordinates origin (0,0). If not supplied, it will be used the middle of the map. |
| yCentralPixel | The "y" coordinate (0=first) for the pixel which will be taken at coordinates origin (0,0). If not supplied, it will be used the middle of the 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.
| std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
|
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.
| std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
Definition at line 131 of file CMetricMap.h.
|
protectedvirtual |
See base class.
Reimplemented from mrpt::slam::CMetricMap.
|
inline | ||||||||||||||
Definition at line 82 of file COccupancyGridMap2D.h.
|
inline | ||||||||||||||||||||
Definition at line 82 of file COccupancyGridMap2D.h.
|
inline | ||||||||||||||||||||
Definition at line 82 of file COccupancyGridMap2D.h.
|
inline | ||||||||||||||
Definition at line 82 of file COccupancyGridMap2D.h.
|
inlinestatic |
Definition at line 82 of file COccupancyGridMap2D.h.
|
inline | ||||||||||||||||||||
Definition at line 82 of file COccupancyGridMap2D.h.
|
inline |
Definition at line 82 of file COccupancyGridMap2D.h.
|
inline |
Definition at line 82 of file COccupancyGridMap2D.h.
|
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 384 of file COccupancyGridMap2D.h.
References mrpt::slam::CLogOddsGridMapLUT< TCELL >::p2l().
|
protectedinherited |
Called when you want this object to emit an event to all the observers currently subscribed to this object.
|
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.
| in | The input binary stream where the object data must read from. |
| version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
| std::exception | On any error, see CStream::ReadBuffer |
Implements mrpt::utils::CSerializable.
| void mrpt::slam::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.
| new_x_min | The "x" coordinates of new left most side of grid. |
| new_x_max | The "x" coordinates of new right most side of grid. |
| new_y_min | The "y" coordinates of new top most side of grid. |
| new_y_max | The "y" coordinates of new bottom most side of grid. |
| new_cells_default_value | The value of the new cells, tipically 0.5. |
| additionalMargin | If 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. |
| bool mrpt::slam::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 )
|
inline |
Saves the gridmap as a graphical bitmap file, 8 bit gray scale, 1 pixel is 1 cell, and with an overlay of landmarks.
Definition at line 901 of file COccupancyGridMap2D.h.
References mrpt::utils::TColor::black, mrpt::format(), MRPT_END, and MRPT_START.
|
static |
Saves a composite image with two gridmaps and lines representing a set of correspondences between them.
|
static |
Saves a composite image with two gridmaps and numbers for the correspondences between them.
|
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::slam::CMetricMap.
|
inline |
Change a cell in the "basis" maps.Used for Voronoi calculation.
Definition at line 432 of file COccupancyGridMap2D.h.
References ASSERT_ABOVEEQ_, ASSERT_BELOWEQ_, mrpt::utils::CDynamicGrid< T >::cellByIndex(), mrpt::utils::CDynamicGrid< T >::getSizeX(), and mrpt::utils::CDynamicGrid< T >::getSizeY().
|
inline |
Change the contents [0,1] of a cell, given its index.
Definition at line 391 of file COccupancyGridMap2D.h.
|
inlineprotected |
Change the contents [0,1] of a cell, given its index.
Definition at line 156 of file COccupancyGridMap2D.h.
|
inline |
Change the contents [0,1] of a cell, given its coordinates.
Definition at line 419 of file COccupancyGridMap2D.h.
|
inlineprotected |
Changes a cell by its absolute index (Do not use it normally)
Definition at line 170 of file COccupancyGridMap2D.h.
| void mrpt::slam::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.
| x_min | The "x" coordinates of left most side of grid. |
| x_max | The "x" coordinates of right most side of grid. |
| y_min | The "y" coordinates of top most side of grid. |
| y_max | The "y" coordinates of bottom most side of grid. |
| resolution | The new size of cells. |
| default_value | The value of cells, tipically 0.5. |
|
inlineprotected |
Used to set the clearance of a cell, while building the Voronoi diagram.
Definition at line 736 of file COccupancyGridMap2D.h.
References ASSERT_ABOVEEQ_, ASSERT_BELOWEQ_, mrpt::utils::CDynamicGrid< T >::cellByIndex(), mrpt::utils::CDynamicGrid< T >::getSizeX(), and mrpt::utils::CDynamicGrid< T >::getSizeY().
|
inline |
Simulate just one "ray" in the grid map.
This method is used internally to sonarSimulator and laserScanSimulator.
| void mrpt::slam::COccupancyGridMap2D::sonarSimulator | ( | CObservationRange & | inout_observation, |
| const CPose2D & | robotPose, | ||
| float | threshold = 0.5f, |
||
| float | rangeNoiseStd = 0, |
||
| float | angleNoiseStd = DEG2RAD(0) |
||
| ) | 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.
| 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, for example 0.5. |
| 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). |
|
virtualinherited |
Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.
Reimplemented in mrpt::slam::CPointsMap.
| void mrpt::slam::COccupancyGridMap2D::subSample | ( | int | downRatio | ) |
Performs a downsampling of the gridmap, by a given factor: resolution/=ratio.
| void mrpt::slam::COccupancyGridMap2D::updateCell | ( | int | x, |
| int | y, | ||
| float | v | ||
| ) |
Performs the Bayesian fusion of a new observation of a cell.
|
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.
| x | Cell index in X axis. |
| y | Cell index in Y axis. |
| logodd_obs | Observation of the cell, in log-odd form as transformed by p2l. |
| thres | This must be CELLTYPE_MAX-logodd_obs |
Definition at line 102 of file CLogOddsGridMap2D.h.
|
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.
| x | Cell index in X axis. |
| y | Cell index in Y axis. |
| logodd_obs | Observation of the cell, in log-odd form as transformed by p2l. |
| thres | This must be CELLTYPE_MAX-logodd_obs |
Definition at line 124 of file CLogOddsGridMap2D.h.
|
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.
| x | Cell index in X axis. |
| y | Cell index in Y axis. |
| logodd_obs | Observation of the cell, in log-odd form as transformed by p2l. |
| thres | This must be CELLTYPE_MIN+logodd_obs |
Definition at line 63 of file CLogOddsGridMap2D.h.
|
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.
| theCell | The cell to modify |
| logodd_obs | Observation of the cell, in log-odd form as transformed by p2l. |
| thres | This must be CELLTYPE_MIN+logodd_obs |
Definition at line 84 of file CLogOddsGridMap2D.h.
|
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.
| out | The output binary stream where object must be dumped. |
| getVersion | If 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. |
| std::exception | On any error, see CStream::WriteBuffer |
Implements mrpt::utils::CSerializable.
|
inline |
Transform a coordinate value into a cell index.
Definition at line 352 of file COccupancyGridMap2D.h.
|
inline |
Definition at line 355 of file COccupancyGridMap2D.h.
|
inline |
Transform a coordinate value into a cell index, using a diferent "x_min" value.
Definition at line 365 of file COccupancyGridMap2D.h.
|
inline |
Definition at line 353 of file COccupancyGridMap2D.h.
|
inline |
Definition at line 356 of file COccupancyGridMap2D.h.
|
inline |
Definition at line 366 of file COccupancyGridMap2D.h.
|
friend |
Definition at line 101 of file COccupancyGridMap2D.h.
|
friend |
Definition at line 102 of file COccupancyGridMap2D.h.
|
staticprotected |
Definition at line 82 of file COccupancyGridMap2D.h.
|
staticinherited |
Definition at line 35 of file CLogOddsGridMap2D.h.
|
staticinherited |
Definition at line 34 of file CLogOddsGridMap2D.h.
|
staticinherited |
Definition at line 88 of file CMetricMap.h.
|
staticinherited |
|
static |
Definition at line 82 of file COccupancyGridMap2D.h.
|
staticinherited |
Definition at line 38 of file CSerializable.h.
|
static |
Definition at line 82 of file COccupancyGridMap2D.h.
| struct MAPS_IMPEXP mrpt::slam::COccupancyGridMap2D::TCriticalPointsList mrpt::slam::COccupancyGridMap2D::CriticalPointsList |
|
private |
Used to store the 8 possible movements from a cell to the sorrounding ones.Filled in the constructor.
Definition at line 1027 of file COccupancyGridMap2D.h.
|
private |
Definition at line 1027 of file COccupancyGridMap2D.h.
|
staticprotected |
Internally used to speed-up entropy calculation.
Definition at line 180 of file COccupancyGridMap2D.h.
| TInsertionOptions mrpt::slam::COccupancyGridMap2D::insertionOptions |
With this struct options are provided to the observation insertion process.
Definition at line 562 of file COccupancyGridMap2D.h.
| mrpt::slam::COccupancyGridMap2D::TLikelihoodOptions mrpt::slam::COccupancyGridMap2D::likelihoodOptions |
| class mrpt::slam::COccupancyGridMap2D::TLikelihoodOutput mrpt::slam::COccupancyGridMap2D::likelihoodOutputs |
|
staticinherited |
Definition at line 37 of file CLogOddsGridMap2D.h.
|
protected |
Used for Voronoi calculation.Same struct as "map", but contains a "0" if not a basis point.
Definition at line 130 of file COccupancyGridMap2D.h.
|
inherited |
When set to true (default=false), calling "getAs3DObject" will have no effects.
Definition at line 279 of file CMetricMap.h.
|
protected |
True upon construction; used by isEmpty()
Definition at line 138 of file COccupancyGridMap2D.h.
|
staticprotected |
Lookup tables for log-odds.
Definition at line 104 of file COccupancyGridMap2D.h.
|
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 136 of file COccupancyGridMap2D.h.
|
protected |
This is the buffer for storing the cells.In this dynamic size buffer are stored the cell values as "bytes", stored row by row, from left to right cells.
Definition at line 110 of file COccupancyGridMap2D.h.
|
static |
Definition at line 96 of file COccupancyGridMap2D.h.
|
static |
Discrete to float conversion factors: The min/max values of the integer cell type, eg.
[0,255] or [0,65535]
Definition at line 95 of file COccupancyGridMap2D.h.
|
static |
Definition at line 97 of file COccupancyGridMap2D.h.
|
staticinherited |
Definition at line 36 of file CLogOddsGridMap2D.h.
|
protected |
These are 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 126 of file COccupancyGridMap2D.h.
|
protected |
Definition at line 127 of file COccupancyGridMap2D.h.
|
protected |
|
protected |
The size of the grid in cells.
Definition at line 114 of file COccupancyGridMap2D.h.
|
protected |
Definition at line 114 of file COccupancyGridMap2D.h.
| struct MAPS_IMPEXP mrpt::slam::COccupancyGridMap2D::TUpdateCellsInfoChangeOnly mrpt::slam::COccupancyGridMap2D::updateInfoChangeOnly |
|
protected |
The free-cells threshold used to compute the Voronoi diagram.
Definition at line 144 of file COccupancyGridMap2D.h.
|
protected |
Definition at line 118 of file COccupancyGridMap2D.h.
|
protected |
The limits of the grid in "units" (meters).
Definition at line 118 of file COccupancyGridMap2D.h.
|
protected |
Definition at line 118 of file COccupancyGridMap2D.h.
|
protected |
Definition at line 118 of file COccupancyGridMap2D.h.
| Page generated by Doxygen 1.8.8 for MRPT 1.2.2 SVN:Unversioned directory at Tue Oct 14 02:14:08 UTC 2014 |