1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page rigconfiguration_usecase1 Accessing Vehicle Properties and Sensors From a Rig File
5 The following code snippets shows the general structure of a program that uses a rig configuration and enumerate / query sensor properties.<br>
6 The rig module can be initialized from a rig file:
9 dwContextHandle_t contextHandle = DW_NULL_HANDLE;
10 dwRigHandle_t rigHandle = DW_NULL_HANDLE;
11 dwContextParameters contextParams{};
13 dwInitialize(&contextHandle, DW_VERSION, &contextParams);
15 dwRig_initializeFromFile(&rigHandle, contextHandle, rigconfigFilename);
18 Afterwards we can easily access the vehicle properties:
21 dwGenericVehicle vehicle;
22 dwRig_getGenericVehicle(&vehicle, rigHandle);
25 As well as all sensors contained in the file:
28 dwRig_getSensorCount(&sensorCount, ...);
29 for(uint32_t sensorID; sensorID < sensorCount; ++sensorID)
31 dwRig_getSensorProtocol(&sensorProtocol, sensorID, rigHandle);
32 dwRig_getSensorParameter(&sensorParameter, sensorID, rigHandle);
33 dwRig_getSensorName(&sensorName, sensorID, rigHandle);
34 dwRig_getNominalSensorToRigTransformation(&transformation, sensorID, rigHandle);
35 dwRig_getSensorToRigTransformation(&transformation, sensorID, rigHandle);
39 Finally we can release all handles:
42 dwRig_release(rigHandle);
43 dwRelease(contextHandle);
46 For the full implementation refer to @ref dwx_rig_sample