Skip to content

200. Teleportation

The Teleportation checker monitors an object's traveled distance to detect physically impossible movements. It triggers when the reported distance traveled in a sampling period is unrealistically large relative to the object's recorded speed, using an Exponential Moving Average (EMA) of past distances as a dynamic baseline.

200.0.1 Start condition

The checker samples the object's position at a constant rate of once per sample_clk_rate seconds and measures the distance to the position previously sampled. When no interval is currently open, it sets a distance threshold based on the EMA:

\[ \text{Threshold} = \text{EMA distance} \times \text{distance\_factor\_threshold} + \text{distance\_threshold\_tolerance} \]

An interval starts when the distance traveled during one sampling period exceeds this threshold. If the distance does not exceed the threshold, it is added to the EMA as a valid sample:

\[ \text{EMA}_{\text{new}} = \alpha \cdot \text{Current Sample} + (1 - \alpha) \cdot \text{EMA}_{\text{old}} \]

When an interval is triggered, the checker pauses EMA updates to keep the pre-event baseline fixed. This prevents anomalous values from distorting the baseline or increasing the trigger thresholds during the event.

Warning

The Teleportation checker needs a short initialization period to compare the object's current position to its previous one. This period is defined by sample_clk_rate and is set to 0.1 seconds by default. As a result, any teleportation that occurs before sample_clk_rate seconds from the start of the run is not detected. This parameter is used to establish a consistent sampling rate, avoiding false positives while maintaining a high performance in detecting real cases.

Note

Since the sample_clk_rate determines the time between two position samples, it directly affects the EMA calculations and, by definition, the distance threshold. Shorter values lead to shorter thresholds, meaning the checker might be more prone to false positives when the object is moving at a high speed (since it travels a longer distance over time). Higher values lead to higher thresholds, meaning the checker might be more prone to false negatives. The default value of 0.1 seconds proved effective in avoiding both issues.

200.0.1.1 Exponential Moving Average (EMA)

The Exponential Moving Average (EMA) is a statistical time-series filter used to analyze data over time, like a vehicle's motion data. Unlike a simple moving average, which assigns equal weights to all past observations, the EMA applies a weighting factor (alpha), causing the influence of older data points to decrease exponentially. As a result, the derived average is more responsive to recent changes while still smoothing out high-frequency noise and momentary simulation fluctuations. The Teleportation checker uses the EMA to establish a dynamic baseline of the expected behavior of the monitored object. The EMA continuously calculates the rolling average of the distance traveled, providing a real-time reference model of the object’s trajectory.

The EMA's formula is calculated as follows:

\[ \text{EMA}_{\text{new}} = \alpha \cdot \text{Current Sample} + (1 - \alpha) \cdot \text{EMA}_{\text{old}} \]

where:

\[ \alpha = \frac{\text{sample\_clk\_rate}}{\text{smoothing\_time} + \text{sample\_clk\_rate}} \]

200.0.2 End condition

The interval ends when the object's traveled distance returns to its threshold or lower.

200.1 Plot

The following diagram illustrates how the Teleportation checker is triggered when the object's traveled distance exceeds its expected threshold, i.e., the object travels farther than expected. The interval ends only when the distance falls below the threshold.

Representation of activation of the Teleportation checker by exceeding the distance threshold

200.2 Attributes

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

Checker attribute Description
Parent object vehicle.teleportation
Issue category sut or other
Issue kind teleportation
Default severity warning
Trigger condition Based on teleportation watcher
Operation modes teleportation_checker

200.3 Configuration parameters

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

Parameter Type Unit Description Default Value Range
distance_factor_threshold float Multiplier applied to the aggregated EMA distance to set the activation threshold. If the measured distance between consecutive samples exceeds the resulting value (plus tolerance), an interval is triggered. 1.2 [0.0, 10.0]
distance_threshold_tolerance length m Tolerance added to the distance threshold that determines whether an interval starts or ends. 0.5m [0.0, 50.0]m
issue_severity enum (ignore, info, warning, error_continue, error, error_stop_now) Severity of the issue raised when teleportation is detected. warning
sample_clk_rate time s Checker sampling rate. 0.1s [0.0, 10]s
smoothing_time time s Smoothing time constant for distance calculations. Larger values increase smoothing and slow response. See Exponential Moving Average (EMA) for how α is derived from sample_clk_rate and smoothing_time. 0.4s [0.0, 10]s
enabled bool Sets whether the checker is enabled in all scenarios by default. true
log_level enum (info_level, debug_level, trace_level) Level of information displayed on the console. info_level

200.4 Metrics

The following metrics are recorded and tracked by the evaluator.

Metric Type Description Range Unit
measured_speed speed The measured speed at the moment the check was triggered kph
measured_distance length The measured distance traveled between the current and the previous time step m
trigger_reason enum (distance_exceeded, no_reason) Indicates which condition triggered the checker
interval_duration time The duration of the checker's interval s

200.5 Log and Error messages

The following error message is generated with the severity determined by the ftlx_global_eval_config.

Output Condition Description Default Severity Action
Distance threshold is exceeded Teleportation detected: Distance/speed exceeded thresholds Warning Investigate the object's behaviour.

200.6 Usage

200.6.1 How to instantiate

The teleportation_checker can be instantiated for any physical_object.

checker teleportation_checker is teleportation(physical_object: actor) with:
        it.sut_issue(severity: ftlx_global_eval_config.ego_teleportation_checker_config.issue_severity,
                    kind: teleportation,
                    details: "Teleportation detected: $(teleportation_checker.data.trigger_reason.as(string).replace("_", " ")) threshold(s).")

keep(teleportation_checker.teleportation_checker_config == ftlx_global_eval_config.ego_teleportation_checker_config)

200.6.2 Set parameters at instantiation time

Bind the checker config with keep(...) in the declaration (see the instantiation example above).

200.6.3 Define and use a custom parameter set

Define a teleportation_checker_config struct to customize the checker's parameters:

const custom_teleportation_checker_config: teleportation_checker_config = new
set custom_teleportation_checker_config.distance_factor_threshold = 1.2
set custom_teleportation_checker_config.distance_threshold_tolerance = 0.5m
set custom_teleportation_checker_config.issue_severity = warning
set custom_teleportation_checker_config.sample_clk_rate = 100ms
set custom_teleportation_checker_config.smoothing_time = 0.4s
set custom_teleportation_checker_config.enabled = true
set custom_teleportation_checker_config.log_level = info_level
Then pass the struct value to the checker at instantiation:
checker custom_teleportation_checker is teleportation(physical_object: actor)
keep(custom_teleportation_checker.teleportation_checker_config == custom_teleportation_checker_config)

200.6.4 Disabling the checker

To disable the checker, set the enabled flag to false in the teleportation_checker_config struct:

const teleportation_checker_config: teleportation_checker_config = new
set teleportation_checker_config.enabled = false

200.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 teleportation_checker_config is used.