Perception Tool Kit (PTK) API Guide

Introduction

Collaboration diagram for Sensor Data Player:

Functions

sensorDataPlayerInsHandle SensorDataPlayerINS_create (PTK_DBConfig *cfg, char appTags[][DBCONFIG_MAX_WORD_LEN], uint32_t numAppTags, uint32_t insSensorId, uint8_t intraFrameWait)
 Creates a sensor data player context. More...
 
void SensorDataPlayerINS_delete (sensorDataPlayerInsHandle hdl)
 Deletes a previously created context. More...
 
uint32_t SensorDataPlayerINS_get_next (sensorDataPlayerInsHandle hdl, void **dataPtr, size_t *dataSize, uint64_t *timestamp)
 Get the the record from the sensorstream whose current timestamp is smallest (next). More...
 
void SensorDataPlayerINS_set_time (sensorDataPlayerInsHandle hdl, uint64_t timestamp)
 Set time to given timestamp. This rewinds all sensorstreams to the first record after given timestamp. Also, re-initializes the INS buffer correctly. More...
 
ssHandle SensorDataPlayerINS_get_sensorstream (sensorDataPlayerInsHandle hdl, uint32_t sensorAppId)
 Get access to the sensorstream for given sensor app id. More...
 

Function Documentation

◆ SensorDataPlayerINS_create()

sensorDataPlayerInsHandle SensorDataPlayerINS_create ( PTK_DBConfig cfg,
char  appTags[][DBCONFIG_MAX_WORD_LEN],
uint32_t  numAppTags,
uint32_t  insSensorId,
uint8_t  intraFrameWait 
)

Creates a sensor data player context.

Parameters
[in]cfgdatabase configuration file specifying available sensors
[in]appTagsstring (char array) array. Sensors in cfg with appTag field matching an appTags vector entry will be used for sensor data replay. Ordering of appTags establishes a sensor enumeration for application to reference a certain sensor, i.e., sensor with app tag appTags[i] has sensor app id i.
[in]numAppTagsnumber of app tags (second dimension of appTags)
[in]insSensorIdsensor id (i.e., index in appTags vector) for the INS sensor
Returns
  • Handle to SensorDataPlayerINS object, if successful
  • NULL, otherwise

◆ SensorDataPlayerINS_delete()

void SensorDataPlayerINS_delete ( sensorDataPlayerInsHandle  hdl)

Deletes a previously created context.

Parameters
[in]hdlpointer to SensorDataPlayerINS object

◆ SensorDataPlayerINS_get_next()

uint32_t SensorDataPlayerINS_get_next ( sensorDataPlayerInsHandle  hdl,
void **  dataPtr,
size_t *  dataSize,
uint64_t *  timestamp 
)

Get the the record from the sensorstream whose current timestamp is smallest (next).

Parameters
[in]hdlpointer to SensorDataPlayerINS object
[out]dataPtrvoid pointer to data pointer to the returned record
[out]dataSizesize_t pointer to size of the returned record
[out]timestampuint64_t pointer to timestamp for the returned record
Returns
  • sensor app id of sensor returning this record.
  • MAX UINT32_T if no more records are available.

◆ SensorDataPlayerINS_set_time()

void SensorDataPlayerINS_set_time ( sensorDataPlayerInsHandle  hdl,
uint64_t  timestamp 
)

Set time to given timestamp. This rewinds all sensorstreams to the first record after given timestamp. Also, re-initializes the INS buffer correctly.

Parameters
[in]hdlpointer to SensorDataPlayerINS object
[in]timestampuint64_t timestamp to set all sensorstreams

◆ SensorDataPlayerINS_get_sensorstream()

ssHandle SensorDataPlayerINS_get_sensorstream ( sensorDataPlayerInsHandle  hdl,
uint32_t  sensorAppId 
)

Get access to the sensorstream for given sensor app id.

Parameters
[in]hdlpointer to SensorDataPlayerINS object
[in]sensorAppIdsensor's app id (refer to Constructor brief for details)
Returns
  • sensorstream handle, if stream is active
  • nullptr if sensorstream is inactive