NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

Defines A API for the IMU sensor.

Data Structures

struct  dwIMUSignalValidityInfo
 This structure contains validity of each signal provided by IMU sensors. More...
 
struct  dwIMUFrame
 This structure contains one frame of data from a IMU sensor. More...
 

Typedefs

typedef enum dwIMUTimestampFormat dwIMUTimestampFormat
 Timestamp format of the IMU sensor. Should be identical to dwVioTimestampFormat(i.e. each field should have identical meaning and value). More...
 
typedef enum dwIMUImuTempQuality dwIMUImuTempQuality
 
typedef enum dwIMUImuAccelerationQuality dwIMUImuAccelerationQuality
 
typedef enum dwIMUImuTurnrateQuality dwIMUImuTurnrateQuality
 
typedef enum dwIMUImuTurnrateAccelQuality dwIMUImuTurnrateAccelQuality
 
typedef enum dwIMUImuTimestampQuality dwIMUImuTimestampQuality
 
typedef enum dwIMUImuStatus dwIMUImuStatus
 
typedef struct dwIMUSignalValidityInfo dwIMUSignalValidityInfo
 This structure contains validity of each signal provided by IMU sensors. More...
 
typedef struct dwIMUFrame dwIMUFrame
 This structure contains one frame of data from a IMU sensor. More...
 

Enumerations

enum  dwIMUTimestampFormat {
  DW_IMU_TIMESTAMP_FORMAT_UNSPECIFIED = 0,
  DW_IMU_TIMESTAMP_FORMAT_PTP64 = 1,
  DW_IMU_TIMESTAMP_FORMAT_PTP16 = 2,
  DW_IMU_TIMESTAMP_FORMAT_CCPLEX_TSC = 3,
  DW_IMU_TIMESTAMP_FORMAT_FORCE32 = 0x7fffffff
}
 Timestamp format of the IMU sensor. Should be identical to dwVioTimestampFormat(i.e. each field should have identical meaning and value). More...
 
enum  dwIMUAlignmentStatus {
  DW_DEPRECATED_ENUMERATOR =("Read alignmentStatus value from GPS frames instead") = 0,
  DW_DEPRECATED_ENUMERATOR =("Read alignmentStatus value from GPS frames instead") = 0,
  DW_DEPRECATED_ENUMERATOR =("Read alignmentStatus value from GPS frames instead") = 0,
  DW_DEPRECATED_ENUMERATOR =("Read alignmentStatus value from GPS frames instead") = 0
}
 High rate data output from GNSS-IMU device requires fusion of GNSS and IMU. More...
 
enum  dwIMUImuTempQuality {
  DW_IMU_IMU_TEMP_QUALITY_INIT = 0,
  DW_IMU_IMU_TEMP_QUALITY_UNCALIB = 1,
  DW_IMU_IMU_TEMP_QUALITY_OK = 2,
  DW_IMU_IMU_TEMP_QUALITY_TMP_FAIL = 3,
  DW_IMU_IMU_TEMP_QUALITY_PRMNT_FAIL = 4,
  DW_IMU_IMU_TEMP_QUALITY_SENS_NOT_INST = 5,
  DW_IMU_IMU_TEMP_QUALITY_FORCE32 = 0x7fffffff
}
 
enum  dwIMUImuAccelerationQuality {
  DW_IMU_IMU_ACCELERATION_QUALITY_UNKNOWN = 0,
  DW_IMU_IMU_ACCELERATION_QUALITY_INIT = 1,
  DW_IMU_IMU_ACCELERATION_QUALITY_UNCALIB = 2,
  DW_IMU_IMU_ACCELERATION_QUALITY_OK = 3,
  DW_IMU_IMU_ACCELERATION_QUALITY_TMP_FAIL = 4,
  DW_IMU_IMU_ACCELERATION_QUALITY_PRMNT_FAIL = 5,
  DW_IMU_IMU_ACCELERATION_QUALITY_SENS_NOT_INST = 6,
  DW_IMU_IMU_ACCELERATION_QUALITY_OVERLOAD = 7,
  DW_IMU_IMU_ACCELERATION_QUALITY_TEMPERATURE = 8,
  DW_IMU_IMU_ACCELERATION_QUALITY_FORCE32 = 0x7fffffff
}
 
