DriveWorks SDK Reference

| 0.6.67 Release

Egomotion.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) 2015-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 
57 #ifndef DW_EGOMOTION_EGOMOTION_H__
58 #define DW_EGOMOTION_EGOMOTION_H__
59 
60 #include <dw/core/Config.h>
61 #include <dw/core/Exports.h>
62 #include <dw/core/Context.h>
63 #include <dw/core/Types.h>
64 
65 #include <dw/sensors/imu/IMU.h>
66 #include <dw/sensors/gps/GPS.h>
67 
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71 
72 typedef struct dwEgomotionObject *dwEgomotionHandle_t;
73 
75 typedef enum dwMotionModel {
80 
85 
92 
94 
102 
108 {
112 
116 
118 
122 typedef struct dwEgoMotionParameters {
123 
125  dwTransformation imu2rig;
126 
129 
131  dwMotionModel motionModel;
132 
139 
143  uint32_t historySize;
144 
148  float32_t gyroscopeBias[3];
149 
153 
155 
163 {
164  DW_EGOMOTION_ROLL = 1 << 3,
166  DW_EGOMOTION_YAW = 1 << 5,
167 
171 
175 
179 
183 
185 
189 typedef struct {
190 
191  float32_t rotation[4];
192  float32_t linearVelocity[3];
193  float32_t angularVelocity[3];
195 
196  float64_t location[3];
197 
198  uint32_t validFlags;
200 
209 typedef struct {
210 
211  float32_t rotation[3];
212  float32_t velocity[3];
213  float32_t angularVelocity[3];
214 
215  float32_t location[3];
216 
217  uint32_t validFlags;
219 
232 dwStatus dwEgomotion_initialize(dwEgomotionHandle_t *obj, const dwEgoMotionParameters *params, dwContextHandle_t ctx);
233 
244 dwStatus dwEgomotion_reset(dwEgomotionHandle_t obj);
245 
257 dwStatus dwEgomotion_release(dwEgomotionHandle_t *obj);
258 
259 
276  float32_t measuredValue, dwTime_t timestamp_us,
277  dwEgomotionHandle_t obj);
278 
291 dwStatus dwEgomotion_addIMUMeasurement(const dwIMUFrame *imu, dwEgomotionHandle_t obj);
292 
293 
306 dwStatus dwEgomotion_addGPSMeasurement(const dwGPSFrame *location, dwEgomotionHandle_t obj);
307 
331 dwStatus dwEgomotion_update(dwTime_t timestamp_us, dwEgomotionHandle_t obj);
332 
354  dwEgomotionHandle_t obj);
355 
373 dwStatus dwEgomotion_computeRelativeTransformation(dwTransformation *poseAtoB,
374  dwTime_t timestamp_a, dwTime_t timestamp_b,
375  dwEgomotionHandle_t obj);
376 
389 dwStatus dwEgomotion_getEstimationTimestamp(dwTime_t *timestamp_us, dwEgomotionHandle_t obj);
390 
402 dwStatus dwEgomotion_getEstimation(dwEgomotionResult *result, dwEgomotionHandle_t obj);
403 
417 dwStatus dwEgomotion_getUncertainty(dwEgomotionUncertainty *result, dwEgomotionHandle_t obj);
418 
430 dwStatus dwEgomotion_getHistorySize(size_t *num, dwEgomotionHandle_t obj);
431 
448  size_t index, dwEgomotionHandle_t obj);
449 
461 dwStatus dwEgomotion_getMotionModel(dwMotionModel* model, dwEgomotionHandle_t obj);
462 
463 //-----------------------------
464 // utility functions
465 
466 
480 dwStatus dwEgomotion_applyRelativeTransformation(dwTransformation *newVehicle2World,
481  const dwTransformation* poseOld2New,
482  const dwTransformation* oldVehicle2World);
483 
484 
485 #ifdef __cplusplus
486 }
487 #endif
488 
489 #endif // DW_EGOMOTION_EGOMOTION_H__
rotation around z-axis.
Definition: Egomotion.h:166
DW_API_PUBLIC dwStatus dwEgomotion_getMotionModel(dwMotionModel *model, dwEgomotionHandle_t obj)
Returns the type of the motion model used.
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
Definition: Types.h:77
Combines IMU and ackerman motion model to estimate egomotion.
Definition: Egomotion.h:84
dwEgomotionDataField
Defines flags that indicate valid data fields.
Definition: Egomotion.h:162
Holds initialization parameters for the EgoMotion module.
Definition: Egomotion.h:122
DW_API_PUBLIC dwStatus dwEgomotion_initialize(dwEgomotionHandle_t *obj, const dwEgoMotionParameters *params, dwContextHandle_t ctx)
Initializes the Egomotion module.
DW_API_PUBLIC dwStatus dwEgomotion_addIMUMeasurement(const dwIMUFrame *imu, dwEgomotionHandle_t obj)
Adds an inertial motion unit measurement to the egomotion module.
DW_API_PUBLIC dwStatus dwEgomotion_addOdometry(dwMotionModelMeasurement measuredType, float32_t measuredValue, dwTime_t timestamp_us, dwEgomotionHandle_t obj)
Notifies the egomotion module of a new odometry measurement.
dwTime_t estimationPeriod
Auto update state estimation after a predefined period of time in [usec].
Definition: Egomotion.h:138
uint64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:89
DW_API_PUBLIC dwStatus dwEgomotion_getUncertainty(dwEgomotionUncertainty *result, dwEgomotionHandle_t obj)
Gets the current estimation uncertainties.
NVIDIA DriveWorks API: Core Methods
uint32_t validFlags
Bitwise combination of dwEgomotionDataField flags.
Definition: Egomotion.h:198
DW_API_PUBLIC dwStatus dwEgomotion_getEstimation(dwEgomotionResult *result, dwEgomotionHandle_t obj)
Gets the current estimated pose.
NVIDIA DriveWorks API: Core Exports
uint32_t historySize
Number of motion results to keep in the history (if 0 specified default of 1000 is used)...
Definition: Egomotion.h:143
double float64_t
Definition: Types.h:78
DW_API_PUBLIC dwStatus dwEgomotion_getEstimationTimestamp(dwTime_t *timestamp_us, dwEgomotionHandle_t obj)
Gets the timestamp of the available estimation result.
DW_API_PUBLIC dwStatus dwEgomotion_update(dwTime_t timestamp_us, dwEgomotionHandle_t obj)
Runs the motion model estimation for a given timestamp.
dwStatus
Status definition.
Definition: Status.h:167
DW_API_PUBLIC dwStatus dwEgomotion_addGPSMeasurement(const dwGPSFrame *location, dwEgomotionHandle_t obj)
Adds location measurement to the egomotion module.
DW_API_PUBLIC dwStatus dwEgomotion_getHistorySize(size_t *num, dwEgomotionHandle_t obj)
Returns the number of elements currently stored in the motion history.
rotation around y axis.
Definition: Egomotion.h:165
struct dwEgomotionObject * dwEgomotionHandle_t
Definition: Egomotion.h:72
Combines IMU and Ackerman motion model to estimate egomotion as well as GPS location.
Definition: Egomotion.h:91
float32_t wheelBase
Wheel base of the vehicle.
Definition: Egomotion.h:128
dwEgoMotionSensorCharacteristics sensorNoise
Pass a sensor noise struct containing all information about sensor noise.
Definition: Egomotion.h:152
DW_API_PUBLIC dwStatus dwEgomotion_computeRelativeTransformation(dwTransformation *poseAtoB, dwTime_t timestamp_a, dwTime_t timestamp_b, dwEgomotionHandle_t obj)
Computes the relative pose between two timestamps in the past.
dwMotionModel
Defines the egomotion models.
Definition: Egomotion.h:75
DW_API_PUBLIC dwStatus dwEgomotion_reset(dwEgomotionHandle_t obj)
Resets the egomotion module.
rotation around x axis.
Definition: Egomotion.h:164
float32_t imuSamplingRateHz
If known this entry shall indicate expected sampling rate in [Hz] of the imu sensor.
Definition: Egomotion.h:115
DW_API_PUBLIC dwStatus dwEgomotion_estimate(dwEgomotionResult *pose, dwEgomotionUncertainty *sigma, dwTime_t timestamp_us, dwEgomotionHandle_t obj)
Runs the motion model estimation for a given timestamp and predicts motion as it would happen for the...
An IMU frame containing sensor readings from the IMU sensor.
Definition: IMU.h:105
DW_API_PUBLIC dwStatus dwEgomotion_getHistoryEntry(const dwEgomotionResult **pose, const dwEgomotionUncertainty **sigma, dwTime_t *timestamp_us, size_t index, dwEgomotionHandle_t obj)
Returns an entry from the motion history that is currently available.
DW_API_PUBLIC dwStatus dwEgomotion_applyRelativeTransformation(dwTransformation *newVehicle2World, const dwTransformation *poseOld2New, const dwTransformation *oldVehicle2World)
Applies the estimated relative motion as returned by dwEgomotion_computeRelativeTransformation() to a...
dwMotionModel motionModel
Specifies the motion model to be used for pose prediction, for example, Ackermann principle based...
Definition: Egomotion.h:131
NVIDIA DriveWorks API: GPS
Holds egomotion result uncertainties.
Definition: Egomotion.h:209
Holds egomotion results that contain multiple fields.
Definition: Egomotion.h:189
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:78
float32_t gyroNoiseDensityDeg
Expected zero mean measurement noise of the gyroscope, also known as Noise Density [deg/s/sqrt(Hz)] A...
Definition: Egomotion.h:111
dwTransformation imu2rig
Extrinsics from the IMU coordinate system to the vehicle rig coordinate system.
Definition: Egomotion.h:125
DW_API_PUBLIC dwStatus dwEgomotion_release(dwEgomotionHandle_t *obj)
Releases the egomotion module.
dwMotionModelMeasurement
Defines motion measurements.
Definition: Egomotion.h:98
Sensor measurement noise characteristics for the individual used sensors.
Definition: Egomotion.h:107
#define DW_API_PUBLIC
Definition: Exports.h:76
NVIDIA DriveWorks API: IMU
Valid measurements are velocity and steering angle.
Definition: Egomotion.h:79
A GPS packet containing localization information.
Definition: GPS.h:60