DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Detailed Description

Defines the IMU sensor.

Note
SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Data Structures

struct  dwIMUFrame
 An IMU frame containing sensor readings from the IMU sensor. More...
 

Enumerations

enum  dwIMUFlags {
  DW_IMU_HEADING = 1 << 1,
  DW_IMU_ROLL = 1 << 2,
  DW_IMU_PITCH = 1 << 3,
  DW_IMU_YAW = 1 << 4,
  DW_IMU_QUATERNION_X = 1 << 5,
  DW_IMU_QUATERNION_Y = 1 << 6,
  DW_IMU_QUATERNION_Z = 1 << 7,
  DW_IMU_QUATERNION_W = 1 << 8,
  DW_IMU_ROLL_RATE = 1 << 9,
  DW_IMU_PITCH_RATE = 1 << 10,
  DW_IMU_YAW_RATE = 1 << 11,
  DW_IMU_ACCELERATION_X = 1 << 12,
  DW_IMU_ACCELERATION_Y = 1 << 13,
  DW_IMU_ACCELERATION_Z = 1 << 14,
  DW_IMU_MAGNETOMETER_X = 1 << 15,
  DW_IMU_MAGNETOMETER_Y = 1 << 16,
  DW_IMU_MAGNETOMETER_Z = 1 << 17
}
 Each flag shows if that value is valid in this IMU frame. More...
 
enum  dwIMUHeadingType {
  DW_IMU_HEADING_TRUE = 0,
  DW_IMU_HEADING_MAGNETIC = 1
}
 Types of the heading degree. More...
 

Functions

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

Data Structure Documentation

◆ dwIMUFrame

struct dwIMUFrame
Data Fields
float64_t acceleration[3] Acceleration in X, Y, and Z directions [m/s^2].
uint32_t flags The flags to show which values are valid in this IMU frame.
float64_t heading Heading of the IMU measured in respect to the ENU system [degrees], i.e., compass.
dwIMUHeadingType headingType Type of the heading information.
float64_t magnetometer[3] Measurement of the magnetometer unit in X, Y, and Z directions [utesla].
float64_t orientation[3] Roll, pitch, and yaw angle of the orientation returned by the IMU [degree].
dwQuaterniond orientationQuaternion Quaternion representation (x, y, z, w) of the orientation returned by the IMU.
dwTime_t timestamp_us Timestamp for the current message. Indicates when it's first received [usec].
float64_t turnrate[3] Roll, pitch, and yaw turn rate (i.e., gyroscope)[rad/s].

Enumeration Type Documentation

◆ dwIMUFlags

enum dwIMUFlags

Each flag shows if that value is valid in this IMU frame.

Enumerator
DW_IMU_HEADING 

Value of dwIMUFrame.heading is valid.

DW_IMU_ROLL 

Value of dwIMUFrame.orientation[0] is valid.

DW_IMU_PITCH 

Value of dwIMUFrame.orientation[1] is valid.

DW_IMU_YAW 

Value of dwIMUFrame.orientation[2] is valid.

DW_IMU_QUATERNION_X 
DW_IMU_QUATERNION_Y 

!< Value of dwIMUFrame.orientationQuaternion.x is valid.

DW_IMU_QUATERNION_Z 

!< Value of dwIMUFrame.orientationQuaternion.y is valid.

DW_IMU_QUATERNION_W 

!< Value of dwIMUFrame.orientationQuaternion.z is valid.

DW_IMU_ROLL_RATE 

!< Value of dwIMUFrame.orientationQuaternion.w is valid.

Value of dwIMUFrame.turnrate[0] is valid.

DW_IMU_PITCH_RATE 

Value of dwIMUFrame.turnrate[1] is valid.

DW_IMU_YAW_RATE 

Value of dwIMUFrame.turnrate[2] is valid.

DW_IMU_ACCELERATION_X 

Value of dwIMUFrame.acceleration[0] is valid.

DW_IMU_ACCELERATION_Y 

Value of dwIMUFrame.acceleration[1] is valid.

DW_IMU_ACCELERATION_Z 

Value of dwIMUFrame.acceleration[2] is valid.

DW_IMU_MAGNETOMETER_X 

Value of dwIMUFrame.magnetometer[0] is valid.

DW_IMU_MAGNETOMETER_Y 

Value of dwIMUFrame.magnetometer[1] is valid.

DW_IMU_MAGNETOMETER_Z 

Value of dwIMUFrame.magnetometer[2] is valid.

Definition at line 63 of file IMU.h.

◆ dwIMUHeadingType

Types of the heading degree.

Enumerator
DW_IMU_HEADING_TRUE 

True heading.

'dwIMUFrame.heading' points towards true north.

DW_IMU_HEADING_MAGNETIC 

Magnetic heading.

'dwIMUFrame.heading' points towards magnetic north.

Definition at line 91 of file IMU.h.

Function Documentation

◆ dwSensorIMU_popFrame()

DW_API_PUBLIC dwStatus dwSensorIMU_popFrame ( dwIMUFrame frame,
dwSensorHandle_t  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_processRawData()

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

Reads the IMU frame from raw data.

Any processed messages can be picked up using the dwSensorIMU_popMessage() 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 frame,
dwTime_t  timeout_us,
dwSensorHandle_t  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]timeout_usTimeout, 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