DriveWorks SDK Reference

| 0.6.67 Release

IMU.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // strictly prohibited.
28 //
30 
46 #ifndef DW_SENSORS_IMU_IMU_H__
47 #define DW_SENSORS_IMU_IMU_H__
48 
49 #include <dw/core/Config.h>
50 #include <dw/core/Exports.h>
51 #include <dw/core/Types.h>
52 
53 #include <dw/sensors/Sensors.h>
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
60 typedef enum dwIMUFlags {
61 
62  DW_IMU_HEADING = 1 << 1,
63 
64  DW_IMU_ROLL = 1 << 2,
65  DW_IMU_PITCH = 1 << 3,
66  DW_IMU_YAW = 1 << 4,
67 
72 
73  DW_IMU_ROLL_RATE = 1 << 9,
74  DW_IMU_PITCH_RATE = 1 << 10,
75  DW_IMU_YAW_RATE = 1 << 11,
76 
80 
84 
85 } dwIMUFlags;
86 
88 typedef enum dwIMUHeadingType {
89 
92 
95 
97 
98 
99 #pragma pack(push,1) // Make sure we have consistent structure packings
100 
105 typedef struct dwIMUFrame {
106 
108  uint32_t flags;
109 
112 
115 
118 
121 
124 
127 
130 
133 
134 } dwIMUFrame;
135 
136 #pragma pack(pop)
137 
138 
156  dwSensorHandle_t sensor);
157 
172 dwStatus dwSensorIMU_processRaw(const uint8_t *data, size_t size,
173  dwSensorHandle_t sensor);
174 
189  dwSensorHandle_t sensor);
190 
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 #endif // DW_SENSORS_IMU_IMU_H__
Value of dwIMUFrame.turnrate[2] is valid.
Definition: IMU.h:75
NVIDIA DriveWorks API: Core Types
float64_t magnetometer[3]
Measurement of the magnetometer unit in X, Y, and Z directions [utesla].
Definition: IMU.h:126
dwIMUFlags
Each flag shows if that value is valid in this IMU frame.
Definition: IMU.h:60
Value of dwIMUFrame.orientation[2] is valid.
Definition: IMU.h:66
uint64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:89
Value of dwIMUFrame.magnetometer[1] is valid.
Definition: IMU.h:82
float64_t orientationQuaternion[4]
Quaternion representation (x, y, z, w) of the orientation returned by the IMU.
Definition: IMU.h:117
Value of dwIMUFrame.turnrate[1] is valid.
Definition: IMU.h:74
NVIDIA DriveWorks API: Core Exports
True heading.
Definition: IMU.h:91
double float64_t
Definition: Types.h:78
dwTime_t timestamp_us
Timestamp for the current message. Indicates when it&#39;s first received [usec].
Definition: IMU.h:111
Value of dwIMUFrame.magnetometer[0] is valid.
Definition: IMU.h:81
struct dwSensorObject * dwSensorHandle_t
Handle representing a sensor.
Definition: Sensors.h:80
Value of dwIMUFrame.acceleration[1] is valid.
Definition: IMU.h:78
dwStatus
Status definition.
Definition: Status.h:167
NVIDIA DriveWorks API: Sensors
Value of dwIMUFrame.heading is valid.
Definition: IMU.h:62
float64_t acceleration[3]
Acceleration in X, Y, and Z directions [m/s^2].
Definition: IMU.h:123
Value of dwIMUFrame.orientation[0] is valid.
Definition: IMU.h:64
DW_API_PUBLIC dwStatus dwSensorIMU_popMessage(dwIMUFrame *frame, dwSensorHandle_t sensor)
Returns any IMU data previously processed through the raw data stream.
uint32_t flags
The flags to show which values are valid in this IMU frame.
Definition: IMU.h:108
!< Value of dwIMUFrame.orientationQuaternion[3] is valid.
Definition: IMU.h:73
An IMU frame containing sensor readings from the IMU sensor.
Definition: IMU.h:105
Value of dwIMUFrame.orientation[1] is valid.
Definition: IMU.h:65
Value of dwIMUFrame.acceleration[2] is valid.
Definition: IMU.h:79
!< Value of dwIMUFrame.orientationQuaternion[0] is valid.
Definition: IMU.h:69
!< Value of dwIMUFrame.orientationQuaternion[1] is valid.
Definition: IMU.h:70
!< Value of dwIMUFrame.orientationQuaternion[2] is valid.
Definition: IMU.h:71
float64_t heading
Heading of the IMU measured in respect to the ENU system [degrees], i.e., compass.
Definition: IMU.h:129
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.
DW_API_PUBLIC dwStatus dwSensorIMU_processRaw(const uint8_t *data, size_t size, dwSensorHandle_t sensor)
Reads the IMU frame from raw data.
Value of dwIMUFrame.magnetometer[2] is valid.
Definition: IMU.h:83
Value of dwIMUFrame.acceleration[0] is valid.
Definition: IMU.h:77
dwIMUHeadingType
Types of the heading degree.
Definition: IMU.h:88
Magnectic heading.
Definition: IMU.h:94
#define DW_API_PUBLIC
Definition: Exports.h:76
float64_t turnrate[3]
Roll, pitch, and yaw turn rate (i.e., gyroscope)[rad/s].
Definition: IMU.h:120
dwIMUHeadingType headingType
Type of the heading information.
Definition: IMU.h:132
float64_t orientation[3]
Roll, pitch, and yaw angle of the orientation returned by the IMU [degree].
Definition: IMU.h:114