RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
rtabmap::LocalGridMaker Class Reference

Builds per-node local occupancy grids from laser scans or depth clouds. More...

#include <LocalGridMaker.h>

Public Member Functions

 LocalGridMaker (const ParametersMap &parameters=ParametersMap())
 Constructs with parseParameters() on parameters (or defaults).
 
virtual void parseParameters (const ParametersMap &parameters)
 Updates grid settings from Grid/ entries in parameters.
 
float getCellSize () const
 
bool isGridFromDepth () const
 
bool isMapFrameProjection () const
 
template<typename PointT >
pcl::PointCloud< PointT >::Ptr segmentCloud (const typename pcl::PointCloud< PointT >::Ptr &cloud, const pcl::IndicesPtr &indices, const Transform &pose, const cv::Point3f &viewPoint, pcl::IndicesPtr &groundIndices, pcl::IndicesPtr &obstaclesIndices, pcl::IndicesPtr *flatObstacles=0) const
 Segments a point cloud into ground and obstacle indices.
 
void createLocalMap (const Signature &node, cv::Mat &groundCells, cv::Mat &obstacleCells, cv::Mat &emptyCells, cv::Point3f &viewPoint)
 Creates a local grid from a Signature's laser scan or depth data.
 
void createLocalMap (const LaserScan &cloud, const Transform &pose, cv::Mat &groundCells, cv::Mat &obstacleCells, cv::Mat &emptyCells, cv::Point3f &viewPointInOut) const
 Creates a local grid from a 3D (or organized) LaserScan.
 

Protected Attributes

ParametersMap parameters_
 
unsigned int cloudDecimation_
 
float rangeMax_
 
float rangeMin_
 
std::vector< float > roiRatios_
 
float footprintLength_
 
float footprintWidth_
 
float footprintHeight_
 
int scanDecimation_
 
float cellSize_
 
bool preVoxelFiltering_
 
int occupancySensor_
 
bool projMapFrame_
 
float maxObstacleHeight_
 
int normalKSearch_
 
float groundNormalsUp_
 
float maxGroundAngle_
 
float clusterRadius_
 
int minClusterSize_
 
bool flatObstaclesDetected_
 
float minGroundHeight_
 
float maxGroundHeight_
 
bool normalsSegmentation_
 
bool grid3D_
 
bool groundIsObstacle_
 
float noiseFilteringRadius_
 
int noiseFilteringMinNeighbors_
 
bool scan2dUnknownSpaceFilled_
 
bool rayTracing_
 

Detailed Description

Builds per-node local occupancy grids from laser scans or depth clouds.

Configured via Grid/ parameters (parseParameters()). Used by Memory to populate LocalGrid cells (ground / obstacles / empty) stored on SensorData and cached in LocalGridCache for global maps (OccupancyGrid, OctoMap, GridMap).

Sensor source (Grid/Sensor, isGridFromDepth()):

  • 0 — laser scan only
  • 1 — depth image(s) only (default)
  • 2 — laser scan and depth

2D laser path: projects a 2D LaserScan with util3d::occupancy2DFromLaserScan().

3D path: segments the scan/cloud into ground and obstacles (segmentCloud()), then outputs LocalGrid cell matrices (2D projection or 3D cells per Grid/3D).

See also
LocalGrid
Memory

Definition at line 64 of file LocalGridMaker.h.

Member Function Documentation

◆ getCellSize()

float rtabmap::LocalGridMaker::getCellSize ( ) const
inline
Returns
Current Grid/CellSize (m).

Definition at line 75 of file LocalGridMaker.h.

◆ isGridFromDepth()

bool rtabmap::LocalGridMaker::isGridFromDepth ( ) const
inline
Returns
True if occupancy is built from depth (Grid/Sensor is 1 or 2).

Definition at line 77 of file LocalGridMaker.h.

◆ isMapFrameProjection()

bool rtabmap::LocalGridMaker::isMapFrameProjection ( ) const
inline
Returns
True if Grid/MapFrameProjection is enabled.

Definition at line 79 of file LocalGridMaker.h.

◆ segmentCloud()

