Provides vehicle egomotion functionality.
The egomotion module provides implementations of motion models with different sensor modalities. Starting from a simple Ackerman-based odometry-only model, to a full-fledged fusion of inertial sensor information.
This module provides access to a history of motion estimates with a predefined cadence and length. At any point of time an access into the history can be made to retrieve previous estimates. The access into the history is timestamp-based. If an access falls between two history entries it will be interpolated.
In addition to history-based access, all motion models support prediction of the motion into the future.
Modules | |
API | |
Defines additional related API. | |
Global Egomotion Interface | |
Provides global location and orientation estimation functionality. | |
Producer/State API | |
Defines producer/state related API. | |
RadarDopplerMotion Interface | |
Provides estimation of the speed and heading of the radar observing doppler based radar measurements. | |
Typedefs | |
typedef struct dwEgomotionObject const * | dwEgomotionConstHandle_t |
Const Egomotion Handle. More... | |
typedef struct dwEgomotionObject * | dwEgomotionHandle_t |
Egomotion Handle. More... | |
typedef dwEgomotionTransformationQuality | dwEgomotionRelativeUncertainty |
Backwards compatibility between dwEgomotionRelativeUncertainty (old) and dwEgomotionTransformationQuality (new). More... | |
typedef struct dwEgomotionObject const* dwEgomotionConstHandle_t |
Const Egomotion Handle.
Alias for pointer to const egomotion instance.
Definition at line 88 of file Egomotion.h.
typedef struct dwEgomotionObject* dwEgomotionHandle_t |
Egomotion Handle.
Alias for pointer to egomotion instance.
Definition at line 83 of file Egomotion.h.
Backwards compatibility between dwEgomotionRelativeUncertainty (old) and dwEgomotionTransformationQuality (new).
Definition at line 94 of file Egomotion.h.
DW_API_PUBLIC dwStatus dwEgomotion_addIMUMeasurement | ( | const dwIMUFrame * | imu, |
dwEgomotionHandle_t | obj | ||
) |
Adds an IMU frame to the egomotion module.
The IMU frame shall contain either linear acceleration or angular velocity measurements for X, Y and Z axes or both at once; the frame will be discarded otherwise.
Egomotion might generate a new estimate on addition of IMU frame, see dwEgomotionParameters::automaticUpdate.
[in] | imu | IMU measurement. |
[in] | obj | Egomotion handle. |
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.
The following odometry measurements are required:
[in] | measuredType | Type of measurement. For example: velocity, steering angle. |
[in] | measuredValue | Value that was measured. For example: 3.6 m/s, 0.1 rad. |
[in] | timestamp | Timestamp for the measurement. |
[in] | obj | Egomotion handle. |
timestamp
is not greater than last measurement timestamp, measuredType
is not valid, or measuredValue
is not finite. dwEgomotionSpeedMeasurementType::DW_EGOMOTION_FRONT_SPEED
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.
In case relevant new information is contained in this state then it gets consumed, otherwise state is ignored.
Signals consumed depend on the selected egomotion motion model,
When using DW_EGOMOTION_ODOMETRY, the following valid signals in at least one of the structs dwVehicleIOSafetyState, dwVehicleIONonSafetyState or dwVehicleIOActuationFeedback are required:
When using DW_EGOMOTION_IMU_ODOMETRY, the following valid signals in at least one of the structs dwVehicleIOSafetyState, dwVehicleIONonSafetyState or dwVehicleIOActuationFeedback are required:
[in] | safeState | New dwVehicleIOSafetyState which contains potentially new information for egomotion consumption |
[in] | nonSafeState | New dwVehicleIONonSafetyState which contains potentially new information for egomotion consumption |
[in] | actuationFeedback | New dwVehicleIOActuationFeedback which contains potentially new information for egomotion consumption |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_addVehicleState | ( | const dwVehicleIOState * | state, |
dwEgomotionHandle_t | obj | ||
) |
Notifies the egomotion module of a changed vehicle state.
In case relevant new information is contained in this state then it gets consumed, otherwise state is ignored.
Signals consumed depend on the selected egomotion motion model,
When using DW_EGOMOTION_ODOMETRY:
When using DW_EGOMOTION_IMU_ODOMETRY:
[in] | state | New VehicleIOState which contains potentially new information for egomotion consumption |
[in] | obj | Egomotion handle. |
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 given vehicle pose.
[out] | vehicleToWorldAtB | Transformation to be filled with pose of the vehicle in world at time B. |
[in] | vehicleAToB | Transformation providing motion of vehicle from time A to time B. |
[in] | vehicleToWorldAtA | Transformation providing pose of the vehicle in world at time A. |
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 of this transform.
[out] | transformationAToB | Transformation mapping a point in coordinate system A to a point in coordinate system B . |
[out] | quality | Structure to be filled with quality of transformation (optional, ignored if nullptr provided). |
[in] | timestamp | Timestamp for which to get transformation. |
[in] | coordinateSystemA | Coordinate system A. |
[in] | coordinateSystemB | Coordinate system B. |
[in] | obj | Egomotion handle. |
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.
[out] | poseAtoB | Transform to be filled with transformation mapping a point at time a to a point at time b . |
[out] | quality | Structure to be filled with quality of transformation (optional, ignored if nullptr provided). |
[in] | timestamp_a | Timestamp corresponding to beginning of transformation. |
[in] | timestamp_b | Timestamp corresponding to end of transformation. |
[in] | obj | Egomotion handle. |
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.
The computation will take the yaw rate measurement from the IMU and combine it with currently estimated speed and wheel base. Speed used for estimation will be the reported by dwEgomotion_getEstimation.
[out] | steeringAngle | Steering angle to be set to estimation from imu yaw rate (can be null, in which case it will not be set). |
[out] | inverseSteeringR | Inverse radius to be set to arc driven by the vehicle. (can be null, in which case it will not be filled). |
[in] | imuMeasurement | IMU measurement with IMU measured in vehicle coordinate system. |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_estimate | ( | dwEgomotionResult * | pose, |
dwEgomotionUncertainty * | uncertainty, | ||
dwTime_t | timestamp_us, | ||
dwEgomotionConstHandle_t | obj | ||
) |
Estimates the state for a given timestamp.
This method does not modify internal state and can only be used to extrapolate motion into the future or interpolate motion between estimates the past.
[out] | pose | Structure to be filled with estimate state. |
[out] | uncertainty | Structure to be filled with uncertainties. Can be nullptr if not used. |
[in] | timestamp_us | Timestamp to estimate state for. |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_getEstimation | ( | dwEgomotionResult * | result, |
dwEgomotionConstHandle_t | obj | ||
) |
Gets the latest state estimate.
[out] | result | Structure to be filled with latest state estimate. |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_getEstimationTimestamp | ( | dwTime_t * | timestamp, |
dwEgomotionConstHandle_t | obj | ||
) |
Gets the timestamp of the latest state estimate.
The timestamp will be updated after each egomotion filter update.
[out] | timestamp | Timestamp to be set with latest available state estimate timestamp. |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_getGyroscopeBias | ( | dwVector3f * | gyroBias, |
dwEgomotionConstHandle_t | obj | ||
) |
Get estimated gyroscope bias.
[out] | gyroBias | Vector to be filled with gyroscope biases. |
[in] | obj | Egomotion handle. |
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.
[out] | pose | Structure to be filled with state estimate at the requested index in history (can be null, in which case it will not be filled). |
[out] | uncertainty | Structure to be filled with uncertainty at the requested index in history (can be null, in which case it will not be filled). |
[in] | index | Index into the history, in the range [0; dwEgomotion_getHistorySize ), with 0 being latest estimate and last element pointing to oldest estimate. |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_getHistorySize | ( | size_t * | size, |
dwEgomotionConstHandle_t | obj | ||
) |
Returns the number of elements currently stored in the history.
[out] | size | Integer to be set with the number of elements in the history. |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_getMotionModel | ( | dwMotionModel * | model, |
dwEgomotionConstHandle_t | obj | ||
) |
Returns the type of the motion model used.
[out] | model | dwMotionModel to be set with the motion model type used by instance specified by the handle. |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_getUncertainty | ( | dwEgomotionUncertainty * | result, |
dwEgomotionConstHandle_t | obj | ||
) |
Gets the latest state estimate uncertainties.
[out] | result | Structure to be filled with latest uncertainties. |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_hasEstimation | ( | bool * | result, |
dwEgomotionConstHandle_t | obj | ||
) |
Check whether estimation is available.
[out] | result | Boolean to be set with estimation availablity. |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_initialize | ( | dwEgomotionHandle_t * | obj, |
const dwEgomotionParameters * | params, | ||
dwContextHandle_t | ctx | ||
) |
Initializes the egomotion module.
Configuration of the module is provided by the params
argument. Default parameters can be obtained from the dwEgomotion_initParamsFromRig function.
[out] | obj | Handle to be set with pointer to created module. |
[in] | params | A pointer to the configuration parameters of the module. |
[in] | ctx | Specifies the handler to the context under which the Egomotion module is created. |
DW_API_PUBLIC dwStatus dwEgomotion_initParamsFromRig | ( | dwEgomotionParameters * | params, |
dwConstRigHandle_t | rigConfiguration, | ||
const char * | imuSensorName, | ||
const char * | vehicleSensorName | ||
) |
Initialize egomotion parameters from a provided RigConfiguration.
This will read out vehicle as well as all relevant sensor parameters and apply them on top of default egomotion parameters.
[out] | params | Structure to be filled out with vehicle and sensor parameters. |
[in] | rigConfiguration | Handle to a rig configuration to retrieve parameters from. |
[in] | imuSensorName | name of the IMU sensor to be used (optional, can be null). |
[in] | vehicleSensorName | name of the vehicle sensor to be used (optional, can be null). |
params
.dwEgomotionParameters.sensorParameters.velocityLatency
dwEgomotionParameters.sensorParameters.velocityFactor
IMU sensor:dwEgomotionParameters.gyroscopeBias
dwEgomotionParameters.imu2rig
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 their names.
[out] | params | Structure to be filled out with vehicle and sensor parameters. |
[in] | rigConfiguration | Handle to a rig configuration to retrieve parameters from |
[in] | imuSensorIdx | Index of the IMU sensor to be retrieved (optional, can be (uint32_t)-1) |
[in] | vehicleSensorIdx | Index of the vehicle sensor to be retrieved (optional, can be (uint32_t)-1) |
params
.DW_API_PUBLIC dwStatus dwEgomotion_release | ( | dwEgomotionHandle_t | obj | ) |
Releases the egomotion module.
[in] | obj | Egomotion handle to be released. |
DW_API_PUBLIC dwStatus dwEgomotion_reset | ( | dwEgomotionHandle_t | obj | ) |
Resets the state estimate and all history of the egomotion module.
All consecutive motion estimates will be relative to the (new) origin.
[in] | obj | Egomotion handle to be reset. |
DW_API_PUBLIC dwStatus dwEgomotion_steeringAngleToSteeringWheelAngle | ( | float32_t * | steeringWheelAngle, |
float32_t | steeringAngle, | ||
dwEgomotionHandle_t | obj | ||
) |
Convert steering angle to steering wheel angle.
[out] | steeringWheelAngle | Pointer to steering wheel angle to be set, in radians. |
[in] | steeringAngle | Steering angle, in radians. |
[in] | obj | Specifies the egomotion module handle. |
DW_API_PUBLIC dwStatus dwEgomotion_steeringWheelAngleToSteeringAngle | ( | float32_t * | steeringAngle, |
float32_t | steeringWheelAngle, | ||
dwEgomotionHandle_t | obj | ||
) |
Convert steering wheel angle to steering angle.
[out] | steeringAngle | Pointer to steering angle to be set, in radians. |
[in] | steeringWheelAngle | Steering wheel angle, in radians. |
[in] | obj | Specifies the egomotion module handle. |
DW_API_PUBLIC dwStatus dwEgomotion_update | ( | dwTime_t | timestamp_us, |
dwEgomotionHandle_t | obj | ||
) |
Runs the motion model estimation for a given timestamp.
The internal state is modified. The motion model advances to the given timestamp. To retrieve the result of the estimation, use dwEgomotion_getEstimation.
This method allows the user to update the egomotion filter when required, for a specific timestamp, using all sensor data available up to this timestamp.
When the automatic update period is active (automaticUpdate in dwEgomotionParameters is set), dwEgomotion_update will not update the filter state and throw a DW_NOT_SUPPORTED
exception instead.
[in] | timestamp_us | Timestamp for which to estimate vehicle state. |
[in] | obj | Egomotion handle. |
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 coordinate system.
[in] | imuToRig | Transformation from the IMU coordinate system to the vehicle rig coordinate system. |
[in] | obj | Egomotion handle. |
DW_API_PUBLIC dwStatus dwEgomotion_updateVehicle | ( | const dwVehicle * | vehicle, |
dwEgomotionHandle_t | obj | ||
) |
This method updates the egomotion module with an updated vehicle.
[in] | vehicle | Updated vehicle which may contain updated vehicle parameters. |
[in] | obj | Egomotion handle. |