enum  dwIMUImuTurnrateQuality {
  DW_IMU_IMU_TURNRATE_QUALITY_UNKNOWN = 0,
  DW_IMU_IMU_TURNRATE_QUALITY_INIT = 1,
  DW_IMU_IMU_TURNRATE_QUALITY_UNCALIB = 2,
  DW_IMU_IMU_TURNRATE_QUALITY_OK = 3,
  DW_IMU_IMU_TURNRATE_QUALITY_TMP_FAIL = 4,
  DW_IMU_IMU_TURNRATE_QUALITY_PRMNT_FAIL = 5,
  DW_IMU_IMU_TURNRATE_QUALITY_SENS_NOT_INST = 6,
  DW_IMU_IMU_TURNRATE_QUALITY_OVERLOAD = 7,
  DW_IMU_IMU_TURNRATE_QUALITY_TEMPERATURE = 8,
  DW_IMU_IMU_TURNRATE_QUALITY_FORCE32 = 0x7fffffff
}
 
enum  dwIMUImuTurnrateAccelQuality {
  DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_UNKNOWN = 0,
  DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_INIT = 1,
  DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_UNCALIB = 2,
  DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_OK = 3,
  DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_TMP_FAIL = 4,
  DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_PRMNT_FAIL = 5,
  DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_SENS_NOT_INST = 6,
  DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_OVERLOAD = 7,
  DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_TEMPERATURE = 8,
  DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_FORCE32 = 0x7fffffff
}
 
enum  dwIMUImuTimestampQuality {
  DW_IMU_IMU_TIMESTAMP_QUALITY_NOT_INIT = 0,
  DW_IMU_IMU_TIMESTAMP_QUALITY_OK = 2,
  DW_IMU_IMU_TIMESTAMP_QUALITY_SYNC_LOST = 3,
  DW_IMU_IMU_TIMESTAMP_QUALITY_FORCE32 = 0x7fffffff
}
 
enum  dwIMUImuStatus {
  DW_IMU_IMU_STATUS_UNKNOWN = 0,
  DW_IMU_IMU_STATUS_INIT = 1,
  DW_IMU_IMU_STATUS_UNCALIB = 2,
  DW_IMU_IMU_STATUS_OK = 3,
  DW_IMU_IMU_STATUS_TMP_FAIL = 4,
  DW_IMU_IMU_STATUS_PRMNT_FAIL = 5,
  DW_IMU_IMU_STATUS_SENS_NOT_INST = 6,
  DW_IMU_IMU_STATUS_FORCE32 = 0x7fffffff
}
 

Functions

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_processRawData (uint8_t const *const data, size_t const size, dwSensorHandle_t const sensor)
 Decodes IMU frames from received IMU sensor raw data/packets. More...
 
DW_API_PUBLIC dwStatus dwSensorIMU_popFrame (dwIMUFrame *const frame, dwSensorHandle_t const sensor)
 Returns the earliest IMU frame previously processed from previous IMU sensor packets. More...
 
enum dwIMUAlignmentStatus DW_DEPRECATED ("REL_26_03 - dwIMUAlignmentStatus is deprecated and will be removed in the future. Read alignmentStatus value from GPS frames instead")
 High rate data output from GNSS-IMU device requires fusion of GNSS and IMU. More...
 

Typedef Documentation

◆ dwIMUFrame

typedef struct dwIMUFrame dwIMUFrame

This structure contains one frame of data from a IMU sensor.

◆ dwIMUImuAccelerationQuality

◆ dwIMUImuStatus

◆ dwIMUImuTempQuality

◆ dwIMUImuTimestampQuality

◆ dwIMUImuTurnrateAccelQuality

