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:
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.
Holds sets of parameters for sensor creation.
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:
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:
- Try the default compiled samples with predefined sensor input data
- 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)
- 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
- Start to use DriveWorks APIs in the targeted application and platforms
For sensors specific example see: