DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

src/dw/sensors/docs/usecase5.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page sensors_usecase5 Replaying Sensors
4 
5 To replay sensor data from the NVIDIA<sup>&reg;</sup> DriveWorks recording, you can use the same APIs introduced earlier for creating a virtual sensor object.<br>
6 For example to replay a camera recording:
7 
8 ```{.cpp}
9 dwSensorParams sensorParams{};
10 sensorParams.protocol = "camera.virtual";
11 std::string file = "video=/location/to/the/recording";
12 sensorParams.parameters = file.c_str();
13 
14 ```
15 Every sensor can be initialized as a virtual sensors and the parameters can be used to point to the location of the recording.
16 Virtual sensors can be created, started and used like real sensors:
17 
18 ```{.cpp}
19 dwSAL_createSensor(&sensorHandle, sensorParams, SALhandle);
20 dwSensor_start(sensorHandle);
21 dwSensorCamera_readFrame() // for a different sensor replace "Camera" with your sensor
22 dwSensorCamera_returnFrame() // for a different sensor replace "Camera" with your sensor
23 ```
24 
25 To easily replay sensor data:
26 
27 1. Try the default compiled samples with predefined sensor input data
28 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)
29 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
30 4. Start to use DriveWorks APIs in the targeted application and platforms
31 
32 For sensors specific example see:
33 - @ref dwx_camera_replay_sample
34 - @ref dwx_gps_loc_sample
35 - @ref dwx_imu_loc_sample
36 - @ref dwx_lidar_replay_sample
37 - @ref dwx_radar_replay_sample