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

Local occupancy grid cells for one map node (ground, obstacles, empty). More...

#include <LocalGrid.h>

Public Member Functions

 LocalGrid (const cv::Mat &ground, const cv::Mat &obstacles, const cv::Mat &empty, float cellSize, const cv::Point3f &viewPoint=cv::Point3f(0, 0, 0))
 Builds a local grid from cell matrices.
 
bool is3D () const
 

Public Attributes

cv::Mat groundCells
 Ground cells (1×N, CV_32FC2CV_32FC7, see class doc).
 
cv::Mat obstacleCells
 Obstacle cells (same layout as groundCells).
 
cv::Mat emptyCells
 Empty/free cells (same layout as groundCells).
 
float cellSize
 Cell size in meters.
 
cv::Point3f viewPoint
 View point used to build the grid.
 

Detailed Description

Local occupancy grid cells for one map node (ground, obstacles, empty).

Each layer is stored as a 1×N cv::Mat of cell coordinates in the robot/base frame. Layouts match LaserScan grid storage (LaserScan::Format):

  • CV_32FC2 (2 ch): kXY — (x, y)
  • CV_32FC3 (3 ch): kXYZ or kXYI — (x, y, z) or (x, y, intensity)
  • CV_32FC4 (4 ch): kXYZI or kXYZRGB — (x, y, z, intensity) or (x, y, z, RGB)
  • CV_32FC5 (5 ch): kXYNormal or kXYZIT — 2D (x, y, nx, ny, nz) or 3D (x, y, z, intensity, time)
  • CV_32FC6 (6 ch): kXYINormal, kXYZNormal or kXYZIRT
  • CV_32FC7 (7 ch): kXYZINormal or kXYZRGBNormal

is3D() is true when every non-empty layer is CV_32FC3, CV_32FC4 or CV_32FC6 (5-channel layers are treated as 2D by OccupancyGrid). Extra fields are not used for pose/projection. cellSize is the grid resolution in meters (must be > 0). viewPoint is the sensor/view origin used when the grid was built.

See also
LaserScan
LocalGridMaker
OccupancyGrid
LocalGridCache

Definition at line 61 of file LocalGrid.h.

Constructor & Destructor Documentation

◆ LocalGrid()

rtabmap::LocalGrid::LocalGrid ( const cv::Mat &  ground,
const cv::Mat &  obstacles,
const cv::Mat &  empty,
float  cellSize,
const cv::Point3f &  viewPoint = cv::Point3f(0, 0, 0) 
)

Builds a local grid from cell matrices.

Parameters
groundGround cell coordinates (may be empty).
obstaclesObstacle cell coordinates (may be empty).
emptyEmpty/free cell coordinates (may be empty).
cellSizeGrid cell size in meters (must be > 0).
viewPointView/sensor origin in the grid frame.

◆ ~LocalGrid()

virtual rtabmap::LocalGrid::~LocalGrid ( )
inlinevirtual

Definition at line 77 of file LocalGrid.h.

Member Function Documentation

◆ is3D()

bool rtabmap::LocalGrid::is3D ( ) const
Returns
True if every non-empty layer is CV_32FC3, CV_32FC4 or CV_32FC6 (see class doc).

Member Data Documentation

◆ groundCells

cv::Mat rtabmap::LocalGrid::groundCells

Ground cells (1×N, CV_32FC2CV_32FC7, see class doc).

Definition at line 82 of file LocalGrid.h.

◆ obstacleCells

cv::Mat rtabmap::LocalGrid::obstacleCells

Obstacle cells (same layout as groundCells).

Definition at line 83 of file LocalGrid.h.

◆ emptyCells

cv::Mat rtabmap::LocalGrid::emptyCells

Empty/free cells (same layout as groundCells).

Definition at line 84 of file LocalGrid.h.

◆ cellSize

float rtabmap::LocalGrid::cellSize

Cell size in meters.

Definition at line 85 of file LocalGrid.h.

◆ viewPoint

cv::Point3f rtabmap::LocalGrid::viewPoint

View point used to build the grid.

Definition at line 86 of file LocalGrid.h.


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