DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Reading IMU data from raw (binary) data.
Note
SW Release Applicability: This tutorial is applicable to modules in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

The dwSensorIMU_processRawData() and dwSensorIMU_popFrame() functions can be used to parse raw sensor data and read the measurements in the dwIMUFrame format. dwSensorIMU_processRawData() copies parsed data, therefore the raw data can be returned after the call.

Example

The following code shows the general structure of a program reading raw data from a sensor, serializing it and parsing it.

dwSensorHandle_t imuSensor;
dwSAL_createSensor(&imuSensor, ..., ...);
dwSensor_start(imuSensor);
const uint8_t *data = nullptr;
size_t size = 0;
while(loop)
{
dwStatus status = DW_NOT_READY;
while (status == DW_NOT_READY)
{
dwSensor_readRawData(&data, &size, 1000000, imuSensor);
status = dwSensorIMU_processRawData(data, size, imuSensor);
dwSensor_returnRawData(data, imuSensor);
}
dwIMUFrame frame{};
dwSensorIMU_popFrame(&frame, imuSensor);
...
}
dwSensor_stop(imuSensor);
dwSAL_releaseSensor(&imuSensor);

For more details see Simple Sensor Recording Sample