◆ dwIMUImuTurnrateQuality

◆ dwIMUSignalValidityInfo

This structure contains validity of each signal provided by IMU sensors.

Access fields in this structure with APIs provided by SignalStatus.h

◆ dwIMUTimestampFormat

Timestamp format of the IMU sensor. Should be identical to dwVioTimestampFormat(i.e. each field should have identical meaning and value).

Enumeration Type Documentation

◆ dwIMUAlignmentStatus

High rate data output from GNSS-IMU device requires fusion of GNSS and IMU.

The data can only be accurate if the GNSS/IMU device has gone through an internal alignment initialization, which allows the device to know the orientation of the IMU. This status indicates the quality of IMU alignment.

Deprecated:
REL_26_03 - dwIMUAlignmentStatus is deprecated and will be removed in the future. Read alignmentStatus value from GPS frames instead
Enumerator
DW_DEPRECATED_ENUMERATOR 

Unknown status means the device does not or has not yet provided this information.

Fine means the IMU alignment is complete, and the device can output high quality data.

Coarse means the IMU is roughly aligned, so the data is useful, but not of the highest quality.

Invalid means the IMU alignment is not yet valid, and the output data is not accurate.

Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
DW_DEPRECATED_ENUMERATOR 

Unknown status means the device does not or has not yet provided this information.

Fine means the IMU alignment is complete, and the device can output high quality data.

Coarse means the IMU is roughly aligned, so the data is useful, but not of the highest quality.

Invalid means the IMU alignment is not yet valid, and the output data is not accurate.

Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
DW_DEPRECATED_ENUMERATOR 

Unknown status means the device does not or has not yet provided this information.

Fine means the IMU alignment is complete, and the device can output high quality data.

Coarse means the IMU is roughly aligned, so the data is useful, but not of the highest quality.

Invalid means the IMU alignment is not yet valid, and the output data is not accurate.

Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
DW_DEPRECATED_ENUMERATOR 

Unknown status means the device does not or has not yet provided this information.

Fine means the IMU alignment is complete, and the device can output high quality data.

Coarse means the IMU is roughly aligned, so the data is useful, but not of the highest quality.

Invalid means the IMU alignment is not yet valid, and the output data is not accurate.

Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead
Deprecated:
Read alignmentStatus value from GPS frames instead

Definition at line 60 of file IMUTypes.h.

◆ dwIMUImuAccelerationQuality

Enumerator
DW_IMU_IMU_ACCELERATION_QUALITY_UNKNOWN 

Signal Unknown.

DW_IMU_IMU_ACCELERATION_QUALITY_INIT 

Signal initializing.

DW_IMU_IMU_ACCELERATION_QUALITY_UNCALIB 

Sensor uncalibrated.

DW_IMU_IMU_ACCELERATION_QUALITY_OK 

Signal in specification.

DW_IMU_IMU_ACCELERATION_QUALITY_TMP_FAIL 

Signal temporary failure.

DW_IMU_IMU_ACCELERATION_QUALITY_PRMNT_FAIL 

Signal permanent failure.

DW_IMU_IMU_ACCELERATION_QUALITY_SENS_NOT_INST 

Sensor not installed.

DW_IMU_IMU_ACCELERATION_QUALITY_OVERLOAD 

Sensor overloaded.

DW_IMU_IMU_ACCELERATION_QUALITY_TEMPERATURE 

Sensor out of operating temperature.

DW_IMU_IMU_ACCELERATION_QUALITY_FORCE32 

Definition at line 111 of file IMUTypes.h.

◆ dwIMUImuStatus

Enumerator
DW_IMU_IMU_STATUS_UNKNOWN 

Signal Unknown.

DW_IMU_IMU_STATUS_INIT 

Signal initializing.

DW_IMU_IMU_STATUS_UNCALIB 

Sensor uncalibrated.

DW_IMU_IMU_STATUS_OK 

Signal in specification.

DW_IMU_IMU_STATUS_TMP_FAIL 

Signal temporary failure.

