193. Lane Departure
The lane_departure_checker monitors whether the vehicle maintains its lane throughout the simulation and detects any deviation that indicates the vehicle has crossed a lane boundary.
It continuously evaluates the vehicle's lateral position, orientation, and signaling behavior to determine when a lane departure occurs, ensuring that intentional maneuvers such as lane changes or turns are properly distinguished from unintended deviations.
When a lane departure is detected, the checker begins an interval during which it measures the vehicle's motion characteristics, including speed, acceleration, and distance from the lane boundary, and tracks how the event evolves over time. At the end of this interval, the checker classifies the outcome as return_to_lane, lane_change, timeout, or undefined_maneuver, depending on the vehicle's behavior after the initial lane departure.
193.0.1 Start condition
The interval starts when the vehicle begins to leave its lane and exceeds the leaving_lane_threshold. This threshold defines the distance from the crossed lane boundary to the vehicle's outermost edge, expressed as a percentage of the vehicle's width. Lane departure is based solely on the positions of the vehicle's front corners, so only the leading edge of the vehicle is considered when determining the start and end of the interval. The interval begins only if the vehicle's relative yaw angle exceeds the relative_yaw_threshold and the turn signal is inactive. Turn signal detection can be disabled during checker initialization by setting turn_signal_detection_enabled to false.
193.0.2 End condition
The interval can end under any of the following conditions:
- Return to lane: The vehicle is considered to have re-entered its lane when the portion of its width overlapping the adjacent lane falls below the threshold defined by the
re_entering_lane_thresholdparameter. This condition ends the interval with areturn_to_laneoutcome. - Lane change: The vehicle is considered to have completed a lane change when the portion of its width remaining within the original lane falls below the threshold defined by the
lane_change_thresholdparameter. This condition ends the interval with alane_changeoutcome. - Timeout: If the vehicle neither returns to its original lane nor completes a lane change within the period specified by the
lane_departure_timeout_thresholdparameter, the interval ends with atimeoutoutcome. - Undefined maneuver: If the vehicle performs an unexpected maneuver or the checker receives inconclusive data, the interval ends with an
undefined_maneuveroutcome.
193.1 Plot
The figure below illustrates the lane departure start condition.
The figure below illustrates the lane departure end condition.
193.2 Attributes
The following attributes define the behavior and characteristics of the evaluator.
| Checker attribute | Description |
|---|---|
| Parent object | vehicle.lane_departure |
| Issue category | sut or other |
| Issue kind | lane_departure |
| Default severity | warning |
| Trigger condition | Based on lane_departure watcher |
| Operation modes | lane_departure_checker |
193.3 Configuration parameters
The following parameters can be configured to customize the evaluator's behavior.
| Parameter | Type | Unit | Description | Default Value | Range |
|---|---|---|---|---|---|
leaving_lane_threshold |
float | Percentage of the vehicle's width that has to leave the lane to trigger the check | 0.15 | [0.0, 1.0] | |
re_entering_lane_threshold |
float | Percentage of the vehicle's width that must remain in the adjacent lane to be considered a return_to_lane | 0.05 | [0.0, 1.0] | |
lane_change_threshold |
float | Percentage of the vehicle's width that must remain in the original lane before it is considered a lane_change | 0.05 | [0.0, 1.0] | |
lane_departure_timeout_threshold |
time | s | Maximum allowed time for the vehicle to either complete a lane change or return to its original lane before the interval times out | 30s | [0, 30]s |
relative_yaw_threshold |
angle | deg | Minimum relative yaw angle required for the vehicle to start a lane departure interval | 0.2deg | [0.0, 90.0]deg |
turn_signal_detection_enabled |
bool | Enables or disables turn signal detection. When enabled, the interval will not start if the vehicle’s turn signal is active; when disabled, the interval starts regardless of turn signal state. | true |
193.4 Metrics
The following metrics are recorded and tracked by the evaluator.
| Metric | Type | Description | Range | Unit |
|---|---|---|---|---|
min_speed |
speed | The vehicle's minimum speed during the interval | kph | |
max_speed |
speed | The vehicle's maximum speed during the interval | kph | |
min_lon_acceleration |
acceleration | The vehicle's minimum longitudinal acceleration during the interval | mpsps | |
max_lon_acceleration |
acceleration | The vehicle's maximum longitudinal acceleration during the interval | mpsps | |
interval_duration |
time | The duration of the interval | s | |
vehicle_category |
enum (sedan, van, bus, box_truck, semi_trailer_truck, full_trailer_truck, motorcycle, bicycle) |
The vehicle's category | ||
is_valid_lane_position_at_interval |
bool | Indicates if the vehicle has a valid lane position during the interval | ||
side |
enum (left, right) |
The vehicle's movement direction during the interval | ||
end_condition |
enum (undefined_maneuver, return_to_lane, lane_change, timeout) |
The vehicle's end condition for the interval | ||
max_distance_to_lane |
length | The vehicle's maximum distance to the lane during the interval (If the vehicle did not return to the lane or the vehicle does not have a valid lane position during the interval, the value is set to MAX_LENGTH) | m | |
average_distance_to_lane |
length | The vehicle's average distance to the lane during the interval (If the vehicle did not return to the lane or the vehicle does not have a valid lane position during the interval, the value is set to MAX_LENGTH) | m |
193.5 Log and Error Messages
| Output Condition | Description | Default Severity | Action |
|---|---|---|---|
| After the interval ends, a warning is issued | Vehicle left its lane for lane_departure_checker.data.interval_duration. Outcome: lane_departure_checker.data.end_condition |
Warning | Investigate the vehicle's behaviour. |
193.6 Usage
193.6.1 How to instantiate
The lane_departure_checker can be instantiated for any vehicle actor.
checker lane_departure_checker is lane_departure(vehicle: actor,
leaving_lane_threshold: ftlx_global_eval_config.ego_lane_departure_checker_config.leaving_lane_threshold,
re_entering_lane_threshold: ftlx_global_eval_config.ego_lane_departure_checker_config.re_entering_lane_threshold,
lane_change_threshold: ftlx_global_eval_config.ego_lane_departure_checker_config.lane_change_threshold,
lane_departure_timeout_threshold: ftlx_global_eval_config.ego_lane_departure_checker_config.lane_departure_timeout_threshold,
relative_yaw_threshold: ftlx_global_eval_config.ego_lane_departure_checker_config.relative_yaw_threshold,
turn_signal_detection_enabled: ftlx_global_eval_config.ego_lane_departure_checker_config.turn_signal_detection_enabled,
log_level: ftlx_global_eval_config.ego_lane_departure_checker_config.log_level)
193.6.2 Set parameters at instantiation time
Pass parameters in the keep(...) binding at instantiation time, either from ftlx_global_eval_config or as explicit values.
checker lane_departure_checker is lane_departure(vehicle: sut.car):
keep(leaving_lane_threshold == ftlx_global_eval_config.ego_lane_departure_checker_config.leaving_lane_threshold)
keep(re_entering_lane_threshold == 0.1)
keep(lane_change_threshold == 0.1)
keep(lane_departure_timeout_threshold == 1s)
keep(relative_yaw_threshold == 0.1)
keep(turn_signal_detection_enabled == true)
keep(log_level == ftlx_global_eval_config.ego_lane_departure_checker_config.log_level)
193.6.3 Define and use a custom parameter set
Define a lane_departure_checker_config struct to customize the checker's parameters:
const custom_lane_departure_checker_config: lane_departure_checker_config = new
set custom_lane_departure_checker_config.leaving_lane_threshold = 0.1
set custom_lane_departure_checker_config.re_entering_lane_threshold = 0.1
set custom_lane_departure_checker_config.lane_change_threshold = 0.1
set custom_lane_departure_checker_config.lane_departure_timeout_threshold = 1s
set custom_lane_departure_checker_config.relative_yaw_threshold = 0.1
set custom_lane_departure_checker_config.turn_signal_detection_enabled = true
set custom_lane_departure_checker_config.log_level = trace_level
checker custom_lane_departure_checker is lane_departure(vehicle: sut.car,
leaving_lane_threshold: custom_lane_departure_checker_config.leaving_lane_threshold,
re_entering_lane_threshold: custom_lane_departure_checker_config.re_entering_lane_threshold,
lane_change_threshold: custom_lane_departure_checker_config.lane_change_threshold,
lane_departure_timeout_threshold: custom_lane_departure_checker_config.lane_departure_timeout_threshold,
relative_yaw_threshold: custom_lane_departure_checker_config.relative_yaw_threshold,
turn_signal_detection_enabled: custom_lane_departure_checker_config.turn_signal_detection_enabled,
log_level: custom_lane_departure_checker_config.log_level)
193.6.4 Disabling the checker
To disable the checker, set the enabled flag to false in the lane_departure_checker_config struct:
const lane_departure_checker_config: lane_departure_checker_config = new
set lane_departure_checker_config.enabled = false
193.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 lane_departure_checker_config is used.
Limitations
- The checker does not detect a lane departure if the vehicle drives toward an off-road area.
- The checker relies solely on data from the vehicle's front corners.
- The checker may fail to start the interval when the vehicle is in overlapping lanes (i.e., when lane geometry is shared), such as at a junction. In these cases, the checker cannot identify the departure lane, so the start condition is not triggered.
- The interval starts only when both
vehicle.stateandvehicle.prev_stateare available. - The start condition is evaluated only when the current lane has a valid driving lane index and the vehicle occupies that lane according to
get_occupied_driving_lanes(). undefined_maneuvercan be reported when the vehicle crosses more than one lane during the interval or when the checker cannot confirm a lane-change or return-to-lane condition.
Note
- Negative values for the start or end condition thresholds are not recommended. They should only be used intentionally and with caution, as they may lead to unreliable or meaningless results, particularly for wide vehicles and narrow lanes. It is recommended to limit both the start and end condition thresholds to a maximum of 50% (0.5) of the vehicle's width.