DriveWorks SDK Reference
5.4.5418 Release
For Test and Development only

IMU.h
Go to the documentation of this file.
1 //
3 // Notice
4 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 //
9 // NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10 // information or for any infringement of patents or other rights of third parties that may
11 // result from its use. No license is granted by implication or otherwise under any patent
12 // or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13 // expressly authorized by NVIDIA. Details are subject to change without notice.
14 // This code supersedes and replaces all information previously supplied.
15 // NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16 // components in life support devices or systems without express written approval of
17 // NVIDIA CORPORATION & AFFILIATES.
18 //
19 // SPDX-FileCopyrightText: Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20 // SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21 //
22 // NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23 // property and proprietary rights in and to this material, related
24 // documentation and any modifications thereto. Any use, reproduction,
25 // disclosure or distribution of this material and related documentation
26 // without an express license agreement from NVIDIA CORPORATION or
27 // its affiliates is strictly prohibited.
28 //
30 
47 #ifndef DW_SENSORS_IMU_IMU_H_
48 #define DW_SENSORS_IMU_IMU_H_
49 
50 #include <dw/core/Config.h>
51 #include <dw/core/base/Exports.h>
52 #include <dw/core/base/Types.h>
53 
54 #include <dw/sensors/Sensors.h>
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
61 typedef enum dwIMUFlags {
62 
63  DW_IMU_HEADING = 1U << 1,
64 
65  DW_IMU_ROLL = 1U << 2,
66  DW_IMU_PITCH = 1U << 3,
67  DW_IMU_YAW = 1U << 4,
68 
69  DW_IMU_QUATERNION_X = 1U << 5,
70  DW_IMU_QUATERNION_Y = 1U << 6,
71  DW_IMU_QUATERNION_Z = 1U << 7,
72  DW_IMU_QUATERNION_W = 1U << 8,
73 
74  DW_IMU_ROLL_RATE = 1U << 9,
75  DW_IMU_PITCH_RATE = 1U << 10,
76  DW_IMU_YAW_RATE = 1U << 11,
77 
78  DW_IMU_ACCELERATION_X = 1U << 12,
79  DW_IMU_ACCELERATION_Y = 1U << 13,
80  DW_IMU_ACCELERATION_Z = 1U << 14,
81 
82  DW_IMU_MAGNETOMETER_X = 1U << 15,
83  DW_IMU_MAGNETOMETER_Y = 1U << 16,
85 
86 } dwIMUFlags;
87 
89 typedef enum dwIMUHeadingType {
90 
93 
96 
98 
102 typedef struct dwIMUFrame
103 {
105  uint32_t flags;
106 
109 
112 
115 
118 
121 
124 
127 
130 
131 } dwIMUFrame;
132 
150 dwStatus dwSensorIMU_readFrame(dwIMUFrame* const frame, dwTime_t const timeoutUs, dwSensorHandle_t const sensor);
151 
167 dwStatus dwSensorIMU_processRawData(uint8_t const* const data, size_t const size, dwSensorHandle_t const sensor);
168 
182 dwStatus dwSensorIMU_popFrame(dwIMUFrame* const frame, dwSensorHandle_t const sensor);
183 
184 #ifdef __cplusplus
185 }
186 #endif
187 
188 #endif // DW_SENSORS_IMU_IMU_H_
NVIDIA DriveWorks API: Core Types
Value of dwIMUFrame.turnrate[2] is valid.
Definition: IMU.h:76
float64_t magnetometer[3]
Measurement of the magnetometer unit in X, Y, and Z directions [utesla].
Definition: IMU.h:123
dwIMUFlags
Each flag shows if that value is valid in this IMU frame.
Definition: IMU.h:61
Value of dwIMUFrame.orientation[2] is valid.
Definition: IMU.h:67
dwQuaterniond orientationQuaternion
Quaternion representation (x, y, z, w) of the orientation returned by the IMU.
Definition: IMU.h:114
Defines a double-precision quaternion.
Definition: Types.h:435
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.
Value of dwIMUFrame.magnetometer[1] is valid.
Definition: IMU.h:83
Value of dwIMUFrame.turnrate[1] is valid.
Definition: IMU.h:75
True heading.
Definition: IMU.h:92
double float64_t
Definition: Types.h:71
dwTime_t timestamp_us
Timestamp for the current message. Indicates when it&#39;s first received [usec].
Definition: IMU.h:108
Value of dwIMUFrame.magnetometer[0] is valid.
Definition: IMU.h:82
struct dwSensorObject * dwSensorHandle_t
Handle representing a sensor.
Definition: Sensors.h:85
Value of dwIMUFrame.acceleration[1] is valid.
Definition: IMU.h:79
dwStatus
Status definition.
Definition: Status.h:180
NVIDIA DriveWorks API: Sensors
Value of dwIMUFrame.heading is valid.
Definition: IMU.h:63
float64_t acceleration[3]
Acceleration in X, Y, and Z directions [m/s^2].
Definition: IMU.h:120
Value of dwIMUFrame.orientation[0] is valid.
Definition: IMU.h:65
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
uint32_t flags
The flags to show which values are valid in this IMU frame.
Definition: IMU.h:105
!< Value of dwIMUFrame.orientationQuaternion.w is valid.
Definition: IMU.h:74
An IMU frame containing sensor readings from the IMU sensor.
Definition: IMU.h:102
Value of dwIMUFrame.orientation[1] is valid.
Definition: IMU.h:66
Value of dwIMUFrame.acceleration[2] is valid.
Definition: IMU.h:80
!< Value of dwIMUFrame.orientationQuaternion.x is valid.
Definition: IMU.h:70
!< Value of dwIMUFrame.orientationQuaternion.y is valid.
Definition: IMU.h:71
DW_API_PUBLIC dwStatus dwSensorIMU_popFrame(dwIMUFrame *const frame, dwSensorHandle_t const sensor)
Returns any IMU data previously processed through the raw data stream.
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.
!< Value of dwIMUFrame.orientationQuaternion.z is valid.
Definition: IMU.h:72
float64_t heading
Heading of the IMU measured in respect to the ENU system [degrees], i.e., compass.
Definition: IMU.h:126
Value of dwIMUFrame.magnetometer[2] is valid.
Definition: IMU.h:84
Value of dwIMUFrame.acceleration[0] is valid.
Definition: IMU.h:78
Magnetic heading.
Definition: IMU.h:95
dwIMUHeadingType
Types of the heading degree.
Definition: IMU.h:89
#define DW_API_PUBLIC
Definition: Exports.h:54
float64_t turnrate[3]
Roll, pitch, and yaw turn rate (i.e., gyroscope)[rad/s].
Definition: IMU.h:117
dwIMUHeadingType headingType
Type of the heading information.
Definition: IMU.h:129
float64_t orientation[3]
Roll, pitch, and yaw angle of the orientation returned by the IMU [degree].
Definition: IMU.h:111
NVIDIA DriveWorks API: Core Exports