Perception Tool Kit (PTK) API Guide
pointCloud.h File Reference

Introduction

Declaration of structures and functions used to manipulate point clouds.

Include dependency graph for pointCloud.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PTK_PointCloudConfig
 Definition of vector meta data. More...
 
struct  PTK_PointCloud
 

Macros

#define POINT_CLOUD_H
 
#define PTK_PointCloud_getPoints(pc)   (PTK_Point*)((uint8_t*)pc + pc->pointOffset)
 Macro for getting a pointer to the point representation. More...
 
#define PTK_POINTCLOUD_INVALID_POINT   (~0U)
 Constant for marking invalid result. More...
 

Functions

uint32_t PTK_PointCloud_getSize (const PTK_PointCloudConfig *cfg)
 Compute how much memory is required to store a complete PTK_PointCloud struct matching the given configuration. More...
 
PTK_PointCloudPTK_PointCloud_init (uint8_t *memPtr, const PTK_PointCloudConfig *cfg)
 Initialize an externally allocated piece of memory to be a valid PTK_PointCloud. More...
 
void PTK_PointCloud_clear (PTK_PointCloud *pc)
 Clear a PTK_PointCloud by setting used point count to zero.. More...
 
uint32_t PTK_PointCloud_hasSpace (const PTK_PointCloud *pc, uint32_t points)
 Check if the given point cloud has enough space to accomodate the addition of points additional PTK_Points. More...
 
uint32_t PTK_PointCloud_add (PTK_PointCloud *pc, const PTK_Point *xyzw)
 Add a copy of the given point to the point cloud, if there is room. More...
 
uint32_t PTK_PointCloud_addv (PTK_PointCloud *pc, const PTK_Point *xyzw, uint32_t numPoints)
 Add a copy of each of the points in the array pv to the given point cloud, if there is enough space. If not, no points are copied. The IDs of the copied points are sequential after the first one, so only the first ID is returned. More...
 
uint32_t PTK_PointCloud_getPointCount (const PTK_PointCloud *pc)
 This returns the total number of points that have been added since PTK_PointCloud_clear() was last called. More...
 
uint32_t PTK_PointCloud_getPoint (const PTK_PointCloud *pc, uint32_t id, PTK_Point *dst)
 This copies a PTK_Point out of the point cloud into another (user-supplied) memory location. More...
 
static PTK_PointPTK_PointCloud_refPoint (PTK_PointCloud *pc, uint32_t id)
 This gets a direct pointer to a specific PTK_Point within the point cloud. More...
 
const PTK_PointPTK_PointCloud_crefPoint (const PTK_PointCloud *pc, uint32_t id)
 This gets an immutable pointer to a specific PTK_Point within the point cloud. More...
 
void PTK_PointCloud_tag (PTK_PointCloud *pc, uint32_t id, uint32_t tag)
 This sets tag bits for the point with the given identifier. More...
 
void PTK_PointCloud_untag (PTK_PointCloud *pc, uint32_t id, uint32_t tag)
 This removes tag bits for the point at the given identifier. More...
 
uint32_t PTK_PointCloud_isTagged (const PTK_PointCloud *pc, uint32_t id, uint32_t tag)
 This checks if all of the bits set in tag are also set in the tag for the specified PTK_Point. Note that the point in question may have additional tag bits set, but it may not be missing any. More...
 
uint32_t PTK_PointCloud_readTag (const PTK_PointCloud *pc, uint32_t id)
 This reads the tag for a given point identifier in the given point cloud. More...
 
static void PTK_PointCloud_copyMetaData (PTK_PointCloud *dst, const PTK_PointCloud *src)
 Copy metadata from src to dst. More...
 
uint32_t PTK_PointCloud_copy (PTK_PointCloud *dst, const PTK_PointCloud *src)
 Copy points from src to dst, appending points so long as space remains in the dst cloud. More...
 
void PTK_PointCloud_transform (PTK_PointCloud *dst, PTK_PointCloud *src, const PTK_RigidTransform *M)
 Each point in src is transformed by M and then written to the same location in dst. The tag bits are also propagated to dst, and the total number of points present in dst is updated accordingly. src and dst may point to the same PTK_PointCloud. In practice, it is most common for dst to be empty first or to have src= dst. The return value indicates the number of successfully transformed and copied points, which may be important if transforming and appending onto a non-empty cloud for detecting space limitations. More...
 
void PTK_PointCloud_scale (PTK_PointCloud *dst, PTK_PointCloud *src, float scale)
 Each point in src is scaled by scale and then written with the same id in dst. The tag bits are also propagated to dst. src and dst may point to the same PTK_PointCloud. In practice, it is most common for dst to be empty first, or to have src = dst. The return value indicates how many points were scaled and appended to dst, which may be important if appending to a non-empty point cloud for detectin space limitations. More...
 
void PTK_PointCloud_getMinMax (const PTK_PointCloud *pc, const PTK_Point *basis, float *minVal, float *maxVal, uint32_t *minId, uint32_t *maxId)
 Find PTK_Points with the minimum and maximum PTK Vector dot4 value computed with the given basis. If you are using tag bits rather than a fourth coordinate, be sure to set basis.meta.w to 0. More...
 
uint32_t PTK_PointCloud_ransacPlane (const PTK_PointCloud *pc, const uint32_t *__restrict ids, uint32_t N, float tol, uint32_t iters, float *nd, uint32_t *__restrict foundInliers)
 

Macro Definition Documentation

◆ POINT_CLOUD_H

#define POINT_CLOUD_H