NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
Egomotion.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2015-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
42 #ifndef DW_EGOMOTION_BASE_EGOMOTION_H_
43 #define DW_EGOMOTION_BASE_EGOMOTION_H_
44 
45 #include <dw/core/base/Config.h>
46 #include <dw/core/base/Exports.h>
48 #include <dw/core/base/Types.h>
49 
52 
53 #include <dw/sensors/imu/IMU.h>
54 
55 #include <dw/rig/Rig.h>
57 
58 #include "EgomotionTypes.h"
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
67 typedef struct dwEgomotionObject* dwEgomotionHandle_t;
68 
72 typedef struct dwEgomotionObject const* dwEgomotionConstHandle_t;
73 
107 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
108 DW_DEPRECATED("dwEgomotion_initParamsFromRig has been deprecated and will be removed in the next release. Use dwEgomotion2_initParamsFromRig instead.")
109 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
112  const char* imuSensorName, const char* vehicleSensorName);
113 
135 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
136 DW_DEPRECATED("dwEgomotion_initParamsFromRigByIndex has been deprecated and will be removed in the next release. Use dwEgomotion2_initParamsFromRigByIndex instead.")
137 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
140  uint32_t imuSensorIdx, uint32_t vehicleSensorIdx);
141 
160 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
161 DW_DEPRECATED("dwEgomotion_initialize has been deprecated and will be removed in the next release. Use dwEgomotion2_initialize instead.")
162 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
165 
181 
198 
234 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
235 DW_DEPRECATED("dwEgomotion_addVehicleState has been deprecated and will be removed in the next release. Use dwEgomotion_addVIOState instead.")
236 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
239 
279  dwVehicleIOQMState const* qmState,
281 
324  dwVehicleIONonSafetyState const* nonSafeState,
325  dwVehicleIOActuationFeedback const* actuationFeedback,
327 
348 
372 
396 dwStatus dwEgomotion_addIMUMeasurementByIndex(const dwIMUFrame* imu, uint32_t const sensorIndex, dwEgomotionHandle_t obj);
397 
417 
453 
481  dwTime_t timestamp_us, dwEgomotionConstHandle_t obj);
482 
508  dwTime_t timestamp_a, dwTime_t timestamp_b,
510 
539  dwEgomotionTransformationQuality* const quality,
540  dwTime_t const timestamp,
541  dwCoordinateSystem const coordinateSystemA,
542  dwCoordinateSystem const coordinateSystemB,
544 
563 
580 
598 
618 
637 
657 
676 
698  size_t index, dwEgomotionConstHandle_t obj);
699 
716 
717 //-----------------------------
718 // utility functions
719 
738  const dwTransformation3f* vehicleAToB,
739  const dwTransformation3f* vehicleToWorldAtA);
740 
763 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
764 DW_DEPRECATED("dwEgomotion_computeSteeringAngleFromIMU() is deprecated and will be removed soon. ")
765 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
768  float32_t* inverseSteeringR,
769  const dwIMUFrame* imuMeasurement,
771 
791 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
792 DW_DEPRECATED("dwEgomotion_steeringWheelAngleToSteeringAngle has been deprecated and will be removed in the next release.")
793 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
797 
817 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
818 DW_DEPRECATED("dwEgomotion_steeringAngleToSteeringWheelAngle has been deprecated and will be removed in the next release.")
819 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
823 
824 #ifdef __cplusplus
825 }
826 #endif
827 
828 #endif // DW_EGOMOTION_BASE_EGOMOTION_H_
dwEgomotion_getHistorySize
DW_API_PUBLIC dwStatus dwEgomotion_getHistorySize(size_t *size, dwEgomotionConstHandle_t obj)
Returns the number of elements currently stored in the history.
dwEgomotion_computeRelativeTransformation
DW_API_PUBLIC dwStatus dwEgomotion_computeRelativeTransformation(dwTransformation3f *poseAtoB, dwEgomotionTransformationQuality *quality, dwTime_t timestamp_a, dwTime_t timestamp_b, dwEgomotionConstHandle_t obj)
Computes the relative transformation between two timestamps and the uncertainty of this transform.
dwEgomotionHandle_t
struct dwEgomotionObject * dwEgomotionHandle_t
Egomotion Handle.
Definition: Egomotion.h:67
dwEgomotion_getMotionModel
DW_API_PUBLIC dwStatus dwEgomotion_getMotionModel(dwMotionModel *model, dwEgomotionConstHandle_t obj)
Returns the type of the motion model used.
dwEgomotion_addIMUMeasurementByIndex
DW_API_PUBLIC dwStatus dwEgomotion_addIMUMeasurementByIndex(const dwIMUFrame *imu, uint32_t const sensorIndex, dwEgomotionHandle_t obj)
Adds an IMU frame to the egomotion module for a specific IMU.
dwConstRigHandle_t
struct dwRigObject const * dwConstRigHandle_t
Handle representing the const Rig interface.
Definition: Rig.h:57
Types.h
EgomotionTypes.h
Rig.h
dwVehicleIONonSafetyState
Non-safety critical RoV state.
Definition: VehicleIOValStructures.h:9640
dwEgomotionUncertainty
Instantaneous state uncertainty estimates.
Definition: EgomotionTypes.h:523
dwEgomotion_updateIMUExtrinsics
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...
dwEgomotion_initParamsFromRig
DW_API_PUBLIC dwStatus dwEgomotion_initParamsFromRig(dwEgomotionParameters *params, dwConstRigHandle_t rigConfiguration, const char *imuSensorName, const char *vehicleSensorName)
Initialize egomotion parameters from a provided RigConfiguration.
dwEgomotion_addVIOState
DW_API_PUBLIC dwStatus dwEgomotion_addVIOState(dwVehicleIOASILState const *asilState, dwVehicleIOQMState const *qmState, dwEgomotionHandle_t obj)
Notifies the egomotion module of a changed vehicle state.
dwEgomotion_estimate
DW_API_PUBLIC dwStatus dwEgomotion_estimate(dwEgomotionResult *pose, dwEgomotionUncertainty *uncertainty, dwTime_t timestamp_us, dwEgomotionConstHandle_t obj)
Estimates the state for a given timestamp.
dwEgomotion_computeSteeringAngleFromIMU
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.
dwEgomotion_getGyroscopeBias
DW_API_PUBLIC dwStatus dwEgomotion_getGyroscopeBias(dwVector3f *gyroBias, dwEgomotionConstHandle_t obj)
Get estimated gyroscope bias of the BASE IMU.
dwEgomotion_initParamsFromRigByIndex
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...
dwEgomotion_getUncertainty
DW_API_PUBLIC dwStatus dwEgomotion_getUncertainty(dwEgomotionUncertainty *result, dwEgomotionConstHandle_t obj)
Gets the latest state estimate uncertainties.
dwVehicleIOASILState
State signals with an ASIL rating.
Definition: VehicleIOValStructures.h:3070
timestamp
const WFDPipeline const WFDSource const WFDTransition const WFDRect *const const WFDuint64 timestamp
Definition: wfdext.h:114
Exports.h
CoordinateSystem.h
dwEgomotionParameters
Holds initialization parameters for the Egomotion module.
Definition: EgomotionTypes.h:371
dwEgomotion_release
DW_API_PUBLIC dwStatus dwEgomotion_release(dwEgomotionHandle_t obj)
Releases the egomotion module.
dwMotionModel
dwMotionModel
Defines the motion models.
Definition: EgomotionTypes.h:37
dwEgomotion_initialize
DW_API_PUBLIC dwStatus dwEgomotion_initialize(dwEgomotionHandle_t *obj, const dwEgomotionParameters *params, dwContextHandle_t ctx)
Initializes the egomotion module.
dwEgomotion_reset
DW_API_PUBLIC dwStatus dwEgomotion_reset(dwEgomotionHandle_t obj)
Resets the state estimate and all history of the egomotion module.
dwVehicleIOState
The vehicle IO state data. Fields only set if supported by VehicleIO driver.
Definition: VehicleIOLegacyStructures.h:907
dwTime_t
int64_t dwTime_t
Definition: core/base/BasicTypes.h:65
float32_t
float float32_t
Definition: core/base/BasicTypes.h:43
dwVector3f
Defines a three-element floating-point vector.
Definition: MatrixTypes.h:74
dwEgomotion_getGyroscopeBiasByIndex
DW_API_PUBLIC dwStatus dwEgomotion_getGyroscopeBiasByIndex(dwVector3f *gyroBias, uint32_t const sensorIndex, dwEgomotionConstHandle_t obj)
Get estimated gyroscope bias of specific IMU.
dwEgomotion_applyRelativeTransformation
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...
dwEgomotionTransformationQuality
Relative transformation validity and uncertainty.
Definition: EgomotionTypes.h:542
dwIMUFrame
This structure contains one frame of data from a IMU sensor.
Definition: IMUTypes.h:346
obj
const NvSciSyncObj *const obj
Definition: wfdext.h:528
dwVehicle
DEPRECATED: Properties of a passenger car vehicle.
Definition: Vehicle.h:590
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:32
DW_DEPRECATED
#define DW_DEPRECATED(msg)
Definition: core/base/Exports.h:80
VehicleIOValStructures.h
dwEgomotion_steeringWheelAngleToSteeringAngle
DW_API_PUBLIC dwStatus dwEgomotion_steeringWheelAngleToSteeringAngle(float32_t *steeringAngle, float32_t steeringWheelAngle, dwEgomotionHandle_t obj)
Convert steering wheel angle to steering angle.
Config.h
dwEgomotion_hasEstimation
DW_API_PUBLIC dwStatus dwEgomotion_hasEstimation(bool *result, dwEgomotionConstHandle_t obj)
Check whether estimation is available.
dwContextHandle_t
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:81
dwEgomotion_updateVehicle
DW_API_PUBLIC dwStatus dwEgomotion_updateVehicle(const dwVehicle *vehicle, dwEgomotionHandle_t obj)
dwCoordinateSystem
dwCoordinateSystem
Coordinate systems.
Definition: CoordinateSystem.h:42
dwEgomotion_update
DW_API_PUBLIC dwStatus dwEgomotion_update(dwTime_t timestamp_us, dwEgomotionHandle_t obj)
Runs the motion model estimation for a given timestamp.
dwVehicleIOQMState
State signals without an ASIL rating.
Definition: VehicleIOValStructures.h:4278
dwVehicleIOActuationFeedback
Feedback from actuation.
Definition: VehicleIOValStructures.h:8062
dwEgomotion_getEstimationTimestamp
DW_API_PUBLIC dwStatus dwEgomotion_getEstimationTimestamp(dwTime_t *timestamp, dwEgomotionConstHandle_t obj)
Gets the timestamp of the latest state estimate.
dwEgomotion_getHistoryElement
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.
dwEgomotion_addIMUMeasurement
DW_API_PUBLIC dwStatus dwEgomotion_addIMUMeasurement(const dwIMUFrame *imu, dwEgomotionHandle_t obj)
Adds an IMU frame to the egomotion module for the BASE IMU.
dwTransformation3f
Specifies a 3D rigid transformation.
Definition: MatrixTypes.h:226
dwEgomotion_addVehicleState
DW_API_PUBLIC dwStatus dwEgomotion_addVehicleState(const dwVehicleIOState *state, dwEgomotionHandle_t obj)
Notifies the egomotion module of a changed vehicle state.
dwEgomotion_computeBodyTransformation
DW_API_PUBLIC dwStatus dwEgomotion_computeBodyTransformation(dwTransformation3f *const transformationAToB, dwEgomotionTransformationQuality *const quality, 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
#define DW_API_PUBLIC
Definition: core/base/Exports.h:57
IMU.h
dwEgomotionConstHandle_t
struct dwEgomotionObject const * dwEgomotionConstHandle_t
Const Egomotion Handle.
Definition: Egomotion.h:72
dwEgomotion2_initParamsFromRigByIndex
DW_API_PUBLIC dwStatus dwEgomotion2_initParamsFromRigByIndex(dwEgomotionParameters2 *params, dwConstRigHandle_t rigConfiguration, uint32_t const imu1Index, uint32_t const imu2Index, uint32_t const imu3Index)
Initializes the egomotion parameters to sane defaults given vehicle configuration.
dwEgomotion_getEstimation
DW_API_PUBLIC dwStatus dwEgomotion_getEstimation(dwEgomotionResult *result, dwEgomotionConstHandle_t obj)
Gets the latest state estimate.
dwEgomotionResult
Instantaneous state estimate.
Definition: EgomotionTypes.h:485
dwVehicleIOSafetyState
Safety critical VIO state.
Definition: VehicleIOValStructures.h:8903
dwEgomotion2_initialize
DW_API_PUBLIC dwStatus dwEgomotion2_initialize(dwEgomotionHandle_t *const obj, dwEgomotionParameters2 const *params, dwContextHandle_t const ctx)
Initializes the egomotion 2.0 module.
VehicleIO.h
Context.h
dwEgomotion_steeringAngleToSteeringWheelAngle
DW_API_PUBLIC dwStatus dwEgomotion_steeringAngleToSteeringWheelAngle(float32_t *steeringWheelAngle, float32_t steeringAngle, dwEgomotionHandle_t obj)
Convert steering angle to steering wheel angle.
dwEgomotion_addVehicleIOState
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.