Builds per-node local occupancy grids from laser scans or depth clouds.
More...
#include <LocalGridMaker.h>
|
|
| LocalGridMaker (const ParametersMap ¶meters=ParametersMap()) |
| | Constructs with parseParameters() on parameters (or defaults).
|
| |
|
virtual void | parseParameters (const ParametersMap ¶meters) |
| | 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.
|
| |
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.
◆ getCellSize()
| float rtabmap::LocalGridMaker::getCellSize |
( |
| ) |
const |
|
inline |
◆ 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
-
| cloud | Input cloud (sensor frame, transformed internally using pose). Must be non-null; an empty cloud is allowed and returns empty outputs. |
| indices | Subset of cloud to process (must be non-null; empty = all points when the cloud is dense). |
| pose | Node pose (used for map-frame projection and footprint). |
| viewPoint | Sensor origin for segmentation / ray tracing. |
| groundIndices | Output indices of ground points. |
| obstaclesIndices | Output indices of obstacle points. |
| flatObstacles | Optional 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
-
| node | Signature with sensor data (pose used for 3D scans). |
| groundCells | Output ground cells (LocalGrid format). |
| obstacleCells | Output obstacle cells. |
| emptyCells | Output 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().
|
| viewPoint | Output 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
-
| cloud | Input scan in sensor frame. |
| pose | Node pose in map/odom frame. |
| groundCells | Output ground cells. |
| obstacleCells | Output obstacle cells. |
| emptyCells | Output 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). |
| viewPointInOut | View point (may be rotated if isMapFrameProjection()). |
◆ parameters_
◆ cloudDecimation_
| unsigned int rtabmap::LocalGridMaker::cloudDecimation_ |
|
protected |
◆ rangeMax_
| float rtabmap::LocalGridMaker::rangeMax_ |
|
protected |
◆ rangeMin_
| float rtabmap::LocalGridMaker::rangeMin_ |
|
protected |
◆ roiRatios_
| std::vector<float> rtabmap::LocalGridMaker::roiRatios_ |
|
protected |
◆ footprintLength_
| float rtabmap::LocalGridMaker::footprintLength_ |
|
protected |
◆ footprintWidth_
| float rtabmap::LocalGridMaker::footprintWidth_ |
|
protected |
◆ footprintHeight_
| float rtabmap::LocalGridMaker::footprintHeight_ |
|
protected |
◆ scanDecimation_
| int rtabmap::LocalGridMaker::scanDecimation_ |
|
protected |
◆ cellSize_
| float rtabmap::LocalGridMaker::cellSize_ |
|
protected |
◆ preVoxelFiltering_
| bool rtabmap::LocalGridMaker::preVoxelFiltering_ |
|
protected |
◆ occupancySensor_
| int rtabmap::LocalGridMaker::occupancySensor_ |
|
protected |
◆ projMapFrame_
| bool rtabmap::LocalGridMaker::projMapFrame_ |
|
protected |
◆ maxObstacleHeight_
| float rtabmap::LocalGridMaker::maxObstacleHeight_ |
|
protected |
◆ normalKSearch_
| int rtabmap::LocalGridMaker::normalKSearch_ |
|
protected |
◆ groundNormalsUp_
| float rtabmap::LocalGridMaker::groundNormalsUp_ |
|
protected |
◆ maxGroundAngle_
| float rtabmap::LocalGridMaker::maxGroundAngle_ |
|
protected |
◆ clusterRadius_
| float rtabmap::LocalGridMaker::clusterRadius_ |
|
protected |
◆ minClusterSize_
| int rtabmap::LocalGridMaker::minClusterSize_ |
|
protected |
◆ flatObstaclesDetected_
| bool rtabmap::LocalGridMaker::flatObstaclesDetected_ |
|
protected |
◆ minGroundHeight_
| float rtabmap::LocalGridMaker::minGroundHeight_ |
|
protected |
◆ maxGroundHeight_
| float rtabmap::LocalGridMaker::maxGroundHeight_ |
|
protected |
◆ normalsSegmentation_
| bool rtabmap::LocalGridMaker::normalsSegmentation_ |
|
protected |
◆ grid3D_
| bool rtabmap::LocalGridMaker::grid3D_ |
|
protected |
◆ groundIsObstacle_
| bool rtabmap::LocalGridMaker::groundIsObstacle_ |
|
protected |
◆ noiseFilteringRadius_
| float rtabmap::LocalGridMaker::noiseFilteringRadius_ |
|
protected |
◆ noiseFilteringMinNeighbors_
| int rtabmap::LocalGridMaker::noiseFilteringMinNeighbors_ |
|
protected |
◆ scan2dUnknownSpaceFilled_
| bool rtabmap::LocalGridMaker::scan2dUnknownSpaceFilled_ |
|
protected |
◆ rayTracing_
| bool rtabmap::LocalGridMaker::rayTracing_ |
|
protected |
The documentation for this class was generated from the following files: