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>
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");
194 DW_DESCRIBE_PORT(dwVehicleIONonSafetyState,
"VEHICLE_IO_NON_SAFETY_STATE"_sv),
195 DW_DESCRIBE_PORT(dwVehicleIOActuationFeedback,
"VEHICLE_IO_ACTUATION_FEEDBACK"_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));
236 return DW_NOT_SUPPORTED;
245 describeConstructorArgument<dwRelativeEgomotionNodeInitParams>(
254 uint32_t,
"historySize"_sv,
258 "groundSpeedType"_sv,
262 "sigPresenceRearWheelAngle"_sv,
266 "sigPresenceRearWheelAngleQuality"_sv,
270 "sigPresenceRearWheelAngleTimestamp"_sv,
274 "sigPresenceRearWheelAngleTimestampQuality"_sv,
278 "sigPresenceSuspensionLevel"_sv, 4,
282 "sigPresenceSuspensionLevelQuality"_sv,
286 "sigPresenceSuspensionLevelTimestamp"_sv,
290 "sigPresenceSuspensionLevelTimestampQuality"_sv,
294 "sigPresenceSuspensionLevelCalibrationState"_sv,
298 "sigPresenceWheelSpeedRedundant"_sv,
302 "sigPresenceWheelSpeedQualityRedundant"_sv,
306 "sigPresenceWheelTicksRedundant"_sv,
310 "sigPresenceWheelTicksDirectionRedundant"_sv,
314 "sigPresenceWheelTicksTimestampRedundant"_sv,
318 "sigPresenceWheelTicksTimestampQualityRedundant"_sv,
322 "sigPresenceFrontSteeringAngleHigh"_sv,
326 "sigPresenceFrontSteeringAngleControlQualityHigh"_sv,
330 "sigPresenceFrontSteeringTimestampHigh"_sv,
334 "sigPresenceIMUTimestampQuality"_sv,
338 "sigPresenceIMUAccelerometerOffsetZ"_sv,
342 "sigPresenceBrakeTorqueWheelsQuality"_sv,
346 "sigPresenceIMUStatus"_sv,
350 "sigPresenceIMUSequenceCounter"_sv,
354 "sigPresenceIMUTurnrateOffsetQualityStatus"_sv,
358 "timeOffsetSteering"_sv,
362 "timeOffsetSuspension"_sv,
366 "timeOffsetAngularAcceleration"_sv,
370 "timeOffsetProperAcceleration"_sv,
374 "timeOffsetAngularVelocity"_sv,
378 "timeOffsetWheelTicks"_sv,
382 "timeOffsetWheelSpeeds"_sv,
386 "cycleTimeSteering"_sv,
390 "cycleTimeSuspension"_sv,
398 "cycleTimeWheelEncoder"_sv,
402 "suspensionCenterHeight"_sv, 2,
406 "wheelObserverFixedStepSize"_sv,
410 "wheelObserverEnableFixedStep"_sv,
414 "wheelObserverProcessCovariance"_sv, 3,
418 "wheelObserverPositionVarianceLow"_sv,
422 "wheelObserverPositionVarianceHigh"_sv,
426 "wheelObserverSpeedVarianceLow"_sv,
430 "wheelObserverSpeedVarianceHigh"_sv,
434 "wheelObserverPositionFuzzyLow"_sv,
438 "wheelObserverPositionFuzzyHigh"_sv,
442 "wheelObserverSpeedFuzzyLow"_sv,
446 "wheelObserverSpeedFuzzyHigh"_sv,
450 "wheelObserverSpeedMax"_sv,
454 "wheelObserverAccelerationMax"_sv,
458 "wheelObserverAccelerationMin"_sv,
462 "directionDetectorDurationNoWheelTick"_sv,
466 "vehicleMotionObserverFixedStepSize"_sv,
470 "vehicleMotionObserverEnableFixedStep"_sv,
474 "vehicleMotionObserverProcessCovariance"_sv, 5,
478 "vehicleMotionObserverInitialProcessCovariance"_sv, 5,
482 "vehicleMotionObserverGroundSpeedCovariance"_sv, 3,
486 "vehicleMotionObserverReferencePoint"_sv, 3,
494 "errorHandlingVIOWheelSpeedRange"_sv, 2,
498 "errorHandlingVIOFrontSteeringAngleRange"_sv, 2,
502 "errorHandlingVIORearWheelAngleRange"_sv, 2,
506 "errorHandlingVIOFrontSteeringAngleOffsetRange"_sv, 2,
510 "errorHandlingVIOWheelTorqueRange"_sv, 2,
514 "errorHandlingVIOSpeedMinRange"_sv, 2,
518 "errorHandlingVIOSpeedMaxRange"_sv, 2,
522 "errorHandlingVIOBrakeTorqueWheelsRange"_sv, 2,
526 "errorHandlingVIOSuspensionLevelRange"_sv, 2,
530 "errorHandlingIMUSequenceCounterRangeDeprecated"_sv, 2,
534 "errorHandlingIMUSequenceCounterRange"_sv, 2,
538 "errorHandlingIMUTurnrateRange"_sv, 2,
542 "errorHandlingIMUTurnrateOffsetRange"_sv, 2,
546 "errorHandlingIMUTurnrateOffsetQualityRange"_sv, 2,
550 "errorHandlingIMUTurnrateAccelRange"_sv, 2,
554 "errorHandlingIMUAccelerationRange"_sv, 2,
558 "errorHandlingIMUAccelerationOffsetRange"_sv, 2,
562 "errorHandlingIMUTemperatureRange"_sv, 2,
566 "errorHandlingInternalAccelerationOffsetRange"_sv, 2,
570 "errorHandlingInternalAccelerationOffsetDriftSpeed"_sv, 2,
574 "errorHandlingInternalAccelerationOffsetShortTermSpan"_sv, 2,
578 "errorHandlingInternalGyroscopeOffsetDriftSpeed"_sv, 2,
582 "errorHandlingInternalGyroscopeOffsetShortTermSpan"_sv, 2,
586 "errorHandlingLogLevel"_sv,
590 "errorHandlingCyclesBetweenLogs"_sv,
594 "strictVIOMapping"_sv,
602 "enableDegradations"_sv,
609 dw::core::FixedString<128>,
612 describeConstructorArgument<dwContextHandle_t>(
614 dwContextHandle_t)));
619 const dwContextHandle_t ctx);
#define DW_DESCRIBE_ARRAY_PARAMETER(TYPE_NAME, PARAM_NAME, ARRAY_SIZE, args...)
#define DW_DESCRIBE_UNNAMED_PARAMETER_WITH_SEMANTIC(TYPE_NAME, SEMANTIC_TYPE_NAME, args...)
#define DW_DESCRIBE_UNNAMED_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PORT(TYPE_NAME, NAME, args...)
std::unique_ptr< Node > m_impl
virtual dwStatus preShutdown()=0
actions to be taken before node shutdown
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, in rad/s. Order: Low Bound, Upper Bound.
dwTime_t timeOffsetSteering
Signals if the IMU sturnrate offset quality status signal is provided.
dwTime_t timeOffsetWheelSpeeds
Time offset of wheel tick measurements. This value is subtracted from signal timestamp.
bool sigPresenceWheelTicksRedundant
Signals if the VIO interface signal wheelSpeedQualityRedundant expected to be provided by the partner...
bool sigPresenceFrontSteeringAngleControlQualityHigh
Signals if the VIO interface signal frontSteeringAngleHigh is expected to be provided by the partner ...
float32_t wheelObserverSpeedMax
Region above which wheel speeds have high trust (variance adaptation), in rad/s.
bool sigPresenceSuspensionLevelCalibrationState
Signals if the VIO interface signal suspensionLevelTimestampQuality is expected to be provided by the...
float32_t errorHandlingVIOSuspensionLevelRange[2]
Bounds on valid VIO Brake Torque Wheels Measurements, in Nm. Order: Low Bound, Upper Bound.
float32_t errorHandlingIMUAccelerationOffsetRange[2]
Bounds on valid IMU Acceleration, in m/s^2. Order: Low Bound, Upper Bound.
float32_t errorHandlingVIOFrontSteeringAngleRange[2]
Bounds on valid VIO Wheel Speed Measurements, in rad/s. Order: Low Bound, Upper Bound.
float32_t errorHandlingIMUSequenceCounterRangeDeprecated[2]
Bounds on valid VIO Suspension Level Measurements, in m. Order: Low Bound, Upper Bound.
float32_t wheelObserverSpeedVarianceLow
Position (tick) count variance when speed between positionFuzzyLow and positionFuzzyHigh....
float32_t wheelObserverSpeedVarianceHigh
Speed variance when speed below speedFuzzyLow. Indicates region of low trust in wheel speed,...
bool sigPresenceFrontSteeringTimestampHigh
Signals if the VIO interface signal frontSteeringAngleControlQualityHigh is expected to be provided b...
bool sigPresenceWheelSpeedRedundant
Signals if the VIO interface signal suspensionLevelCalibrationState is expected to be provided by the...
float32_t errorHandlingIMUTemperatureRange[2]
Bounds on valid IMU Acceleration Offset, in m/s^2. Order: Low Bound, Upper Bound.
static constexpr uint32_t DW_EGOMOTION_DISABLED_ERROR_IDS_ARRAY_SIZE
bool sigPresenceIMUSequenceCounter
Signals if the IMU Status signal is provided.
dwTime_t directionDetectorDurationNoWheelTick
Minimum wheel acceleration, in rad/s^2, to which the state will be constrained (treated as error if e...
float32_t errorHandlingVIORearWheelAngleRange[2]
Bounds on valid VIO Front Steering Angle Measurements, in rad. Order: Low Bound, Upper Bound.
bool sigPresenceRearWheelAngleTimestamp
Signals if the VIO interface signal rearWheelAngleQuality is expected to be provided by the partner V...
uint32_t errorHandlingCyclesBetweenLogs
constexpr std::tuple describeConstructorArguments()
float32_t errorHandlingIMUTurnrateAccelRange[2]
Bounds on valid IMU Turnrate Offset Quality, unitless. Order: Low Bound, Upper Bound.
float32_t errorHandlingInternalAccelerationOffsetRange[2]
Bounds on valid IMU Temperature, in deg C. Order: Low Bound, Upper Bound.
float32_t vehicleMotionObserverInitialProcessCovariance[5]
Process covariance parameters (continuous time, coefficients on diagonal). Elements correspond (appro...
bool sigPresenceSuspensionLevel[4]
Signals if the VIO interface signal rearWheelAngleTimestampQuality is expected to be provided by the ...
bool sigPresenceWheelTicksDirectionRedundant
Signals if the VIO interface signal wheelTicksRedundant expected to be provided by the partner VAL cl...
float32_t errorHandlingInternalGyroscopeOffsetRange[2]
Bounds on valid accelerometer offset short term span for egomotion internal estimator,...
float32_t errorHandlingVIOSpeedMaxRange[2]
Bounds on valid VIO Speed Min Measurements, in m/s. Order: Low Bound, Upper Bound.
dwTime_t cycleTimeIMU
Indicates the interval in microseconds between two suspension level updates.
float32_t wheelObserverSpeedFuzzyLow
Region above which wheel position (tick) counters have high trust (variance adaptation),...
float32_t errorHandlingVIOSpeedMinRange[2]
Bounds on valid VIO Wheel Torque Measurements, in Nm. Order: Low Bound, Upper Bound.
uint32_t drivenWheels
Reference point used internally for computation, expressed in body coordinate frame....
bool notifySEH
If true, signals are read only from the sources agreed upon in technical safety concept....
float32_t errorHandlingVIOFrontSteeringAngleOffsetRange[2]
Bounds on valid VIO Rear Wheel Angle Measurements, in rad. Order: Low Bound, Upper Bound.
dwTime_t cycleTimeWheelEncoder
Indicates the interval in microseconds between two IMU updates.
uint32_t errorHandlingIMUSequenceCounterRange[2]
Bounds on valid IMU Sequence Counter, unitless. Order: Low Bound, Upper Bound. (deprecated)
uint32_t wheelObserverPositionFuzzyHigh
Region below which wheel position (tick) counters have low trust (variance adaptation),...
bool sigPresenceWheelTicksTimestampRedundant
Signals if the VIO interface signal wheelTicksDirectionRedundant expected to be provided by the partn...
bool sigPresenceBrakeTorqueWheelsQuality
Signals if the IMU Accelerometer offset for Z axis is provided.
float32_t wheelObserverProcessCovariance[3]
When true, enables Wheel Observer fixed step mode.
bool vehicleMotionObserverEnableFixedStep
Defines the step size when running the Vehicle Motion Observer in fixed step mode.
float32_t vehicleMotionObserverReferencePoint[3]
Ground speed measurement covariance parameters (continuous time, coefficients on diagonal)....
bool sigPresenceSuspensionLevelTimestamp
Signals if the VIO interface signal suspensionLevelQuality is expected to be provided by the partner ...
dwTime_t timeOffsetProperAcceleration
Time offset of angular acceleration measurements. This value is subtracted from signal timestamp.
float32_t wheelObserverSpeedFuzzyHigh
Region below which wheel speeds have low trust (variance adaptation), in rad/s.
bool sigPresenceIMUAccelerometerOffsetZ
Signals if the IMU Timestamp Quality signal is provided.
bool sigPresenceRearWheelAngleQuality
Signals if the VIO interface signal rearWheelAngle is expected to be provided by the partner VAL clie...
const char * imuSensorName
constexpr PassDescriptorT< 0 > describePass(dw::core::StringView &&name, dwProcessorType processorType)
dwTime_t cycleTimeSteering
Time offset of wheel speed measurements. This value is subtracted from signal timestamp.
dwConstRigHandle_t rigHandle
bool sigPresenceSuspensionLevelTimestampQuality
Signals if the VIO interface signal suspensionLevelTimestamp is expected to be provided by the partne...
uint32_t disabledErrorIdsBitfield[DW_EGOMOTION_DISABLED_ERROR_IDS_ARRAY_SIZE]
Whether errors shall lead egomotion to degrade or invalidate its outputs.
dwTime_t timeOffsetWheelTicks
Time offset of angular velocity measurements. This value is subtracted from signal timestamp.
bool sigPresenceWheelTicksTimestampQualityRedundant
Signals if the VIO interface signal wheelTicksTimestampRedundant expected to be provided by the partn...
dwTime_t wheelObserverFixedStepSize
Indicates the suspension center height approximation used by egomotion, in meters,...
uint32_t groundSpeedType
Egomotion state history size, default 1000 if left 0.
float32_t vehicleMotionObserverGroundSpeedCovariance[3]
Initial process covariance parameters (continuous time, coefficients on diagonal)....
uint32_t errorHandlingIMUTurnrateOffsetQualityRange[2]
Bounds on valid IMU Turnrate Offset, in rad/s. Order: Low Bound, Upper Bound.
dwLoggerVerbosity errorHandlingLogLevel
Bounds on valid gyroscope offset short term span for egomotion internal estimator,...
float32_t errorHandlingInternalAccelerationOffsetShortTermSpan[2]
Bounds on valid accelerometer drift speed for egomotion internal estimator, in m/s^3....
dw::core::FixedString< 128 > disabledErrorIds[DW_EGOMOTION_MAX_DISABLED_ERROR_IDS]
When a bit is set to true, the corresponding monitor is set as not applicable (disabled)....
constexpr auto describePassCollection(const Args &&... args) -> std::tuple< Args... >
constexpr auto describePortCollection(Args &&... args) -> dw::core::Tuple< Args... >
float32_t wheelObserverPositionVarianceLow
Process covariance parameters (continuous time, coefficients on diagonal). Elements correspond to [po...
bool sigPresenceWheelSpeedQualityRedundant
Signals if the VIO interface signal wheelSpeedRedundant expected to be provided by the partner VAL cl...
dwTime_t timeOffsetSuspension
Time offset of steering angle measurements. This value is subtracted from signal timestamp.
float32_t wheelObserverPositionVarianceHigh
Position (tick) count variance when speed below positionFuzzyLow or above positionFuzzyHigh....
bool sigPresenceRearWheelAngle
Ground Speed Type (debug setting for AugResim only).
float32_t errorHandlingInternalAccelerationOffsetDriftSpeed[2]
Bounds on valid accelerometer offset for egomotion internal estimator, in m/s^2. Order: Low Bound,...
float32_t errorHandlingIMUAccelerationRange[2]
Bounds on valid IMU Turnrate Acceleration, in rad/s^2. Order: Low Bound, Upper Bound.
float32_t wheelObserverAccelerationMax
Maximum wheel speed, in rad/s, to which the state will be constrained (treated as error if error hand...
dwTime_t timeOffsetAngularAcceleration
Time offset of suspension measurements. This value is subtracted from signal timestamp.
dwTime_t cycleTimeSuspension
Indicates the interval in microseconds between two steering angle updates.
dwTime_t timeOffsetAngularVelocity
Time offset of linear acceleration measurements. This value is subtracted from signal timestamp.
bool sigPresenceIMUTurnrateOffsetQualityStatus
Signals if the IMU sequence counter signal is provided.
float32_t errorHandlingInternalGyroscopeOffsetShortTermSpan[2]
Bounds on valid gyroscope drift speed for egomotion internal estimator, in rad/s^2....
bool sigPresenceSuspensionLevelQuality
Signals if the VIO interface signal suspensionLevel is expected to be provided by the partner VAL cli...
float32_t wheelObserverAccelerationMin
Maximum wheel acceleration, in rad/s^2, to which the state will be constrained (treated as error if e...
bool sigPresenceIMUStatus
Signals if the wheel brake torques quality signal is provided.
bool wheelObserverEnableFixedStep
Defines the step size when running the Wheel Observer in fixed step mode.
bool sigPresenceFrontSteeringAngleHigh
Signals if the VIO interface signal wheelTicksTimestampQualityRedundant expected to be provided by th...
float32_t errorHandlingVIOWheelTorqueRange[2]
Bounds on valid VIO Front Steering Angle Offset Measurements, in rad. Order: Low Bound,...
dwTime_t vehicleMotionObserverFixedStepSize
Threshold of no wheel ticks duration to determine whether the vehicle rolling direction is void or st...
float32_t suspensionCenterHeight[2]
Indicates the interval in microseconds between two wheel encoder updates (wheel speeds,...
bool sigPresenceRearWheelAngleTimestampQuality
Signals if the VIO interface signal rearWheelAngleTimestamp is expected to be provided by the partner...
float32_t errorHandlingIMUTurnrateRange[2]
Bounds on valid IMU Sequence Counter, unitless. Order: Low Bound, Upper Bound.
uint32_t wheelObserverPositionFuzzyLow
Speed variance when speed above speedFuzzyHigh. Indicates region of high trust in wheel speed,...
float32_t vehicleMotionObserverProcessCovariance[5]
When true, enables Vehicle Motion Observer fixed step mode.
static constexpr uint32_t DW_EGOMOTION_MAX_DISABLED_ERROR_IDS
float32_t errorHandlingInternalGyroscopeOffsetDriftSpeed[2]
Bounds on valid gyroscope offset for egomotion internal estimator, in rad/s. Order: Low Bound,...
bool sigPresenceIMUTimestampQuality
Signals if the VIO interface signal frontSteeringTimestampHigh is expected to be provided by the part...
float32_t errorHandlingVIOBrakeTorqueWheelsRange[2]
Bounds on valid VIO Speed Max Measurements, in m/s. Order: Low Bound, Upper Bound.
float32_t errorHandlingVIOWheelSpeedRange[2]
Indicates which traction configuration is used on this vehicle. 0=AWD, 1=FWD, 2=RWD.