Perception Tool Kit (PTK) API Guide

Detailed Description

Grid configuration.

The configuration structure itself also requires information about the spatial organization of the grid and, if the PTK_GRID_TYPE_USER type is used, the size of the user data to store per cell. A 2D vs 3D grid is differentiated by the value for zCells, where a value of 1 indicates that the PTK_Grid will only be used with the 2D API, while a value > 1 indicates that the PTK_Grid will only be used with the 3D API.

PTK_Grid structures are configured once based on their dimension and the type of data they store. After allocation and initialization, the type of data stored within a PTK_Grid cannot be modified safely.

The configuration structure itself also requires information about the spatial organization of the grid and, if the PTK_GRID_TYPE_USER type is used, the size of the user data to store per cell. A 2D vs 3D grid is differentiated by the value for zCells, where a value of 1 indicates that the PTK_Grid will only be used with the 2D API, while a value > 1 indicates that the PTK_Grid will only be used with the 3D API.

Collaboration diagram for PTK_GridConfig:
Collaboration graph

Data Fields

PTK_GridType type
 
uint32_t xCells
 
uint32_t yCells
 
uint32_t zCells
 
float xCellSize
 
float yCellSize
 
float zCellSize
 
float xMin
 
float yMin
 
float zMin
 
uint32_t dataSize
 

Field Documentation

◆ type

PTK_GridType PTK_GridConfig::type

The type of grid to allocate, based on the above constants.

◆ xCells

uint32_t PTK_GridConfig::xCells

Number of cells along the x axis.

◆ yCells

uint32_t PTK_GridConfig::yCells

Number of cells along the y axis.

◆ zCells

uint32_t PTK_GridConfig::zCells

Number of cells along the z axis. If the z axis is not used, set this to 1.

◆ xCellSize

float PTK_GridConfig::xCellSize

Dimension of a cell along x in meters.

◆ yCellSize

float PTK_GridConfig::yCellSize

Dimension of a cell along y in meters.

◆ zCellSize

float PTK_GridConfig::zCellSize

Dimension of a cell along z in meters. If the z axis is not used, any nonzero value is valid.

◆ xMin

float PTK_GridConfig::xMin

Real x coordinate for start of cell 0.

◆ yMin

float PTK_GridConfig::yMin

Real y coordinate for start of cell 0.

◆ zMin

float PTK_GridConfig::zMin

Real z coordinate for start of cell 0. If the z axis is not used, any value is valid.

◆ dataSize

uint32_t PTK_GridConfig::dataSize

Size of memory required to hold a value for a cell if PTK_GRID_TYPE_USER is specified for type. Otherwise, ignored.