DriveWorks SDK Reference
5.10.90 Release
For Test and Development only

Egomotion.h
Go to the documentation of this file.
1
2//
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) 2015-2022 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
59#ifndef DW_EGOMOTION_EGOMOTION_H_
60#define DW_EGOMOTION_EGOMOTION_H_
61
62#include <dw/core/base/Config.h>
65#include <dw/core/base/Types.h>
66
68
69#include <dw/sensors/imu/IMU.h>
70
71#include <dw/rig/Rig.h>
73
74#ifdef __cplusplus
75extern "C" {
76#endif
77
81typedef struct dwEgomotionObject* dwEgomotionHandle_t;
82
86typedef struct dwEgomotionObject const* dwEgomotionConstHandle_t;
87
89typedef enum dwMotionModel {
116
145
147
151typedef enum {
156
179
202
220
228
236
244
248typedef struct dwEgomotionLinearAccelFilterParams
249{
252
253 // Simple filter parameters (ignored for other modes)
260
264typedef struct
265{
269
292
297
299
304{
308
312
317
321
325
330
333
340
342
347{
352
358 DW_DEPRECATED("Deriving lateral slip coefficient from vehicle parameters, unless this parameter is non-zero.")
360
364
367
372
383
387 uint32_t historySize;
388
393
398
401
404
408
415
417
423
427
431
435
439
441
446typedef struct dwEgomotionResult
447{
450
452
453 float32_t linearVelocity[3];
457
458 float32_t angularVelocity[3];
459
460 float32_t linearAcceleration[3];
461
462 float32_t angularAcceleration[3];
463
464 int32_t validFlags;
466
480typedef struct
481{
483
484 float32_t linearVelocity[3];
485
486 float32_t angularVelocity[3];
487
488 float32_t linearAcceleration[3];
489
490 float32_t angularAcceleration[3];
491
493
494 int64_t validFlags;
496
500typedef struct
501{
505 bool valid;
507
539 const char* imuSensorName, const char* vehicleSensorName);
540
560 uint32_t imuSensorIdx, uint32_t vehicleSensorIdx);
561
578
590
603
629DW_DEPRECATED("Use dwEgomotion_addVehicleState instead.")
631 float32_t measuredValue, dwTime_t timestamp,
633
667
704 dwVehicleIONonSafetyState const* nonSafeState,
705 dwVehicleIOActuationFeedback const* actuationFeedback,
707
721
741
756
786DW_DEPRECATED("Deprecated, will be removed. Set dwEgomotionParameters.autoupdate to true instead.")
788
812 dwTime_t timestamp_us, dwEgomotionConstHandle_t obj);
813
835 dwTime_t timestamp_a, dwTime_t timestamp_b,
837
862 dwEgomotionRelativeUncertainty* const uncertainty,
863 dwTime_t const timestamp,
864 dwCoordinateSystem const coordinateSystemA,
865 dwCoordinateSystem const coordinateSystemB,
866 dwEgomotionConstHandle_t const obj);
867
882
895
909
925
940
955
973 size_t index, dwEgomotionConstHandle_t obj);
974
987
988//-----------------------------
989// utility functions
990
1005 const dwTransformation3f* vehicleAToB,
1006 const dwTransformation3f* vehicleToWorldAtA);
1007
1027DW_DEPRECATED("dwEgomotion_computeSteeringAngleFromIMU() is deprecated and will be removed soon. ")
1029 float32_t* inverseSteeringR,
1030 const dwIMUFrame* imuMeasurement,
1032
1051
1070
1071#ifdef __cplusplus
1072}
1073#endif
1075#endif // DW_EGOMOTION_EGOMOTION_H_
NVIDIA DriveWorks API: Core Methods
NVIDIA DriveWorks API: Coordinate Systems
Defines a single-precision quaternion.
NVIDIA DriveWorks API: IMU
Defines a 3x3 matrix of floating point numbers by using only one array.
Definition: MatrixTypes.h:139
Specifies a 3D rigid transformation.
Definition: MatrixTypes.h:186
Defines a three-element floating-point vector.
Definition: MatrixTypes.h:79
NVIDIA DriveWorks API: Rig Configuration
NVIDIA DriveWorks API: Core Types
NVIDIA DriveWorks API: VehicleIO car controller
NVIDIA DriveWorks API: Core Exports
Non-safety critical RoV state.
Safety critical VIO state.
The vehicle IO state data.
dwCoordinateSystem
Coordinate systems.
float float32_t
Specifies POD types.
Definition: BasicTypes.h:57
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: BasicTypes.h:63
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:83
#define DW_DEPRECATED(msg)
Definition: Exports.h:66
#define DW_API_PUBLIC
Definition: Exports.h:54
dwStatus
Status definition.
Definition: Status.h:173
float32_t gyroNoiseDensityDeg
Expected zero mean measurement noise of the gyroscope, also known as Noise Density [deg/s/sqrt(Hz)] A...
Definition: Egomotion.h:307
float32_t odometrySamplingRateHz
If known this entry shall indicate expected sampling rate in [Hz] of the odometry signals.
Definition: Egomotion.h:329
dwTime_t velocityLatency
CAN velocity latency in microseconds which is read from can properties in rig file.
Definition: Egomotion.h:332
float32_t gyroscopeBias[3]
Initial gyroscope biases, if known at initialization time.
Definition: Egomotion.h:392
dwMatrix3f rotation
Rotation covariance represented as euler angles (order: roll, pitch, yaw) in [rad^2].
Definition: Egomotion.h:482
float32_t torsionalSpringPitchNaturalFrequency
Torsional spring model parameters.
Definition: Egomotion.h:291
dwTransformation3f imu2rig
IMU extrinsics.
Definition: Egomotion.h:363
dwEgomotionSensorCharacteristics sensorParameters
Sensor parameters, containing information about sensor characteristics.
Definition: Egomotion.h:397
float32_t accNoiseDensityMicroG
Expected zero mean measurement noise of the linear accelerometer, also known as Noise Density [ug/sqr...
Definition: Egomotion.h:320
dwEgomotionSuspensionModel model
Suspension model to use.
Definition: Egomotion.h:268
dwMatrix3f rotation
a 3x3 covariance of the rotation (order: roll, pitch, yaw) [rad]
Definition: Egomotion.h:502
float32_t accelerationFilterTimeConst
Time constant of the IMU acceleration measurements.
Definition: Egomotion.h:254
dwEgomotionSpeedMeasurementType speedMeasurementType
Defines which velocity readings from dwVehicleIOState shall be used for egomotion estimation.
Definition: Egomotion.h:400
float32_t gyroDriftRate
Expected gyroscope drift rate in [deg/s].
Definition: Egomotion.h:311
float32_t torsionalSpringPitchDampingRatio
Level of damping relative to critical damping around the pitch axis of the vehicle [dimensionless].
Definition: Egomotion.h:296
bool estimateInitialOrientation
When enabled, initial rotation will be estimated from accelerometer measurements.
Definition: Egomotion.h:371
dwEgomotionSteeringMeasurementType steeringMeasurementType
Defines which steering readings from dwVehicleIOState shall be used for egomotion estimation.
Definition: Egomotion.h:403
uint32_t historySize
Number of state estimates to keep in the history (if 0 specified default of 1000 is used).
Definition: Egomotion.h:387
dwTime_t timestamp
Timestamp of egomotion state estimate [us].
Definition: Egomotion.h:451
int32_t validFlags
Bitwise combination of dwEgomotionDataField flags.
Definition: Egomotion.h:464
float32_t velocityFactor
CAN velocity correction factor which is read from can properties in rig file.
Definition: Egomotion.h:339
float32_t gyroBiasRange
If known this value in [rad/s] shall indicate standard deviation of the expected bias range of the gy...
Definition: Egomotion.h:316
float32_t imuSamplingRateHz
If known this entry shall indicate expected sampling rate in [Hz] of the IMU sensor.
Definition: Egomotion.h:324
bool automaticUpdate
Automatically update state estimation.
Definition: Egomotion.h:382
dwEgomotionSuspensionParameters suspension
Suspension model parameters.
Definition: Egomotion.h:414
dwMatrix3f translation
a 3x3 covariance of the translation (x,y,z) [m]
Definition: Egomotion.h:503
float32_t lateralSlipCoefficient
Lateral slip coefficient [rad*s^2/m].
Definition: Egomotion.h:359
dwEgomotionLinearAccelerationFilterParams linearAccelerationFilterParameters
Linear acceleration filter parameters.
Definition: Egomotion.h:407
dwEgomotionLinearAccelerationFilterMode mode
Linear acceleration filter mode. Default (0): no filtering.
Definition: Egomotion.h:251
float32_t measurementNoiseStdevAcceleration
Standard deviation of measurement noise in acceleration [m/s^2].
Definition: Egomotion.h:258
dwVehicle vehicle
Vehicle parameters to setup the model.
Definition: Egomotion.h:351
int64_t validFlags
Bitwise combination of dwEgomotionDataField flags.
Definition: Egomotion.h:494
float32_t measurementNoiseStdevSpeed
Standard deviation of measurement noise in speed [m/s].
Definition: Egomotion.h:257
float32_t processNoiseStdevAcceleration
Square root of continuous time process noise covariance in acceleration [m/s^2 * 1/sqrt(s)].
Definition: Egomotion.h:256
float32_t processNoiseStdevSpeed
Square root of continuous time process noise covariance in speed [m/s * 1/sqrt(s)].
Definition: Egomotion.h:255
bool valid
indicates whether uncertainty estimates are valid or not
Definition: Egomotion.h:505
dwMotionModel motionModel
Specifies the motion model to be used for pose estimation.
Definition: Egomotion.h:366
dwQuaternionf rotation
Rotation represented as quaternion (x,y,z,w).
Definition: Egomotion.h:448
dwTime_t timeInterval
relative motion time interval [us]
Definition: Egomotion.h:504
dwTime_t timestamp
Timestamp of egomotion uncertainty estimate [us].
Definition: Egomotion.h:492
dwMotionModelMeasurement
Defines motion measurements.
Definition: Egomotion.h:151
DW_API_PUBLIC dwStatus dwEgomotion_getEstimation(dwEgomotionResult *result, dwEgomotionConstHandle_t obj)
Gets the latest state estimate.
DW_API_PUBLIC dwStatus dwEgomotion_getMotionModel(dwMotionModel *model, dwEgomotionConstHandle_t obj)
Returns the type of the motion model used.
DW_API_PUBLIC dwStatus dwEgomotion_getGyroscopeBias(dwVector3f *gyroBias, dwEgomotionConstHandle_t obj)
Get estimated gyroscope bias.
DW_API_PUBLIC dwStatus dwEgomotion_getUncertainty(dwEgomotionUncertainty *result, dwEgomotionConstHandle_t obj)
Gets the latest state estimate uncertainties.
DW_API_PUBLIC dwStatus dwEgomotion_computeSteeringAngleFromIMU(float32_t *steeringAngle, float32_t *inverseSteeringR, const dwIMUFrame *imuMeasurement, dwEgomotionConstHandle_t obj)
Computes steering angle of the vehicle based on IMU measurement.
dwEgomotionDataField
Defines flags that indicate validity of corresponding data in dwEgomotionResult and dwEgomotionUncert...
Definition: Egomotion.h:421
DW_API_PUBLIC dwStatus dwEgomotion_hasEstimation(bool *result, dwEgomotionConstHandle_t obj)
Check whether estimation is available.
struct dwEgomotionObject const * dwEgomotionConstHandle_t
Const Egomotion Handle.
Definition: Egomotion.h:86
DW_API_PUBLIC dwStatus dwEgomotion_updateVehicle(const dwVehicle *vehicle, dwEgomotionHandle_t obj)
This method updates the egomotion module with an updated vehicle.
DW_API_PUBLIC dwStatus dwEgomotion_getHistoryElement(dwEgomotionResult *pose, dwEgomotionUncertainty *uncertainty, size_t index, dwEgomotionConstHandle_t obj)
Returns an element from the motion history that is currently available.
DW_API_PUBLIC dwStatus dwEgomotion_addVehicleIOState(dwVehicleIOSafetyState const *safeState, dwVehicleIONonSafetyState const *nonSafeState, dwVehicleIOActuationFeedback const *actuationFeedback, dwEgomotionHandle_t obj)
Notifies the egomotion module of a changed vehicle state.
DW_API_PUBLIC dwStatus dwEgomotion_reset(dwEgomotionHandle_t obj)
Resets the state estimate and all history of the egomotion module.
DW_API_PUBLIC dwStatus dwEgomotion_steeringAngleToSteeringWheelAngle(float32_t *steeringWheelAngle, float32_t steeringAngle, dwEgomotionHandle_t obj)
Convert steering angle to steering wheel angle.
dwMotionModel
Defines the motion models.
Definition: Egomotion.h:89
DW_API_PUBLIC dwStatus dwEgomotion_getEstimationTimestamp(dwTime_t *timestamp, dwEgomotionConstHandle_t obj)
Gets the timestamp of the latest state estimate.
DW_API_PUBLIC dwStatus dwEgomotion_initialize(dwEgomotionHandle_t *obj, const dwEgomotionParameters *params, dwContextHandle_t ctx)
Initializes the egomotion module.
DW_API_PUBLIC dwStatus dwEgomotion_getHistorySize(size_t *size, dwEgomotionConstHandle_t obj)
Returns the number of elements currently stored in the history.
dwEgomotionSuspensionModel
Defines egomotion suspension model.
Definition: Egomotion.h:240
DW_API_PUBLIC dwStatus dwEgomotion_updateIMUExtrinsics(const dwTransformation3f *imuToRig, dwEgomotionHandle_t obj)
This method updates the IMU extrinsics to convert from the IMU coordinate system to the vehicle rig c...
dwEgomotionLinearAccelerationFilterMode
Defines egomotion linear acceleration filter mode.
Definition: Egomotion.h:232
DW_API_PUBLIC dwStatus dwEgomotion_steeringWheelAngleToSteeringAngle(float32_t *steeringAngle, float32_t steeringWheelAngle, dwEgomotionHandle_t obj)
Convert steering wheel angle to steering angle.
DW_API_PUBLIC dwStatus dwEgomotion_addVehicleState(const dwVehicleIOState *state, dwEgomotionHandle_t obj)
Notifies the egomotion module of a changed vehicle state.
DW_API_PUBLIC dwStatus dwEgomotion_computeBodyTransformation(dwTransformation3f *const transformationAToB, dwEgomotionRelativeUncertainty *const uncertainty, dwTime_t const timestamp, dwCoordinateSystem const coordinateSystemA, dwCoordinateSystem const coordinateSystemB, dwEgomotionConstHandle_t const obj)
Compute the transformation between two coordinate systems at a specific timestamp and the uncertainty...
DW_API_PUBLIC dwStatus dwEgomotion_computeRelativeTransformation(dwTransformation3f *poseAtoB, dwEgomotionRelativeUncertainty *uncertainty, dwTime_t timestamp_a, dwTime_t timestamp_b, dwEgomotionConstHandle_t obj)
Computes the relative transformation between two timestamps and the uncertainty of this transform.
dwEgomotionSteeringMeasurementType
Defines steering measurement types.
Definition: Egomotion.h:224
DW_API_PUBLIC dwStatus dwEgomotion_initParamsFromRig(dwEgomotionParameters *params, dwConstRigHandle_t rigConfiguration, const char *imuSensorName, const char *vehicleSensorName)
Initialize egomotion parameters from a provided RigConfiguration.
DW_API_PUBLIC dwStatus dwEgomotion_addOdometry(dwMotionModelMeasurement measuredType, float32_t measuredValue, dwTime_t timestamp, dwEgomotionHandle_t obj)
Notifies the egomotion module of a new odometry measurement.
DW_API_PUBLIC dwStatus dwEgomotion_applyRelativeTransformation(dwTransformation3f *vehicleToWorldAtB, const dwTransformation3f *vehicleAToB, const dwTransformation3f *vehicleToWorldAtA)
Applies the estimated relative motion as returned by dwEgomotion_computeRelativeTransformation to a g...
struct dwEgomotionObject * dwEgomotionHandle_t
Egomotion Handle.
Definition: Egomotion.h:81
DW_API_PUBLIC dwStatus dwEgomotion_release(dwEgomotionHandle_t obj)
Releases the egomotion module.
dwEgomotionSpeedMeasurementType
Defines speed measurement types.
Definition: Egomotion.h:160
DW_API_PUBLIC dwStatus dwEgomotion_update(dwTime_t timestamp_us, dwEgomotionHandle_t obj)
Runs the motion model estimation for a given timestamp.
DW_API_PUBLIC dwStatus dwEgomotion_addIMUMeasurement(const dwIMUFrame *imu, dwEgomotionHandle_t obj)
Adds an IMU frame to the egomotion module.
DW_API_PUBLIC dwStatus dwEgomotion_initParamsFromRigByIndex(dwEgomotionParameters *params, dwConstRigHandle_t rigConfiguration, uint32_t imuSensorIdx, uint32_t vehicleSensorIdx)
Same as dwEgomotion_initParamsFromRig however uses sensor indices in rigConfiguration instead of thei...
DW_API_PUBLIC dwStatus dwEgomotion_estimate(dwEgomotionResult *pose, dwEgomotionUncertainty *uncertainty, dwTime_t timestamp_us, dwEgomotionConstHandle_t obj)
Estimates the state for a given timestamp.
@ DW_EGOMOTION_MEASUREMENT_VELOCITY
Vehicle velocity [m/s].
Definition: Egomotion.h:152
@ DW_EGOMOTION_MEASUREMENT_STEERINGANGLE
Steering angle [rad].
Definition: Egomotion.h:153
@ DW_EGOMOTION_MEASUREMENT_STEERINGWHEELANGLE
Steering wheel angle [rad].
Definition: Egomotion.h:154
@ DW_EGOMOTION_LIN_VEL_X
indicates validity of linearVelocity[0]
Definition: Egomotion.h:424
@ DW_EGOMOTION_LIN_ACC_X
indicates validity of linearAcceleration[0]
Definition: Egomotion.h:432
@ DW_EGOMOTION_ANG_ACC_Z
indicates validity of angularAcceleration[2]
Definition: Egomotion.h:438
@ DW_EGOMOTION_ANG_ACC_Y
indicates validity of angularAcceleration[1]
Definition: Egomotion.h:437
@ DW_EGOMOTION_ROTATION
indicates validity of rotation,
Definition: Egomotion.h:422
@ DW_EGOMOTION_LIN_VEL_Y
indicates validity of linearVelocity[1]
Definition: Egomotion.h:425
@ DW_EGOMOTION_LIN_ACC_Z
indicates validity of linearAcceleration[2]
Definition: Egomotion.h:434
@ DW_EGOMOTION_ANG_ACC_X
indicates validity of angularAcceleration[0]
Definition: Egomotion.h:436
@ DW_EGOMOTION_LIN_ACC_Y
indicates validity of linearAcceleration[1]
Definition: Egomotion.h:433
@ DW_EGOMOTION_ANG_VEL_Y
indicates validity of angularVelocity[1]
Definition: Egomotion.h:429
@ DW_EGOMOTION_ANG_VEL_X
indicates validity of angularVelocity[0]
Definition: Egomotion.h:428
@ DW_EGOMOTION_LIN_VEL_Z
indicates validity of linearVelocity[2]
Definition: Egomotion.h:426
@ DW_EGOMOTION_ANG_VEL_Z
indicates validity of angularVelocity[2]
Definition: Egomotion.h:430
@ DW_EGOMOTION_ODOMETRY
Given odometry information, estimates motion of the vehicle using a bicycle model.
Definition: Egomotion.h:115
@ DW_EGOMOTION_IMU_ODOMETRY
Fuses odometry model with IMU measurements to estimate motion of the vehicle.
Definition: Egomotion.h:144
@ DW_EGOMOTION_SUSPENSION_RIGID_MODEL
No suspension model. Equivalent to perfectly rigid suspension.
Definition: Egomotion.h:241
@ DW_EGOMOTION_SUSPENSION_TORSIONAL_SPRING_MODEL
Models suspension as single-axis damped torsional spring.
Definition: Egomotion.h:242
@ DW_EGOMOTION_ACC_FILTER_NO_FILTERING
no filtering of the output linear acceleration
Definition: Egomotion.h:233
@ DW_EGOMOTION_ACC_FILTER_SIMPLE
simple low-pass filtering of the acceleration
Definition: Egomotion.h:234
@ DW_EGOMOTION_STEERING_WHEEL_ANGLE
Definition: Egomotion.h:226
@ DW_EGOMOTION_FRONT_STEERING
Definition: Egomotion.h:225
@ DW_EGOMOTION_REAR_WHEEL_SPEED
Indicates that speeds are angular speeds [rad/s] measured at rear wheels.
Definition: Egomotion.h:201
@ DW_EGOMOTION_FRONT_SPEED
Indicates that speed is linear speed [m/s] measured at front wheels (along steering direction).
Definition: Egomotion.h:178
@ DW_EGOMOTION_REAR_SPEED
Indicates that speed is linear speed [m/s] measured at rear axle center (along steering direction).
Definition: Egomotion.h:218
Defines egomotion linear acceleration filter parameters.
Definition: Egomotion.h:249
Holds initialization parameters for the Egomotion module.
Definition: Egomotion.h:347
Holds egomotion uncertainty estimates for a relative motion estimate.
Definition: Egomotion.h:501
Holds egomotion state estimate.
Definition: Egomotion.h:447
Sensor measurement noise characteristics.
Definition: Egomotion.h:304
Suspension model type and parameters.
Definition: Egomotion.h:265
Holds egomotion uncertainty estimates.
Definition: Egomotion.h:481
This structure contains one frame of data from a IMU sensor.
Definition: IMU.h:292
struct dwRigObject const * dwConstRigHandle_t
Definition: Rig.h:71
DEPRECATED: Properties of a passenger car vehicle.
Definition: Vehicle.h:316