31#ifndef DWFRAMEWORK_DWNODES_EGOMOTION_DWRELATIVEEGOMOTIONNODE_DWRELATIVEEGOMOTIONNODE_HPP_
32#define DWFRAMEWORK_DWNODES_EGOMOTION_DWRELATIVEEGOMOTIONNODE_DWRELATIVEEGOMOTIONNODE_HPP_
34#include <dw/core/logger/Logger.h>
35#include <dw/egomotion/base/Egomotion.h>
36#include <dw/egomotion/2.0/Egomotion2.h>
37#include <dw/egomotion/2.0/Egomotion2Extra.h>
38#include <dw/roadcast/base_types/RoadCastPacketTypes.hpp>
47#include <dw/egomotion/errorhandling/ErrorHandlingParameters.h>
48#include <dw/egomotion/errorhandling/Types.hpp>
49#include <dwframework/dwnodes/common/channelpackets/DwframeworkTypes.hpp>
50#include <dwframework/dwnodes/common/channelpackets/EgomotionState.hpp>
51#include <dwframework/dwnodes/common/channelpackets/IMU.hpp>
52#include <dwframework/dwnodes/common/channelpackets/SelfCalibrationTypes.hpp>
53#include <dwframework/dwnodes/common/channelpackets/SensorCommonTypes.hpp>
54#include <dwframework/dwnodes/common/channelpackets/VehicleIOValStructures.hpp>
77 dwEgomotionGroundSpeedMeasurementTypes
groundSpeedType{DW_EGOMOTION_GROUND_SPEED_COUNT};
169static_assert(DW_EGOMOTION_MAX_DISABLED_ERROR_IDS <= static_cast<size_t>(dw::egomotion::errorhandling::ErrorId::COUNT),
"Max disabled error ids must be less than or equal to error id count");
193 DW_DESCRIBE_PORT(dwVehicleIOASILStateE2EWrapper,
"VEHICLE_IO_ASIL_STATE"_sv),
214 describePass(StringView{
"SETUP"}, DW_PROCESSOR_TYPE_CPU),
215 describePass(StringView{
"ADD_IMU"}, DW_PROCESSOR_TYPE_CPU),
216 describePass(StringView{
"ADD_VEHICLE_STATE"}, DW_PROCESSOR_TYPE_CPU),
217 describePass(StringView{
"UPDATE_IMU_EXTRINSICS"}, DW_PROCESSOR_TYPE_CPU),
218 describePass(StringView{
"UPDATE_WHEEL_RADII"}, DW_PROCESSOR_TYPE_CPU),
219 describePass(StringView{
"PROCESS"}, DW_PROCESSOR_TYPE_CPU),
220 describePass(StringView{
"SEND_STATE"}, DW_PROCESSOR_TYPE_CPU),
221 describePass(StringView{
"TEARDOWN"}, DW_PROCESSOR_TYPE_CPU));
234 describeConstructorArgument<dwRelativeEgomotionNodeInitParams>(
244 dwEgomotionGroundSpeedMeasurementTypes,
245 "groundSpeedType"_sv,
249 "sigPresenceRearWheelAngle"_sv,
253 "sigPresenceRearWheelAngleQuality"_sv,
257 "sigPresenceRearWheelAngleTimestamp"_sv,
261 "sigPresenceRearWheelAngleTimestampQuality"_sv,
265 "sigPresenceSuspensionLevel"_sv, 4,
269 "sigPresenceSuspensionLevelQuality"_sv,
273 "sigPresenceSuspensionLevelTimestamp"_sv,
277 "sigPresenceSuspensionLevelTimestampQuality"_sv,
281 "sigPresenceSuspensionLevelCalibrationState"_sv,
285 "sigPresenceWheelSpeedRedundant"_sv,
289 "sigPresenceWheelSpeedQualityRedundant"_sv,
293 "sigPresenceWheelTicksRedundant"_sv,
297 "sigPresenceWheelTicksDirectionRedundant"_sv,
301 "sigPresenceWheelTicksTimestampRedundant"_sv,
305 "sigPresenceWheelTicksTimestampQualityRedundant"_sv,
309 "sigPresenceFrontSteeringAngleHigh"_sv,
313 "sigPresenceFrontSteeringAngleControlQualityHigh"_sv,
317 "sigPresenceFrontSteeringTimestampHigh"_sv,
321 "sigPresenceIMUTimestampQuality"_sv,
325 "sigPresenceIMUAccelerometerOffsetZ"_sv,
329 "sigPresenceBrakeTorqueWheelsQuality"_sv,
333 "sigPresenceIMUStatus"_sv,
337 "sigPresenceIMUSequenceCounter"_sv,
341 "sigPresenceIMUTurnrateOffsetQualityStatus"_sv,
345 "timeOffsetSteering"_sv,
349 "timeOffsetSuspension"_sv,
353 "timeOffsetAngularAcceleration"_sv,
357 "timeOffsetProperAcceleration"_sv,
361 "timeOffsetAngularVelocity"_sv,
365 "timeOffsetWheelTicks"_sv,
369 "timeOffsetWheelSpeeds"_sv,
373 "cycleTimeSteering"_sv,
377 "cycleTimeSuspension"_sv,
385 "cycleTimeWheelEncoder"_sv,
389 "suspensionCenterHeight"_sv, 2,
393 "wheelObserverFixedStepSize"_sv,
397 "wheelObserverEnableFixedStep"_sv,
401 "wheelObserverProcessCovariance"_sv, 3,
405 "wheelObserverPositionVarianceLow"_sv,
409 "wheelObserverPositionVarianceHigh"_sv,
413 "wheelObserverSpeedVarianceLow"_sv,
417 "wheelObserverSpeedVarianceHigh"_sv,
421 "wheelObserverPositionFuzzyLow"_sv,
425 "wheelObserverPositionFuzzyHigh"_sv,
429 "wheelObserverSpeedFuzzyLow"_sv,
433 "wheelObserverSpeedFuzzyHigh"_sv,
437 "wheelObserverSpeedMax"_sv,
441 "wheelObserverAccelerationMax"_sv,
445 "wheelObserverAccelerationMin"_sv,
449 "directionDetectorDurationNoWheelTick"_sv,
453 "vehicleMotionObserverFixedStepSize"_sv,
457 "vehicleMotionObserverEnableFixedStep"_sv,
461 "vehicleMotionObserverProcessCovariance"_sv, 5,
465 "vehicleMotionObserverInitialProcessCovariance"_sv, 5,
469 "vehicleMotionObserverGroundSpeedCovariance"_sv, 3,
473 "vehicleMotionObserverReferencePoint"_sv, 3,
481 "errorHandlingVIOWheelSpeedRange"_sv, 2,
485 "errorHandlingVIOFrontSteeringAngleRange"_sv, 2,
489 "errorHandlingVIORearWheelAngleRange"_sv, 2,
493 "errorHandlingVIOFrontSteeringAngleOffsetRange"_sv, 2,
497 "errorHandlingVIOWheelTorqueRange"_sv, 2,
501 "errorHandlingVIOSpeedMinRange"_sv, 2,
505 "errorHandlingVIOSpeedMaxRange"_sv, 2,
509 "errorHandlingVIOBrakeTorqueWheelsRange"_sv, 2,
513 "errorHandlingVIOSuspensionLevelRange"_sv, 2,
517 "errorHandlingIMUSequenceCounterRangeDeprecated"_sv, 2,
521 "errorHandlingIMUSequenceCounterRange"_sv, 2,
525 "errorHandlingIMUTurnrateRange"_sv, 2,
529 "errorHandlingIMUTurnrateOffsetRange"_sv, 2,
533 "errorHandlingIMUTurnrateOffsetQualityRange"_sv, 2,
537 "errorHandlingIMUTurnrateAccelRange"_sv, 2,
541 "errorHandlingIMUAccelerationRange"_sv, 2,
545 "errorHandlingIMUAccelerationOffsetRange"_sv, 2,
549 "errorHandlingIMUTemperatureRange"_sv, 2,
553 "errorHandlingInternalAccelerationOffsetRange"_sv, 2,
557 "errorHandlingInternalAccelerationOffsetDriftSpeed"_sv, 2,
561 "errorHandlingInternalAccelerationOffsetShortTermSpan"_sv, 2,
565 "errorHandlingInternalGyroscopeOffsetDriftSpeed"_sv, 2,
569 "errorHandlingInternalGyroscopeOffsetShortTermSpan"_sv, 2,
573 "errorHandlingLogLevel"_sv,
577 "errorHandlingCyclesBetweenLogs"_sv,
581 "strictVIOMapping"_sv,
589 "enableDegradations"_sv,
596 dw::core::FixedString<128>,
599 describeConstructorArgument<dwContextHandle_t>(
601 dwContextHandle_t)));
606 const dwContextHandle_t ctx);
#define DW_DESCRIBE_INDEX_PARAMETER_WITH_SEMANTIC(TYPE_NAME, SEMANTIC_TYPE_NAME, args...)
#define DW_DESCRIBE_ARRAY_PARAMETER(TYPE_NAME, PARAM_NAME, ARRAY_SIZE, args...)
#define DW_DESCRIBE_UNNAMED_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PORT(TYPE_NAME, NAME, args...)
The interface to access parameter values identified by name and/or (semantic) type.
This node computes the vehicle state and relative motion over time using signals from IMU and wheelsp...
static constexpr auto describeInputPorts()
static constexpr auto describeOutputPorts()
dwStatus preShutdown() override
static std::unique_ptr< dwRelativeEgomotionNode > create(ParameterProvider &provider)
static constexpr auto describeParameters()
dwStatus getEgomotionParameters(dwEgomotionParameters2 ¶ms)
dwRelativeEgomotionNode(const dwRelativeEgomotionNodeInitParams ¶ms, const dwContextHandle_t ctx)
static constexpr auto describePasses()
float32_t errorHandlingIMUTurnrateOffsetRange[2]
Bounds on valid IMU Turnrate Offset, in rad/s. Order: Low Bound, Upper Bound.
dwTime_t timeOffsetSteering
Time offset of steering angle measurements. This value is subtracted from signal timestamp.
dwTime_t timeOffsetWheelSpeeds
Time offset of wheel speed measurements. This value is subtracted from signal timestamp.
bool sigPresenceWheelTicksRedundant
Signals if the VIO interface signal wheelTicksRedundant expected to be provided by the partner VAL cl...
bool sigPresenceFrontSteeringAngleControlQualityHigh
Signals if the VIO interface signal frontSteeringAngleControlQualityHigh is expected to be provided b...
float32_t wheelObserverSpeedMax
Maximum wheel speed, in rad/s, to which the state will be constrained (treated as error if error hand...
bool strictVIOMapping
If true, signals are read only from the sources agreed upon in technical safety concept....
bool sigPresenceSuspensionLevelCalibrationState
Signals if the VIO interface signal suspensionLevelCalibrationState is expected to be provided by the...
float32_t errorHandlingVIOSuspensionLevelRange[2]
Bounds on valid VIO Suspension Level Measurements, in m. Order: Low Bound, Upper Bound.
float32_t errorHandlingIMUAccelerationOffsetRange[2]
Bounds on valid IMU Acceleration Offset, in m/s^2. Order: Low Bound, Upper Bound.
float32_t errorHandlingVIOFrontSteeringAngleRange[2]
Bounds on valid VIO Front Steering Angle Measurements, in rad. Order: Low Bound, Upper Bound.
float32_t errorHandlingIMUSequenceCounterRangeDeprecated[2]
Bounds on valid IMU Sequence Counter, unitless. Order: Low Bound, Upper Bound. (deprecated)
float32_t wheelObserverSpeedVarianceLow
Speed variance when speed below speedFuzzyLow. Indicates region of low trust in wheel speed,...
float32_t wheelObserverSpeedVarianceHigh
Speed variance when speed above speedFuzzyHigh. Indicates region of high trust in wheel speed,...
bool sigPresenceFrontSteeringTimestampHigh
Signals if the VIO interface signal frontSteeringTimestampHigh is expected to be provided by the part...
bool sigPresenceWheelSpeedRedundant
Signals if the VIO interface signal wheelSpeedRedundant expected to be provided by the partner VAL cl...
float32_t errorHandlingIMUTemperatureRange[2]
Bounds on valid IMU Temperature, in deg C. Order: Low Bound, Upper Bound.
static constexpr uint32_t DW_EGOMOTION_DISABLED_ERROR_IDS_ARRAY_SIZE
bool sigPresenceIMUSequenceCounter
Signals if the IMU sequence counter signal is provided.
dwTime_t directionDetectorDurationNoWheelTick
Threshold of no wheel ticks duration to determine whether the vehicle rolling direction is void or st...
float32_t errorHandlingVIORearWheelAngleRange[2]
Bounds on valid VIO Rear Wheel Angle Measurements, in rad. Order: Low Bound, Upper Bound.
bool sigPresenceRearWheelAngleTimestamp
Signals if the VIO interface signal rearWheelAngleTimestamp is expected to be provided by the partner...
uint32_t errorHandlingCyclesBetweenLogs
constexpr std::tuple describeConstructorArguments()
float32_t errorHandlingIMUTurnrateAccelRange[2]
Bounds on valid IMU Turnrate Acceleration, in rad/s^2. Order: Low Bound, Upper Bound.
float32_t errorHandlingInternalAccelerationOffsetRange[2]
Bounds on valid accelerometer offset for egomotion internal estimator, in m/s^2. Order: Low Bound,...
float32_t vehicleMotionObserverInitialProcessCovariance[5]
Initial process covariance parameters (continuous time, coefficients on diagonal)....
bool sigPresenceSuspensionLevel[4]
Signals if the VIO interface signal suspensionLevel is expected to be provided by the partner VAL cli...
bool sigPresenceWheelTicksDirectionRedundant
Signals if the VIO interface signal wheelTicksDirectionRedundant expected to be provided by the partn...
float32_t errorHandlingInternalGyroscopeOffsetRange[2]
Bounds on valid gyroscope offset for egomotion internal estimator, in rad/s. Order: Low Bound,...
float32_t errorHandlingVIOSpeedMaxRange[2]
Bounds on valid VIO Speed Max Measurements, in m/s. Order: Low Bound, Upper Bound.
dwTime_t cycleTimeIMU
Indicates the interval in microseconds between two IMU updates.
float32_t wheelObserverSpeedFuzzyLow
Region below which wheel speeds have low trust (variance adaptation), in rad/s.
float32_t errorHandlingVIOSpeedMinRange[2]
Bounds on valid VIO Speed Min Measurements, in m/s. Order: Low Bound, Upper Bound.
uint32_t drivenWheels
Indicates which traction configuration is used on this vehicle. 0=AWD, 1=FWD, 2=RWD.
float32_t errorHandlingVIOFrontSteeringAngleOffsetRange[2]
Bounds on valid VIO Front Steering Angle Offset Measurements, in rad. Order: Low Bound,...
dwTime_t cycleTimeWheelEncoder
Indicates the interval in microseconds between two wheel encoder updates (wheel speeds,...
uint32_t errorHandlingIMUSequenceCounterRange[2]
Bounds on valid IMU Sequence Counter, unitless. Order: Low Bound, Upper Bound.
uint32_t wheelObserverPositionFuzzyHigh
Region above which wheel position (tick) counters have high trust (variance adaptation),...
bool sigPresenceWheelTicksTimestampRedundant
Signals if the VIO interface signal wheelTicksTimestampRedundant expected to be provided by the partn...
bool sigPresenceBrakeTorqueWheelsQuality
Signals if the wheel brake torques quality signal is provided.
float32_t wheelObserverProcessCovariance[3]
Process covariance parameters (continuous time, coefficients on diagonal). Elements correspond to [po...
bool vehicleMotionObserverEnableFixedStep
When true, enables Vehicle Motion Observer fixed step mode.
float32_t vehicleMotionObserverReferencePoint[3]
Reference point used internally for computation, expressed in body coordinate frame....
bool sigPresenceSuspensionLevelTimestamp
Signals if the VIO interface signal suspensionLevelTimestamp is expected to be provided by the partne...
dwTime_t timeOffsetProperAcceleration
Time offset of linear acceleration measurements. This value is subtracted from signal timestamp.
float32_t wheelObserverSpeedFuzzyHigh
Region above which wheel speeds have high trust (variance adaptation), in rad/s.
bool sigPresenceIMUAccelerometerOffsetZ
Signals if the IMU Accelerometer offset for Z axis is provided.
bool sigPresenceRearWheelAngleQuality
Signals if the VIO interface signal rearWheelAngleQuality is expected to be provided by the partner V...
const char * imuSensorName
constexpr PassDescriptorT< 0 > describePass(dw::core::StringView &&name, dwProcessorType processorType)
dwTime_t cycleTimeSteering
Indicates the interval in microseconds between two steering angle updates.
dwConstRigHandle_t rigHandle
bool sigPresenceSuspensionLevelTimestampQuality
Signals if the VIO interface signal suspensionLevelTimestampQuality is expected to be provided by the...
uint32_t disabledErrorIdsBitfield[DW_EGOMOTION_DISABLED_ERROR_IDS_ARRAY_SIZE]
When a bit is set to true, the corresponding monitor is set as not applicable (disabled)....
dwTime_t timeOffsetWheelTicks
Time offset of wheel tick measurements. This value is subtracted from signal timestamp.
bool sigPresenceWheelTicksTimestampQualityRedundant
Signals if the VIO interface signal wheelTicksTimestampQualityRedundant expected to be provided by th...
dwTime_t wheelObserverFixedStepSize
Defines the step size when running the Wheel Observer in fixed step mode.
float32_t vehicleMotionObserverGroundSpeedCovariance[3]
Ground speed measurement covariance parameters (continuous time, coefficients on diagonal)....
uint32_t errorHandlingIMUTurnrateOffsetQualityRange[2]
Bounds on valid IMU Turnrate Offset Quality, unitless. Order: Low Bound, Upper Bound.
dwLoggerVerbosity errorHandlingLogLevel
float32_t errorHandlingInternalAccelerationOffsetShortTermSpan[2]
Bounds on valid accelerometer offset short term span for egomotion internal estimator,...
bool enableDegradations
Whether errors shall lead egomotion to degrade or invalidate its outputs.
dw::core::FixedString< 128 > disabledErrorIds[DW_EGOMOTION_MAX_DISABLED_ERROR_IDS]
constexpr auto describePassCollection(const Args &&... args) -> std::tuple< Args... >
constexpr auto describePortCollection(Args &&... args) -> dw::core::Tuple< Args... >
float32_t wheelObserverPositionVarianceLow
Position (tick) count variance when speed below positionFuzzyLow or above positionFuzzyHigh....
bool sigPresenceWheelSpeedQualityRedundant
Signals if the VIO interface signal wheelSpeedQualityRedundant expected to be provided by the partner...
dwTime_t timeOffsetSuspension
Time offset of suspension measurements. This value is subtracted from signal timestamp.
float32_t wheelObserverPositionVarianceHigh
Position (tick) count variance when speed between positionFuzzyLow and positionFuzzyHigh....
bool sigPresenceRearWheelAngle
Signals if the VIO interface signal rearWheelAngle is expected to be provided by the partner VAL clie...
float32_t errorHandlingInternalAccelerationOffsetDriftSpeed[2]
Bounds on valid accelerometer drift speed for egomotion internal estimator, in m/s^3....
float32_t errorHandlingIMUAccelerationRange[2]
Bounds on valid IMU Acceleration, in m/s^2. Order: Low Bound, Upper Bound.
float32_t wheelObserverAccelerationMax
Maximum wheel acceleration, in rad/s^2, to which the state will be constrained (treated as error if e...
dwTime_t timeOffsetAngularAcceleration
Time offset of angular acceleration measurements. This value is subtracted from signal timestamp.
dwTime_t cycleTimeSuspension
Indicates the interval in microseconds between two suspension level updates.
dwTime_t timeOffsetAngularVelocity
Time offset of angular velocity measurements. This value is subtracted from signal timestamp.
bool sigPresenceIMUTurnrateOffsetQualityStatus
Signals if the IMU sturnrate offset quality status signal is provided.
float32_t errorHandlingInternalGyroscopeOffsetShortTermSpan[2]
Bounds on valid gyroscope offset short term span for egomotion internal estimator,...
bool sigPresenceSuspensionLevelQuality
Signals if the VIO interface signal suspensionLevelQuality is expected to be provided by the partner ...
float32_t wheelObserverAccelerationMin
Minimum wheel acceleration, in rad/s^2, to which the state will be constrained (treated as error if e...
bool sigPresenceIMUStatus
Signals if the IMU Status signal is provided.
bool wheelObserverEnableFixedStep
When true, enables Wheel Observer fixed step mode.
bool sigPresenceFrontSteeringAngleHigh
Signals if the VIO interface signal frontSteeringAngleHigh is expected to be provided by the partner ...
float32_t errorHandlingVIOWheelTorqueRange[2]
Bounds on valid VIO Wheel Torque Measurements, in Nm. Order: Low Bound, Upper Bound.
dwTime_t vehicleMotionObserverFixedStepSize
Defines the step size when running the Vehicle Motion Observer in fixed step mode.
float32_t suspensionCenterHeight[2]
Indicates the suspension center height approximation used by egomotion, in meters,...
bool sigPresenceRearWheelAngleTimestampQuality
Signals if the VIO interface signal rearWheelAngleTimestampQuality is expected to be provided by the ...
float32_t errorHandlingIMUTurnrateRange[2]
Bounds on valid IMU Turnrate, in rad/s. Order: Low Bound, Upper Bound.
uint32_t wheelObserverPositionFuzzyLow
Region below which wheel position (tick) counters have low trust (variance adaptation),...
float32_t vehicleMotionObserverProcessCovariance[5]
Process covariance parameters (continuous time, coefficients on diagonal). Elements correspond (appro...
static constexpr uint32_t DW_EGOMOTION_MAX_DISABLED_ERROR_IDS
float32_t errorHandlingInternalGyroscopeOffsetDriftSpeed[2]
Bounds on valid gyroscope drift speed for egomotion internal estimator, in rad/s^2....
dwEgomotionGroundSpeedMeasurementTypes groundSpeedType
Ground Speed Type (debug setting for AugResim only).
bool sigPresenceIMUTimestampQuality
Signals if the IMU Timestamp Quality signal is provided.
float32_t errorHandlingVIOBrakeTorqueWheelsRange[2]
Bounds on valid VIO Brake Torque Wheels Measurements, in Nm. Order: Low Bound, Upper Bound.
float32_t errorHandlingVIOWheelSpeedRange[2]
Bounds on valid VIO Wheel Speed Measurements, in rad/s. Order: Low Bound, Upper Bound.