To initialize motion model certain parameters, such as imu calibration or vehicle data, must be passed to the module. These parameters can be extracted from a dwRig
module, see Rig Configuration Hence a typical initialization code sequence will look like this:
uint32_t imuIdx = 0;
params.vehicle = *vehicle;
params.automaticUpdate = true;
params.sensorParameters.imuSamplingRate = 100.f;
params.autoupdate = true;
dwMotionModel motionModel
Specifies the motion model to be used for pose estimation.
DW_API_PUBLIC dwStatus dwEgomotion_initialize(dwEgomotionHandle_t *obj, const dwEgomotionParameters *params, dwContextHandle_t ctx)
Initializes the egomotion module.
@ DW_EGOMOTION_IMU_ODOMETRY
Fuses odometry model with IMU measurements to estimate motion of the vehicle.
Holds initialization parameters for the Egomotion module.
DW_API_PUBLIC dwStatus dwRig_getSensorToRigTransformation(dwTransformation3f *const transformation, uint32_t const sensorId, dwConstRigHandle_t const obj)
Gets the sensor to rig transformation for a sensor.
DW_API_PUBLIC dwStatus dwRig_findSensorByName(uint32_t *const sensorId, char8_t const *const sensorName, dwConstRigHandle_t const obj)
Finds the sensor with the given name and returns its index.
DW_API_PUBLIC dwStatus dwRig_getVehicle(dwVehicle const **const vehicle, dwConstRigHandle_t const obj)
DEPRECATED: Gets the properties of a passenger car vehicle.
DW_API_PUBLIC dwStatus dwRig_initializeFromFile(dwRigHandle_t *const obj, dwContextHandle_t const ctx, char8_t const *const configurationFile)
Initializes the Rig Configuration module from a file.
DEPRECATED: Properties of a passenger car vehicle.
At runtime the estimator has to be filled with input measurements. The following shows the sequence in a typical application using the Egomotion module:
{
switch (sensorEvent->
type)
{
break;
break;
...
...
}
DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleActuationFeedback(dwVehicleIOActuationFeedback *const actuationFeedback, dwVehicleIOHandle_t const obj)
Retrieve current vehicle actuation feedback.
DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleNonSafetyState(dwVehicleIONonSafetyState *const nonSafeState, dwVehicleIOHandle_t const obj)
Retrieve current vehicle non-safety state.
DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleSafetyState(dwVehicleIOSafetyState *const safeState, dwVehicleIOHandle_t const obj)
Retrieve current vehicle safety state.
DW_API_PUBLIC dwStatus dwVehicleIO_consumeCANFrame(dwCANMessage const *const msg, uint32_t const sensorId, dwVehicleIOHandle_t const obj)
Parse a received event.
Non-safety critical RoV state.
Safety critical VIO state.
DW_API_PUBLIC dwStatus dwEgomotion_getEstimation(dwEgomotionResult *result, dwEgomotionConstHandle_t obj)
Gets the latest state estimate.
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_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.
DW_API_PUBLIC dwStatus dwEgomotion_addIMUMeasurement(const dwIMUFrame *imu, dwEgomotionHandle_t obj)
Adds an IMU frame to the egomotion module.
Holds egomotion state estimate.
dwSensorType type
Type of sensor providing data for this event.
DW_API_PUBLIC dwStatus dwSensorManager_acquireNextEvent(const dwSensorEvent **ev, dwTime_t timeoutMicroSeconds, dwSensorManagerHandle_t sm)
Called by the application to consume the next available sensor event ready for consumption.
Structure for returning data upon any sensor event.