Skip to content

125. Adjacent vehicle lane behavior watcher and checker

Watcher location: $FTX_PACKAGES/common/scenarios/adjacent_vehicle_lane_behavior_watcher_and_checker/adjacent_vehicle_lane_behavior_watcher_and_checker.osc

Defines the lane behavior of adjacent vehicles around the Ego during the scenario.

125.1 Adjacent vehicle lane behavior watcher

This watcher emits an interval when a vehicle is present in the adjacent lane of the Ego and ends when no vehicle is detected in the adjacent lane.

In the following image, the pale blue interval represents the time during which a watcher emits intervals from 0 seconds to 8.5 seconds. The watcher stops emitting intervals when no vehicles are present in the adjacent lane.

Figure 1: Adjacent vehicle lane behavior watcher emitting an interval
Figure 2: Adjacent vehicle lane behavior watcher stopped emitting the interval

The native check_on_same_lane method verifies that the vehicles are not in the same lane. This method takes the adjacent_vehicle and the Ego as inputs and returns true if they are in the same lane; otherwise, it returns false.

To verify that the adjacent_vehicle is in the adjacent lane of the Ego, calculate the lateral distance between them using the road_distance_to_global_coordinates method. This distance is then compared to the expected_distance, which is derived from half the lane width and half the width of the vehicles.

If the vehicles are in different lanes and the adjacent_vehicle falls within the expected lateral distance, the number_of_vehicle_on_adjacent_lane count is incremented. The watcher interval starts when the data is not NULL and the number_of_vehicle_on_adjacent_lane count is greater than or equal to 1. The interval ends when no vehicle is present beside the Ego.

125.1.1 KPI

The performance metrics and the data items captured during the test execution are as follows:

Name/Item Description Range Unit / Type
actor_id The Unique identification number of the Ego int
interval_count The total interval count when a vehicle is on the adjacent lane of the Ego int
start_time The start time of the interval time
end_time The end time of the interval int
total_time The total time of the interval int

125.2 Adjacent vehicle lane behavior checker

The Adjacent vehicle lane behavior checker: - Emits an interval when no vehicles are present in the adjacent lane. - Triggered when adjacent_vehicle_lane_watcher has no intervals. - Provides a warning when vehicles are on different roads. - Issues an error when a vehicle is not in an adjacent lane to the Ego.

  • The code example is available under checkers in the adjacent_vehicle_lane_behavior_watcher_and_checker_ex.osc file.