DriveWorks SDK Reference
5.14.77 Release
For Test and Development only

Detailed Description

Defines the IMU sensor.

Functions

DW_API_PUBLIC dwStatus dwSensorIMU_popFrame (dwIMUFrame *const frame, dwSensorHandle_t const sensor)
 Returns any IMU data previously processed through the raw data stream. More...
 
DW_API_PUBLIC dwStatus dwSensorIMU_popFrameNew (dwIMUFrameNew *const frame, dwSensorHandle_t const sensor)
 Returns any IMU Frame New previously processed through the raw data stream. More...
 
DW_API_PUBLIC dwStatus dwSensorIMU_processRawData (uint8_t const *const data, size_t const size, dwSensorHandle_t const sensor)
 Reads the IMU frame from raw data. More...
 
DW_API_PUBLIC dwStatus dwSensorIMU_processRawDataNew (uint8_t const *const data, size_t const size, dwSensorHandle_t const sensor)
 Reads the IMU frame New from raw data. More...
 
DW_API_PUBLIC dwStatus dwSensorIMU_readFrame (dwIMUFrame *const frame, dwTime_t const timeoutUs, dwSensorHandle_t const sensor)
 Reads the next IMU frame from the sensor within a given timeout. More...
 
DW_API_PUBLIC dwStatus dwSensorIMU_readFrameNew (dwIMUFrameNew *const frame, dwTime_t const timeoutUs, dwSensorHandle_t const sensor)
 Reads the next IMU frame New from the sensor within a given timeout. More...
 

Function Documentation

◆ dwSensorIMU_popFrame()

DW_API_PUBLIC dwStatus dwSensorIMU_popFrame ( dwIMUFrame *const  frame,
dwSensorHandle_t const  sensor 
)

Returns any IMU data previously processed through the raw data stream.

This happens on the CPU thread where the function is called, incurring an additional load on that thread.

Parameters
[out]framePointer to an IMU frame structure to be filled with new data.
[in]sensorSensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid.
DW_INVALID_ARGUMENTS - if given arguments are invalid.
DW_NOT_AVAILABLE - if no more data is available
DW_SUCCESS

◆ dwSensorIMU_popFrameNew()

DW_API_PUBLIC dwStatus dwSensorIMU_popFrameNew ( dwIMUFrameNew *const  frame,
dwSensorHandle_t const  sensor 
)

Returns any IMU Frame New previously processed through the raw data stream.

This happens on the CPU thread where the function is called, incurring an additional load on that thread.

Parameters
[out]framePointer to an IMU frame New structure to be filled with new data.
[in]sensorSensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid.
DW_INVALID_ARGUMENTS - if given arguments are invalid.
DW_NOT_AVAILABLE - if no more data is available
DW_SUCCESS

◆ dwSensorIMU_processRawData()

DW_API_PUBLIC dwStatus dwSensorIMU_processRawData ( uint8_t const *const  data,
size_t const  size,
dwSensorHandle_t const  sensor 
)

Reads the IMU frame from raw data.

Any processed messages can be picked up using the dwSensorIMU_readFrame() method. This happens on the CPU thread where the function is called, incurring an additional load on that thread.

Parameters
[in]dataUndecoded imu data.
[in]sizeSize in bytes of the raw data.
[in]sensorSensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid,
DW_INVALID_ARGUMENTS - if given arguments are invalid,
DW_NOT_READY - if more data needs to be passed in (loop while it returns 'DW_NOT_READY').
DW_SUCCESS

◆ dwSensorIMU_processRawDataNew()

DW_API_PUBLIC dwStatus dwSensorIMU_processRawDataNew ( uint8_t const *const  data,
size_t const  size,
dwSensorHandle_t const  sensor 
)

Reads the IMU frame New from raw data.

Any processed messages can be picked up using the dwSensorIMU_readFrameNew() method. This happens on the CPU thread where the function is called, incurring an additional load on that thread.

Parameters
[in]dataUndecoded imu data.
[in]sizeSize in bytes of the raw data.
[in]sensorSensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid,
DW_INVALID_ARGUMENTS - if given arguments are invalid,
DW_NOT_READY - if more data needs to be passed in (loop while it returns 'DW_NOT_READY').
DW_SUCCESS

◆ dwSensorIMU_readFrame()

DW_API_PUBLIC dwStatus dwSensorIMU_readFrame ( dwIMUFrame *const  frame,
dwTime_t const  timeoutUs,
dwSensorHandle_t const  sensor 
)

Reads the next IMU frame from the sensor within a given timeout.

The method blocks until either a new valid frame is received from the sensor or the given timeout is exceeded.

Parameters
[out]frameA pointer to an IMU frame structure to be filled with new data.
[in]timeoutUsTimeout, in us, to wait for a new message. Special values: DW_TIMEOUT_INFINITE - to wait infinitely. Zero - means polling of internal queue.
[in]sensorSensor handle of the IMU sensor previously created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid
DW_INVALID_ARGUMENTS - if given arguments are invalid
DW_TIME_OUT - if operation has timeout
DW_NOT_AVAILABLE - if sensor has not been started or data is not available in polling mode.
DW_END_OF_STREAM - if end of stream reached (virtual sensor only).
DW_SAL_SENSOR_ERROR - if there was an i/o or bus error.
DW_SUCCESS

◆ dwSensorIMU_readFrameNew()

DW_API_PUBLIC dwStatus dwSensorIMU_readFrameNew ( dwIMUFrameNew *const  frame,
dwTime_t const  timeoutUs,
dwSensorHandle_t const  sensor 
)

Reads the next IMU frame New from the sensor within a given timeout.

The method blocks until either a new valid frame is received from the sensor or the given timeout is exceeded.

Parameters
[out]frameA pointer to an IMU frame New structure to be filled with new data.
[in]timeoutUsTimeout, in us, to wait for a new message. Special values: DW_TIMEOUT_INFINITE - to wait infinitely. Zero - means polling of internal queue.
[in]sensorSensor handle of the IMU sensor previously created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid
DW_INVALID_ARGUMENTS - if given arguments are invalid
DW_TIME_OUT - if operation has timeout
DW_NOT_AVAILABLE - if sensor has not been started or data is not available in polling mode.
DW_END_OF_STREAM - if end of stream reached (virtual sensor only).
DW_SAL_SENSOR_ERROR - if there was an i/o or bus error.
DW_SUCCESS