DW_IMU_IMU_STATUS_PRMNT_FAIL 

Signal permanent failure.

DW_IMU_IMU_STATUS_SENS_NOT_INST 

Sensor not installed.

DW_IMU_IMU_STATUS_FORCE32 

Definition at line 225 of file IMUTypes.h.

◆ dwIMUImuTempQuality

Enumerator
DW_IMU_IMU_TEMP_QUALITY_INIT 

Signal initializing.

DW_IMU_IMU_TEMP_QUALITY_UNCALIB 

Sensor uncalibrated.

DW_IMU_IMU_TEMP_QUALITY_OK 

Signal in specification.

DW_IMU_IMU_TEMP_QUALITY_TMP_FAIL 

Signal temporary failure.

DW_IMU_IMU_TEMP_QUALITY_PRMNT_FAIL 

Signal permanent failure.

DW_IMU_IMU_TEMP_QUALITY_SENS_NOT_INST 

Sensor not installed.

DW_IMU_IMU_TEMP_QUALITY_FORCE32 

Definition at line 87 of file IMUTypes.h.

◆ dwIMUImuTimestampQuality

Enumerator
DW_IMU_IMU_TIMESTAMP_QUALITY_NOT_INIT 

Not Initialized. still initializing.

DW_IMU_IMU_TIMESTAMP_QUALITY_OK 

Normal Operation. Functional and Electrical Checks Passed.

DW_IMU_IMU_TIMESTAMP_QUALITY_SYNC_LOST 

Synchronization lost.

DW_IMU_IMU_TIMESTAMP_QUALITY_FORCE32 

Definition at line 210 of file IMUTypes.h.

◆ dwIMUImuTurnrateAccelQuality

Enumerator
DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_UNKNOWN 

Signal Unknown.

DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_INIT 

Signal initializing.

DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_UNCALIB 

Sensor uncalibrated.

DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_OK 

Signal in specification.

DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_TMP_FAIL 

Signal temporary failure.

DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_PRMNT_FAIL 

Signal permanent failure.

DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_SENS_NOT_INST 

Sensor not installed.

DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_OVERLOAD 

Sensor overloaded.

DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_TEMPERATURE 

Sensor out of operating temperature.

DW_IMU_IMU_TURNRATE_ACCEL_QUALITY_FORCE32 

Definition at line 177 of file IMUTypes.h.

◆ dwIMUImuTurnrateQuality

Enumerator
DW_IMU_IMU_TURNRATE_QUALITY_UNKNOWN 

Signal Unknown.

DW_IMU_IMU_TURNRATE_QUALITY_INIT 

Signal initializing.

DW_IMU_IMU_TURNRATE_QUALITY_UNCALIB 

Sensor uncalibrated.

DW_IMU_IMU_TURNRATE_QUALITY_OK 

Signal in specification.

DW_IMU_IMU_TURNRATE_QUALITY_TMP_FAIL 

Signal temporary failure.

DW_IMU_IMU_TURNRATE_QUALITY_PRMNT_FAIL 

Signal permanent failure.

DW_IMU_IMU_TURNRATE_QUALITY_SENS_NOT_INST 

Sensor not installed.

DW_IMU_IMU_TURNRATE_QUALITY_OVERLOAD 

Sensor overloaded.

DW_IMU_IMU_TURNRATE_QUALITY_TEMPERATURE 

Sensor out of operating temperature.

DW_IMU_IMU_TURNRATE_QUALITY_FORCE32 

Definition at line 144 of file IMUTypes.h.

◆ dwIMUTimestampFormat

Timestamp format of the IMU sensor. Should be identical to dwVioTimestampFormat(i.e. each field should have identical meaning and value).

Enumerator
DW_IMU_TIMESTAMP_FORMAT_UNSPECIFIED 

Timestamp format not specified.

DW_IMU_TIMESTAMP_FORMAT_PTP64 

64-bit PTP timestamp format. This format is assumed in case the validityInfo field does not indicate sensorTimestampFormat is valid.

DW_IMU_TIMESTAMP_FORMAT_PTP16 

16-bit fragment from PTP timer with resolution of 100us. Obtained by the following computation ((PTP_US / 100) % 1 << 16).

DW_IMU_TIMESTAMP_FORMAT_CCPLEX_TSC 

CCPLEX TSC timestamp format.

DW_IMU_TIMESTAMP_FORMAT_FORCE32 

Definition at line 37 of file IMUTypes.h.

Function Documentation

◆ DW_DEPRECATED()

enum dwIMUAlignmentStatus DW_DEPRECATED ( "REL_26_03 - dwIMUAlignmentStatus is deprecated and will be removed in the future. Read alignmentStatus value from GPS frames instead"  )

High rate data output from GNSS-IMU device requires fusion of GNSS and IMU.

The data can only be accurate if the GNSS/IMU device has gone through an internal alignment initialization, which allows the device to know the orientation of the IMU. This status indicates the quality of IMU alignment.

Deprecated:
REL_26_03 - dwIMUAlignmentStatus is deprecated and will be removed in the future. Read alignmentStatus value from GPS frames instead

◆ dwSensorIMU_popFrame()

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

Returns the earliest IMU frame previously processed from previous IMU sensor packets.

@req{GID-AV_REQ-6774977} @req{GID-AV_REQ-6774978}

This function returns only the first single decoded IMU frame from cached IMU frames(and removes it from cache). If no frames are available in queue, DW_NOT_AVAILABLE is returned and no IMU frame is returned.

This function should only be called after sensor is started. From above descriptions, this function requires previous callings to function dwSensorIMU_readFrame or dwSensorIMU_processRawData returns success otherwise this function will return DW_NOT_AVAILABLE.

This function is a synchronous function. Customers have to wait till the polling of IMU frame queue is finished.

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. Only handles returned by dwSAL_createSensor with IMU sensor protocols are allowed.
DW_INVALID_ARGUMENTS - if given arguments are invalid. Here it means input pointer 'frame' is empty
DW_NOT_AVAILABLE - if no more data is available
DW_SUCCESS - An IMU frame is dequeued from internal IMU frame queue into frame
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwSensorIMU_processRawData()

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

Decodes IMU frames from received IMU sensor raw data/packets.

Any processed messages can be picked up using dwSensorIMU_readFrame() or dwSensorIMU_popFrame() function.

@req{GID-AV_REQ-6774978}

This API function will achieve functionality of this software unit:

  • Decode IMU sensor packets into IMU frames and cache decoded IMU frames

This API function will push specified IMU sensor packet into its internal IMU decoders. Since internal IMU decoder will return once an IMU frame is decoded, or no IMU frames could be decoded from remaining bytes from specified IMU sensor packet, thus this API function will keep driving the decoder to return as many IMU frames as possible, until decoder could return no new IMU frames. All decoded IMU frames are cached internally and could be accessed by dwSensorIMU_readFrame() or dwSensorIMU_popFrame(). Based on sensor configuration value 'output-timestamp=', decoded IMU frames would be modified in their hostTimestamp field values accordingly.

This function should only be called after sensor is started, and with raw IMU sensor packet(s) returned from dwSensor_readRawData. After this raw sensor packet is processed by this function, user should also call dwSensor_returnRawData to return the memory block to SAL.

This function is a synchronous function. Customers have to wait till the raw IMU sensor data is processed.

Parameters
[in]dataUndecoded imu data. Non-null pointer
[in]sizeSize in bytes of the raw data. Range: (0, INT_MAX]. Note 0 will result in DW_NOT_READY return value.
[in]sensorSensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid. Only handles returned by dwSAL_createSensor with IMU sensor protocols are allowed.
DW_INVALID_ARGUMENTS - if given arguments are invalid, Here it means input pointer 'data' is empty
DW_NOT_READY - if more data needs to be passed in (loop while it returns 'DW_NOT_READY').
DW_SUCCESS - specified raw IMU sensor packet was decoded into one or more IMU frames. Please read decoded IMU frames via dwSensorIMU_readFrame or dwSensorIMU_popFrame
Note
It's possible that raw IMU data block data will be decoded into zero, one or more IMU frames. All these decoded IMU frames will be stored into internal IMU frame queue and could be accessed via dwSensorIMU_readFrame() or dwSensorIMU_popFrame(). Scenarios that no IMU frames could be decoded: The IMU packet itself is invalid(for example, an IMU packet with incorrect packet size) Scenarios that one IMU frame could be decoded: The IMU packet itself is valid(for example, an IMU packets with expected size and could be recognized and parsed successfully by decoder) Scenarios that more than one IMU frames could be decoded: IMU packet contains multiple sensor messages(for example, an IMU packet that contains multiple IMU messages that are defined by IMU vendors, and each such IMU message could lead to a separate IMU frame to be decoded).
It's also possible that part of a raw IMU data block data could not be recognized and decoded by IMU sensor's internal decoder, because these decoders are usually designed to recognize and parse a selected part of available types of raw sensor packets. This function returns DW_SUCCESS if part of this raw IMU sensor packet is decoded into one or more IMU frames.
If internal cache of IMU frames is full, decoded IMU frames won't be cached anymore and they'll be discarded. In this case a warning message 'IMU: sensor generates data faster, then reader consumes. Losing messages' is printed, but API function won't return any error codes in this case - users will still see DW_SUCCESS if at least one decoded IMU frame(s) are cached. This could happen if customers called this API for too many times w/o calling dwSensorIMU_readFrame or dwSensorIMU_popFrame to retrieve decoded IMU frames which is a typical buffer overflow scenario.
See also
developer.nvidia.com/docs/drive/drive-os/6.0.8.1/public/driveworks-nvsdk/nvsdk_dw_html/sensors_usecase4.html for description of available option values for 'output-timestamp=' sensor parameter.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ 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.

@req{GID-AV_REQ-6774977} @req{GID-AV_REQ-6774976} @req{GID-AV_REQ-6774980} @req{GID-AV_REQ-6774981} @req{GID-AV_REQ-6826484}

This API function will achieve two functionalities of this software unit:

  • Read an IMU sensor packet from physical IMU sensor
  • Decode this IMU sensor packet and add cache decoded IMU frames

This API function will firstly check if there are already decoded IMU frames available, if there are decoded IMU frames then this API function returns the first decoded IMU frame then return; otherwise it will read IMU sensor packet then decode it and return first decoded IMU frames, or return DW_TIME_OUT if no IMU frames could be decoded till timeout is detected.

This function could only be called after an IMU sensor is instantiated, started and is running.

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. Range: [0, INT_MAX]
Special values:
  • DW_TIMEOUT_INFINITE: to wait infinitely.
  • Zero: means polling mode - if there are already decoded IMU frames, return first frame immediately; otherwise return DW_TIME_OUT directly.
[in]sensorSensor handle of the IMU sensor previously created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid. Only handles returned by dwSAL_createSensor with IMU sensor protocols are allowed.
DW_INVALID_ARGUMENTS - if given arguments are invalid. Here it means frame pointer is empty
DW_TIME_OUT - If no valid IMU frames are decoded within specified timeout timeoutUs (note that timeoutUs may be zero)
DW_NOT_AVAILABLE - if sensor has not been started or raw IMU sensor packet is not available in polling mode.
DW_END_OF_STREAM - if end of stream reached (virtual sensor only).
DW_SUCCESS - successfully returned a decoded IMU frame in frame within specified timeout timeoutUs from specified sensor sensor
Note
This function will block until a frame is decoded or timeout is detected, if timeoutUs is specified as non-zero values.
If no valid IMU packets could be returned from physical IMU sensors(for Vehicle IMU sensors, this means either all received IMU packets have wrong packet size or no IMU packets are received at all) till timeout, no IMU frames could be decoded and this API will return DW_TIME_OUT.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes