Skip to content

197. Speed Limit Violation

The speed_limit_violation_checker verifies whether the Ego complies with the applicable speed limits during the simulation. It continuously compares the vehicle's current speed with the active road speed limit and detects any violations based on both the speed limit and the violation_factor_threshold.

197.0.1 Start condition

The interval begins when:

  • The Ego's speed exceeds the violation_speed_threshold and persists for the duration specified by debounce_start_time.
  • The corresponding speed_limit_watcher interval is active.

The violation_speed_threshold is evaluated as: violation_speed_threshold = speed_limit × violation_factor_threshold, where speed_limit is the current applicable speed limit and violation_factor_threshold is a configurable float parameter.

197.0.2 End condition

The interval ends when:

  • The Ego's speed falls below the threshold: violation_speed_thresholdviolation_speed_threshold_tolerance, where violation_speed_threshold is the speed level that triggered the interval and violation_speed_threshold_tolerance is a configurable parameter defining how far below this threshold the Ego must drop to return to compliance.
  • The associated speed_limit_watcher interval ends.

197.1 Plot

The figure below illustrates the speed limit violation. One violation is detected. The blue area indicates where the speed limit violation occurred.

Speed limit violation

197.2 Attributes

The following attributes define the behavior and characteristics of the evaluator.

Checker attribute Description
Parent object vehicle.speed_limit
Issue category sut or other
Issue kind speed_limit_violation
Default severity warning
Trigger condition Based on while_w watcher

197.3 Configuration parameters

The following parameters can be configured to customize the evaluator's behavior.

Parameter Type Unit Description Default Value Range
violation_factor_threshold float Factor multiplied by the speed limit to determine the violation threshold 1.1 [0, 10]
violation_speed_threshold_tolerance speed kph Tolerance added to the violation speed threshold to end the interval 2kph [0, 60]kph
debounce_start_time time s Time to debounce the start of the interval 0.0s [0, 30]s
issue_severity enum (ignore, info, warning, error_continue, error, error_stop_now) Issue severity for speed limit violation checker warning
enabled bool Whether the checker is enabled true
log_level enum (info_level, debug_level, trace_level) Log level for the checker info_level

197.4 Metrics

The following metrics are recorded and tracked by the evaluator.

Metric Type Description Range Unit
speed_limit_violation speed The speed threshold at which the interval starts kph
max_speed speed The maximum speed of the Ego during the speed limit violation event interval kph
avg_speed speed The average speed of the Ego during the speed limit violation event interval kph
max_speed_exceedance speed The maximum speed exceedance of the Ego during the speed limit violation event interval kph
max_lon_acceleration acceleration The maximum longitudinal acceleration of the Ego during the speed limit violation event interval mpsps
duration time Duration of speed limit violation interval s

197.5 Log and Error Messages

Output Condition Description Default Severity Action
After the interval ends, a warning is issued Speed limit violation: Vehicle exceeded limit speed_limit_violation_checker.data.speed_limit_violation with max speed max_speed_statistics.compute() Warning Investigate the SUT's behaviour.

197.6 Usage

197.6.1 How to instantiate

The speed_limit_violation_checker is built into the Ego only, as part of the sut_vehicle.speed_limit modifier. The modifier includes two components: speed_limit_watcher and speed_limit_violation_checker.

extend sut_vehicle.speed_limit:
    checker speed_limit_violation_checker(speed_limit_violation_data) is while_w(is_speed_limit_violation) with:
        it.sut_issue(...)

The checker is active only when all of the following conditions are met:

  • ego_speed_limit_violation_checker_config.enabled and ego_speed_limit_watcher_config.enabled are both set to true
  • speed_limit_watcher has an active interval
  • The Ego speed exceeds speed_limit × violation_factor_threshold for at least debounce_start_time

197.6.2 Set parameters at instantiation time

Use ftlx_global_eval_config.ego_speed_limit_violation_checker_config defaults unless overridden below.

197.6.3 Define and use a custom parameter set

To customize the checker for all scenarios, configure speed_limit_violation_checker_config. Default values are defined in ftlx_global_eval_config. Create a config instance:

const custom_speed_limit_violation_config: speed_limit_violation_checker_config = new
set custom_speed_limit_violation_config.violation_factor_threshold = 1.15
set custom_speed_limit_violation_config.violation_speed_threshold_tolerance = 3kph
set custom_speed_limit_violation_config.debounce_start_time = 0.5s
set custom_speed_limit_violation_config.issue_severity = error
set custom_speed_limit_violation_config.enabled = true
Apply it globally by extending ftlx_global_eval_config:
extend ftlx_global_eval_config:
    set ego_speed_limit_violation_checker_config.violation_factor_threshold = \
        custom_speed_limit_violation_config.violation_factor_threshold
    set ego_speed_limit_violation_checker_config.violation_speed_threshold_tolerance = \
        custom_speed_limit_violation_config.violation_speed_threshold_tolerance
    set ego_speed_limit_violation_checker_config.debounce_start_time = \
        custom_speed_limit_violation_config.debounce_start_time
    set ego_speed_limit_violation_checker_config.issue_severity = \
        custom_speed_limit_violation_config.issue_severity

Customize per scenario To override fields for a specific scenario, extend the modifier directly. The fields are bound to the config by default:

extend sut_vehicle.speed_limit:
    keep(debounce_start_time == 1.0s)
    keep(violation_speed_threshold_tolerance == 3kph)

197.6.4 Disabling the checker

To disable the checker globally, set enabled to false in the config:

extend ftlx_global_eval_config:
    set ego_speed_limit_violation_checker_config.enabled = false
To disable the checker at runtime on the Ego:
extend sut_vehicle.speed_limit:
    on @start:
        override(speed_limit_violation_checker, run_mode: freeze)

197.7 Additional information

All parameters are required, but you don't need to customize all of them. For any parameter you don't customize with set, the default value defined in speed_limit_violation_checker_config is used. Disabling the violation checker also requires an active speed_limit_watcher; freeze that watcher if speed-limit tracking is not needed.