DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Accessing Vehicle Properties and Sensors From a Rig File

The following code snippets shows the general structure of a program that uses a rig configuration and enumerate / query sensor properties.
The rig module can be initialized from a rig file:

dwContextParameters contextParams{};
dwInitialize(&contextHandle, DW_VERSION, &contextParams);
dwRig_initializeFromFile(&rigHandle, contextHandle, rigconfigFilename);

Afterwards we can easily access the vehicle properties:

dwRig_getGenericVehicle(&vehicle, rigHandle);

As well as all sensors contained in the file:

dwRig_getSensorCount(&sensorCount, ...);
for(uint32_t sensorID; sensorID < sensorCount; ++sensorID)
{
dwRig_getSensorProtocol(&sensorProtocol, sensorID, rigHandle);
dwRig_getSensorParameter(&sensorParameter, sensorID, rigHandle);
dwRig_getSensorName(&sensorName, sensorID, rigHandle);
dwRig_getNominalSensorToRigTransformation(&transformation, sensorID, rigHandle);
dwRig_getSensorToRigTransformation(&transformation, sensorID, rigHandle);
}

Finally we can release all handles:

dwRig_release(rigHandle);
dwRelease(contextHandle);

For the full implementation refer to Rig Configuration Sample