template<typename PointT >
pcl::PointCloud< PointT >::Ptr rtabmap::LocalGridMaker::segmentCloud ( const typename pcl::PointCloud< PointT >::Ptr &  cloud,
const pcl::IndicesPtr &  indices,
const Transform pose,
const cv::Point3f &  viewPoint,
pcl::IndicesPtr &  groundIndices,
pcl::IndicesPtr &  obstaclesIndices,
pcl::IndicesPtr *  flatObstacles = 0 
) const

Segments a point cloud into ground and obstacle indices.

Applies optional voxel filtering (Grid/PreVoxelFiltering, leaf size Grid/CellSize), footprint crop, height filtering, then either normal-based ground segmentation (Grid/NormalsSegmentation) or Z passthrough.

Parameters
cloudInput cloud (sensor frame, transformed internally using pose). Must be non-null; an empty cloud is allowed and returns empty outputs.
indicesSubset of cloud to process (must be non-null; empty = all points when the cloud is dense).
poseNode pose (used for map-frame projection and footprint).
viewPointSensor origin for segmentation / ray tracing.
groundIndicesOutput indices of ground points.
obstaclesIndicesOutput indices of obstacle points.
flatObstaclesOptional output for flat obstacle clusters.
Returns
Segmented cloud (voxel-downsampled when Grid/PreVoxelFiltering is true, using Grid/CellSize).

Definition at line 38 of file LocalMapMaker.hpp.

◆ createLocalMap() [1/2]

void rtabmap::LocalGridMaker::createLocalMap ( const Signature node,
cv::Mat &  groundCells,
cv::Mat &  obstacleCells,
cv::Mat &  emptyCells,
cv::Point3f &  viewPoint 
)

Creates a local grid from a Signature's laser scan or depth data.

Parameters
nodeSignature with sensor data (pose used for 3D scans).
groundCellsOutput ground cells (LocalGrid format).
obstacleCellsOutput obstacle cells.
emptyCellsOutput empty/free cells. Behavior depends on the sensor path:
  • 2D laser, laser-only mode (Grid/Sensor=0 and a 2D LaserScan): uses util3d::occupancy2DFromLaserScan() / util3d::create2DMap(). Free space along each hit beam is always ray-traced (sensor → obstacle). Grid/Scan2dUnknownSpaceFilled is separate: when true, it additionally sweeps unknown angular gaps between the first and last hit (sparse FOV / “holes” in coverage) out to Grid/RangeMax or scan max range.
  • Other cases (3D scan, depth, Grid/Sensor=2, etc.): see the LaserScan overload of createLocalMap().
viewPointOutput view point used for the grid.

◆ createLocalMap() [2/2]

void rtabmap::LocalGridMaker::createLocalMap ( const LaserScan cloud,
const Transform pose,
cv::Mat &  groundCells,
cv::Mat &  obstacleCells,
cv::Mat &  emptyCells,
cv::Point3f &  viewPointInOut 
) const

Creates a local grid from a 3D (or organized) LaserScan.

Parameters
cloudInput scan in sensor frame.
poseNode pose in map/odom frame.
groundCellsOutput ground cells.
obstacleCellsOutput obstacle cells.
emptyCellsOutput empty/free cells. Filled when Grid/RayTracing is true: 3D via OctoMap if Grid/3D and OctoMap support are enabled (Grid/RangeMax, Grid/CellSize); otherwise 2D ray fill via occupancy2DFromLaserScan when Grid/3D is false (Grid/RangeMax, Grid/CellSize).
viewPointInOutView point (may be rotated if isMapFrameProjection()).

Member Data Documentation

◆ parameters_

ParametersMap rtabmap::LocalGridMaker::parameters_
protected

Definition at line 152 of file LocalGridMaker.h.

◆ cloudDecimation_

unsigned int rtabmap::LocalGridMaker::cloudDecimation_
protected

Definition at line 154 of file LocalGridMaker.h.

◆ rangeMax_

float rtabmap::LocalGridMaker::rangeMax_
protected

Definition at line 155 of file LocalGridMaker.h.

◆ rangeMin_

float rtabmap::LocalGridMaker::rangeMin_
protected

