DriveWorks SDK Reference
5.8.83 Release
For Test and Development only

Replaying Sensors

To replay sensor data from the NVIDIA® DriveWorks recording, you can use the same APIs introduced earlier for creating a virtual sensor object.
For example to replay a camera recording:

dwSensorParams sensorParams{};
sensorParams.protocol = "camera.virtual";
std::string file = "video=/location/to/the/recording";
sensorParams.parameters = file.c_str();
const char8_t * protocol
Name of the protocol.
Definition: Sensors.h:99
Holds sets of parameters for sensor creation.
Definition: Sensors.h:95

Every sensor can be initialized as a virtual sensors and the parameters can be used to point to the location of the recording. Virtual sensors can be created, started and used like real sensors:

dwSAL_createSensor(&sensorHandle, sensorParams, SALhandle);
dwSensor_start(sensorHandle);
dwSensorCamera_readFrame() // for a different sensor replace "Camera" with your sensor
dwSensorCamera_returnFrame() // for a different sensor replace "Camera" with your sensor
DW_API_PUBLIC dwStatus dwSensorCamera_readFrame(dwCameraFrameHandle_t *const frameHandle, dwTime_t const timeoutUs, dwSensorHandle_t const sensor)
Reads a frame handle from the camera sensor.
DW_API_PUBLIC dwStatus dwSensorCamera_returnFrame(dwCameraFrameHandle_t *const frameHandle)
Returns a frame to the camera after it has been consumed.
DW_API_PUBLIC dwStatus dwSAL_createSensor(dwSensorHandle_t *const sensor, dwSensorParams const params, dwSALHandle_t const sal)
Creates a new sensor managed by the SAL module with the given parameters.
DW_API_PUBLIC dwStatus dwSensor_start(dwSensorHandle_t const sensor)
Starts the sensor previously successfully created with 'dwSAL_createSensor()'.

To easily replay sensor data:

  1. Try the default compiled samples with predefined sensor input data
  2. Change the input parameter of the samples to the data you want to replay. The data should be collected by the recording tools in DriveWorks. (Each sensor sample has a detailed README for usage and explanation)
  3. Read the sample codes for how to use DriveWorks APIs to replay data as virtual sensors. Read the API definition of each sensor type for details
  4. Start to use DriveWorks APIs in the targeted application and platforms

For sensors specific example see: