DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Reading GPS 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 dwSensorGPS_processRawData() and dwSensorGPS_popFrame() functions can be used to parse raw sensor data and read the measurements in the dwGPSFrame format. dwSensorGPS_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 gpsSensor;
dwSAL_createSensor(&gpsSensor, ..., ...);
dwSensor_start(gpsSensor);
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, gpsSensor);
status = dwSensorGPS_processRawData(data, size, gpsSensor);
dwSensor_returnRawData(data, gpsSensor);
}
dwGPSFrame frame{};
dwSensorGPS_popFrame(&frame, gpsSensor);
...
}
dwSensor_stop(gpsSensor);
dwSAL_releaseSensor(&gpsSensor);

For more details see Simple Sensor Recording Sample