DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

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 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
6 
7 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>
8 For example to replay a camera recording:
9 
10 ```{.cpp}
11 dwSensorParams sensorParams{};
12 sensorParams.protocol = "camera.virtual";
13 std::string file = "video=/location/to/the/recording";
14 sensorParams.parameters = file.c_str();
15 
16 ```
17 Every sensor can be initialized as a virtual sensors and the parameters can be used to point to the location of the recording.
18 Virtual sensors can be created, started and used like real sensors:
19 
20 ```{.cpp}
21 dwSAL_createSensor(&sensorHandle, sensorParams, SALhandle);
22 dwSensor_start(sensorHandle);
23 dwSensorCamera_readFrame() // for a different sensor replace "Camera" with your sensor
24 dwSensorCamera_returnFrame() // for a different sensor replace "Camera" with your sensor
25 ```
26 
27 To easily replay sensor data:
28 
29 1. Try the default compiled samples with predefined sensor input data
30 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)
31 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
32 4. Start to use DriveWorks APIs in the targeted application and platforms
33 
34 For sensors specific example see:
35 - @ref dwx_camera_replay_sample
36 - @ref dwx_gps_loc_sample
37 - @ref dwx_imu_loc_sample
38 - @ref dwx_lidar_replay_sample
39 - @ref dwx_radar_replay_sample