1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page rigconfiguration_usecase1 Accessing Vehicle Properties and Sensors From a Rig File
5 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
7 The following code snippets shows the general structure of a program that uses a rig configuration and enumerate / query sensor properties.<br>
8 The rig module can be initialized from a rig file:
11 dwContextHandle_t contextHandle = DW_NULL_HANDLE;
12 dwRigHandle_t rigHandle = DW_NULL_HANDLE;
13 dwContextParameters contextParams{};
15 dwInitialize(&contextHandle, DW_VERSION, &contextParams);
17 dwRig_initializeFromFile(&rigHandle, contextHandle, rigconfigFilename);
20 Afterwards we can easily access the vehicle properties:
23 dwGenericVehicle vehicle;
24 dwRig_getGenericVehicle(&vehicle, rigHandle);
27 As well as all sensors contained in the file:
30 dwRig_getSensorCount(&sensorCount, ...);
31 for(uint32_t sensorID; sensorID < sensorCount; ++sensorID)
33 dwRig_getSensorProtocol(&sensorProtocol, sensorID, rigHandle);
34 dwRig_getSensorParameter(&sensorParameter, sensorID, rigHandle);
35 dwRig_getSensorName(&sensorName, sensorID, rigHandle);
36 dwRig_getNominalSensorToRigTransformation(&transformation, sensorID, rigHandle);
37 dwRig_getSensorToRigTransformation(&transformation, sensorID, rigHandle);
41 Finally we can release all handles:
44 dwRig_release(rigHandle);
45 dwRelease(contextHandle);
48 For the full implementation refer to @ref dwx_rig_sample