DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Reading IMU data from raw (binary) data.

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.


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, ..., ...);
const uint8_t *data = nullptr;
size_t size = 0;
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);

For more details see Simple Sensor Recording Sample