Definition at line 156 of file LocalGridMaker.h.

◆ roiRatios_

std::vector<float> rtabmap::LocalGridMaker::roiRatios_
protected

Definition at line 157 of file LocalGridMaker.h.

◆ footprintLength_

float rtabmap::LocalGridMaker::footprintLength_
protected

Definition at line 158 of file LocalGridMaker.h.

◆ footprintWidth_

float rtabmap::LocalGridMaker::footprintWidth_
protected

Definition at line 159 of file LocalGridMaker.h.

◆ footprintHeight_

float rtabmap::LocalGridMaker::footprintHeight_
protected

Definition at line 160 of file LocalGridMaker.h.

◆ scanDecimation_

int rtabmap::LocalGridMaker::scanDecimation_
protected

Definition at line 161 of file LocalGridMaker.h.

◆ cellSize_

float rtabmap::LocalGridMaker::cellSize_
protected

Definition at line 162 of file LocalGridMaker.h.

◆ preVoxelFiltering_

bool rtabmap::LocalGridMaker::preVoxelFiltering_
protected

Definition at line 163 of file LocalGridMaker.h.

◆ occupancySensor_

int rtabmap::LocalGridMaker::occupancySensor_
protected

Definition at line 164 of file LocalGridMaker.h.

◆ projMapFrame_

bool rtabmap::LocalGridMaker::projMapFrame_
protected

Definition at line 165 of file LocalGridMaker.h.

◆ maxObstacleHeight_

float rtabmap::LocalGridMaker::maxObstacleHeight_
protected

Definition at line 166 of file LocalGridMaker.h.

◆ normalKSearch_

int rtabmap::LocalGridMaker::normalKSearch_
protected

Definition at line 167 of file LocalGridMaker.h.

◆ groundNormalsUp_

float rtabmap::LocalGridMaker::groundNormalsUp_
protected

Definition at line 168 of file LocalGridMaker.h.

◆ maxGroundAngle_

float rtabmap::LocalGridMaker::maxGroundAngle_
protected

Definition at line 169 of file LocalGridMaker.h.

◆ clusterRadius_

float rtabmap::LocalGridMaker::clusterRadius_
protected

Definition at line 170 of file LocalGridMaker.h.

◆ minClusterSize_

int rtabmap::LocalGridMaker::minClusterSize_
protected

Definition at line 171 of file LocalGridMaker.h.

◆ flatObstaclesDetected_

bool rtabmap::LocalGridMaker::flatObstaclesDetected_
protected

Definition at line 172 of file LocalGridMaker.h.

◆ minGroundHeight_

float rtabmap::LocalGridMaker::minGroundHeight_
protected

Definition at line 173 of file LocalGridMaker.h.

◆ maxGroundHeight_

float rtabmap::LocalGridMaker::maxGroundHeight_
protected

Definition at line 174 of file LocalGridMaker.h.

◆ normalsSegmentation_

bool rtabmap::LocalGridMaker::normalsSegmentation_
protected

Definition at line 175 of file LocalGridMaker.h.

◆ grid3D_

bool rtabmap::LocalGridMaker::grid3D_
protected

Definition at line 176 of file LocalGridMaker.h.

◆ groundIsObstacle_

bool rtabmap::LocalGridMaker::groundIsObstacle_
protected

Definition at line 177 of file LocalGridMaker.h.

◆ noiseFilteringRadius_

float rtabmap::LocalGridMaker::noiseFilteringRadius_
protected

Definition at line 178 of file LocalGridMaker.h.

◆ noiseFilteringMinNeighbors_

int rtabmap::LocalGridMaker::noiseFilteringMinNeighbors_
protected

Definition at line 179 of file LocalGridMaker.h.

◆ scan2dUnknownSpaceFilled_

bool rtabmap::LocalGridMaker::scan2dUnknownSpaceFilled_
protected

Definition at line 180 of file LocalGridMaker.h.

◆ rayTracing_

bool rtabmap::LocalGridMaker::rayTracing_
protected

Definition at line 181 of file LocalGridMaker.h.


The documentation for this class was generated from the following files: