Loading [MathJax]/extensions/tex2jax.js
  • <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>

  • DriveWorks SDK Reference
    5.6.215 Release
    For Test and Development only

    All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

    Detailed Description

    Defines the IMU sensor.

    Data Structures

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

    Enumerations

    enum  dwIMUFlags {
      DW_IMU_HEADING = 1U << 1 ,
      DW_IMU_ROLL = 1U << 2 ,
      DW_IMU_PITCH = 1U << 3 ,
      DW_IMU_YAW = 1U << 4 ,
      DW_IMU_QUATERNION_X = 1U << 5 ,
      DW_IMU_QUATERNION_Y = 1U << 6 ,
      DW_IMU_QUATERNION_Z = 1U << 7 ,
      DW_IMU_QUATERNION_W = 1U << 8 ,
      DW_IMU_ROLL_RATE = 1U << 9 ,
      DW_IMU_PITCH_RATE = 1U << 10 ,
      DW_IMU_YAW_RATE = 1U << 11 ,
      DW_IMU_ACCELERATION_X = 1U << 12 ,
      DW_IMU_ACCELERATION_Y = 1U << 13 ,
      DW_IMU_ACCELERATION_Z = 1U << 14 ,
      DW_IMU_MAGNETOMETER_X = 1U << 15 ,
      DW_IMU_MAGNETOMETER_Y = 1U << 16 ,
      DW_IMU_MAGNETOMETER_Z = 1U << 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 *const frame, dwSensorHandle_t const sensor)
     Returns any IMU data 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_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...
     

    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 61 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 89 of file IMU.h.

    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_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_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
    人人超碰97caoporen国产