Perception Tool Kit (PTK) API Guide
PTK Lidar Ground Point Classification

Introduction

Collaboration diagram for PTK Lidar Ground Point Classification:

Data Structures

struct  PTK_Lidar_GpcConfig
 Lidar GPC configuration parameters. More...
 

Functions

uint32_t PTK_Lidar_getGpcScratchMemSize ()
 Get the size of the scratch memory needed to be used in PTK_Lidar_performGPC() API. More...
 
uint32_t PTK_Lidar_getEstNormScratchMemSize ()
 Get the size of the scratch memory needed to be used in PTK_Lidar_estimatePointNormals() API. More...
 
int32_t PTK_Lidar_performGPC (PTK_PointCloud *pc, const PTK_LidarMeta *meta, const PTK_Lidar_GpcConfig *config, uint8_t *scratchMem, PTK_PointCloud *normals)
 Process the input point cloud and classify the points as ground or not. More...
 
int32_t PTK_Lidar_estimatePointNormals (PTK_PointCloud *__restrict src, const PTK_LidarMeta *meta, uint8_t *scratchMem, PTK_PointCloud *__restrict normals)
 Estimate the normal vectors for each point of the given cloud and write them to the normals cloud at matching indices. This requires normals to have been initialized as a point cloud with the same configuration as cloud. More...
 
void PTK_Lidar_shiftToRootENU (PTK_PointCloud *src, const PTK_LidarMeta *meta, const PTK_RigidTransform *M_ego_lidar, PTK_Position *referenceRoot, PTK_Point *translateENU)
 This transforms the given point cloud (which is assumed to have been motion distortion corrected) from its current LiDAR coordinate system to the reference ENU coordinate system defined by the position given. It also writes the matching translation vector out to be reused by the caller if necessary. More...
 

Function Documentation

◆ PTK_Lidar_getGpcScratchMemSize()

uint32_t PTK_Lidar_getGpcScratchMemSize ( )

Get the size of the scratch memory needed to be used in PTK_Lidar_performGPC() API.

Returns
Size in bytes for the scratch memory.

◆ PTK_Lidar_getEstNormScratchMemSize()

uint32_t PTK_Lidar_getEstNormScratchMemSize ( )

Get the size of the scratch memory needed to be used in PTK_Lidar_estimatePointNormals() API.

Returns
Size in bytes for the scratch memory.

◆ PTK_Lidar_performGPC()

int32_t PTK_Lidar_performGPC ( PTK_PointCloud pc,
const PTK_LidarMeta meta,
const PTK_Lidar_GpcConfig config,
uint8_t *  scratchMem,
PTK_PointCloud normals 
)

Process the input point cloud and classify the points as ground or not.

Parameters
[in]pcThe input LiDAR point cloud.
[in]metaThe input LiDAR metadata.
[in]configAlgorithm configuration.
[in]scratchMemScratch memory buffer. The size of this memory should match the value returned by PTK_Lidar_getGpcScratchMemSize() API.
[out]normalsNormal vectors written as points here.
Returns
  • PTK_ALG_RET_SUCCESS, if successful.
  • < error code, otherwise.

◆ PTK_Lidar_estimatePointNormals()

int32_t PTK_Lidar_estimatePointNormals ( PTK_PointCloud *__restrict  src,
const PTK_LidarMeta meta,
uint8_t *  scratchMem,
PTK_PointCloud *__restrict  normals 
)

Estimate the normal vectors for each point of the given cloud and write them to the normals cloud at matching indices. This requires normals to have been initialized as a point cloud with the same configuration as cloud.

Parameters
[in]srcThe input LiDAR point cloud.
[in]metaThe input LiDAR metadata.
[in]scratchMemScratch memory buffer. The size of this memory should match the value returned by PTK_Lidar_getEstNormScratchMemSize() API.
[out]normalsNormal vectors written as points here.
Returns
  • PTK_ALG_RET_SUCCESS, if successful.
  • < error code, otherwise.

◆ PTK_Lidar_shiftToRootENU()

void PTK_Lidar_shiftToRootENU ( PTK_PointCloud src,
const PTK_LidarMeta meta,
const PTK_RigidTransform M_ego_lidar,
PTK_Position referenceRoot,
PTK_Point translateENU 
)

This transforms the given point cloud (which is assumed to have been motion distortion corrected) from its current LiDAR coordinate system to the reference ENU coordinate system defined by the position given. It also writes the matching translation vector out to be reused by the caller if necessary.

Parameters
[in,out]srcThe point cloud to shift.
[in]metaThe LiDAR metadata.
[in]M_ego_lidarThe calibrated transformation matrix from LiDAR coordinates to ego coordinates.
[out]referenceRootThe reference point that defines the ENU coordinate system where we do local processing.
[out]translateENUThe translation vector from the lidar's ENU frame to the reference ENU frame is stored here for later reuse.