Skip to content

Commit

Permalink
Move section up
Browse files Browse the repository at this point in the history
Signed-off-by: Zulfaqar Azmi <[email protected]>
  • Loading branch information
zulfaqar-azmi-t4 committed Jan 16, 2025
1 parent e9827fc commit 9278b32
Showing 1 changed file with 127 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,133 @@ Within this range, we sample the lateral acceleration for the ego vehicle. Simil
lateral_acceleration_resolution = (maximum_lateral_acceleration - minimum_lateral_acceleration) / lateral_acceleration_sampling_num
```

##### Object filtering

Before performing safety checks, predicted objects are categorized based on their current pose and behavior at the time. These categories help determine how each object impacts the lane change process and guide the safety evaluation.

The predicted objects are divided into four main categories:

- **Target Lane Leading**: Objects that overlap with the target lane and are in front of the ego vehicle. This category is further divided into three subcategories:
- Moving: Objects with a velocity above a certain threshold.
- Stopped: Stationary objects within the target lane.
- Stopped at Bound: Objects outside the target lane but close to its boundaries.
- **Target Lane Trailing**: Objects that overlap with the target lane or any lanes preceding the target lane. Only moving vehicles are included in this category.
- **Current Lane**: Objects in front of the ego vehicle in the ego vehicle's current lane.
- **Others**: Any objects not classified into the above categories.

![object lanes](./images/lane_objects.drawio.svg)

Furthermore, for **Target Lane Leading** and **Current Lane** objects, only those positioned within the lane boundary or before the goal position are considered. Objects exceeding the end of the lane or the goal position are classified as **Others**.

Once objects are filtered into their respective categories, they are sorted by distance closest to the ego vehicle to farthest.

The following diagram illustrates the filtering process,

```plantuml
@startuml
skinparam defaultTextAlignment center
skinparam backgroundColor #WHITE
title Filter Objects main flowchart
start
:Filter predicted objects by class;
note left: Remove objects whose classes are\nnot specified in the <color:red>**target_object**</color> parameter.
:Filter oncoming predicted objects;
note left: Compare ego's current pose and object's current pose,\nand filter out any object whose yaw difference exceeds\n<color:red>**collision_check.th_incoming_object_yaw**</color>;
:Transform predicted objects to extended predicted objects;
group "Filter target lane objects" {
if (Object's lateral distance\nfrom the centerline\nis more than\nhalf of ego's width?) then (TRUE)
if (Object's current pose\nis before the goal or\nthe end of the lane) then (TRUE)
if (Object overlaps target lane?) then (TRUE)
#LightGreen:To SUBPROCESS "Separate object based on its behavior in target lane";
if(can separate object in SUBPROCESS) then (TRUE)
stop
endif
else (FALSE)
if (Object is moving\nAND\nis a vehicle class\nAND\npath overlaps target lane?) then (TRUE)
#LightGreen:To SUBPROCESS "Separate object based on its behavior in target lane";
if(can separate object in SUBPROCESS) then (TRUE)
stop
endif
endif
endif
endif
#LightPink:From SUBPROCESS "Separate object based on its behavior in target lane";
if (Object is in expanded target lane\nAND\nis stopped\nAND\nin front of ego?) then (TRUE)
:Add object to <color:blue>**filtered_object.leading_objects.stopped_at_bound**</color> list;
stop
endif
else (FALSE)
if (Object overlaps preceding target lanes?) then (TRUE)
:Add object to <color:blue>**filtered_object.trailing_objects**</color> list;
stop
endif
endif
}
if (Object is in front of ego\nAND\nis before terminal\nAND\noverlaps current lane?) then (TRUE)
:Add object to <color:orange>**filtered_object.current_lane**</color> list;
stop
else (FALSE)
:Add object to <color:magenta>**filtered_object.others**</color> list;
endif
stop
#LightGreen:Start separating object based on its behavior in target lane;
if (Object is behind ego AND moving?) then (TRUE)
:Add object to <color:blue>**filtered_object.trailing_objects**</color> list;
:Can separate object;
stop
else (FALSE)
if (Object is in front of ego?) then (TRUE)
if (Object is moving?) then (TRUE)
:Add object to <color:blue>**filtered_object.leading_objects.moving**</color> list;
:Can separate object;
stop
else (FALSE)
:Add object to <color:blue>**filtered_object.leading_objects.stopped**</color> list;
:Can separate object;
stop
endif
endif
endif
#LightPink:Cant separate proceed with other checks;
@enduml
```

!!! note

As shown in the flowchart, oncoming objects are also filtered out. The filtering process considers the difference between the current orientation of the ego vehicle and that of the object. However, depending on the map's geometry, a certain threshold may need to be allowed. This threshold can be configured using the parameter collision_check.th_incoming_object_yaw.

!!! note

The **Target Lane Leading's Stopped at Boundary** objects are detected using the expanded area of the target lane beyond its original boundaries. The parameters `lane_expansion.left_offset` and `lane_expansion.right_offset` can be configured to adjust the expanded width.

<div align="center">
<table>
<tr>
<td>
<div style="text-align: center;">
<div style="color: black; font-size: 20px; margin-bottom: 10px;">Without Lane Expansion</div>
<img src="./images/lane_change-lane_expansion-without.png" alt="Without lane expansion">
</div>
</td>
<td>
<div style="text-align: center;">
<div style="color: black; font-size: 20px; margin-bottom: 10px;">With Lane Expansion</div>
<img src="./images/lane_change-lane_expansion-with.png" alt="With lane expansion">
</div>
</td>
</tr>
</table>
</div>

#### Candidate Path's validity check

A candidate path is considered valid if it meets the following criteria:
Expand Down Expand Up @@ -424,133 +551,8 @@ See [safety check utils explanation](../autoware_behavior_path_planner_common/do

First, we divide the target objects into obstacles in the target lane, obstacles in the current lane, and obstacles in other lanes. Target lane indicates the lane that the ego vehicle is going to reach after the lane change and current lane mean the current lane where the ego vehicle is following before the lane change. Other lanes are lanes that do not belong to the target and current lanes. The following picture describes objects on each lane. Note that users can remove objects either on current and other lanes from safety check by changing the flag, which are `check_objects_on_current_lanes` and `check_objects_on_other_lanes`.

![object lanes](./images/lane_objects.drawio.svg)

Furthermore, to change lanes behind a vehicle waiting at a traffic light, we skip the safety check for the stopping vehicles near the traffic light. The explanation for parked car detection is written in [documentation for avoidance module](../autoware_behavior_path_static_obstacle_avoidance_module/README.md).

The detection area for the target lane can be expanded beyond its original boundaries to enable detection of objects that are outside the target lane's limits.

<div align="center">
<table>
<tr>
<td>
<div style="text-align: center;">
<div style="color: black; font-size: 20px; margin-bottom: 10px;">Without Lane Expansion</div>
<img src="./images/lane_change-lane_expansion-without.png" alt="Without lane expansion">
</div>
</td>
<td>
<div style="text-align: center;">
<div style="color: black; font-size: 20px; margin-bottom: 10px;">With Lane Expansion</div>
<img src="./images/lane_change-lane_expansion-with.png" alt="With lane expansion">
</div>
</td>
</tr>
</table>
</div>

##### Object filtering

Before performing safety checks, predicted objects are categorized based on their current pose and behavior at the time. These categories help determine how each object impacts the lane change process and guide the safety evaluation.

The predicted objects are divided into four main categories:

- **Target Lane Leading**: Objects that overlap with the target lane and are in front of the ego vehicle. This category is further divided into three subcategories:
- Moving: Objects with a velocity above a certain threshold.
- Stopped: Stationary objects within the target lane.
- Stopping at Bound: Objects outside the target lane but close to its boundaries.
- **Target Lane Trailing**: Objects that overlap with the target lane or any lanes preceding the target lane. Only moving vehicles are included in this category.
- **Current Lane**: Objects in front of the ego vehicle in the ego vehicle's current lane.
- **Others**: Any objects not classified into the above categories.

Furthermore, for **Target Lane Leading** and **Current Lane** objects, only those positioned within the lane boundary or before the goal position are considered. Objects exceeding the end of the lane or the goal position are classified as **Others**.

Once objects are filtered into their respective categories, they are sorted by distance closest to the ego vehicle to farthest.

The following diagram illustrates the filtering process,

```plantuml
@startuml
skinparam defaultTextAlignment center
skinparam backgroundColor #WHITE
title Filter Objects main flowchart
start
:Filter predicted objects by class;
note left: Remove objects whose classes are\nnot specified in the <color:red>**target_object**</color> parameter.
:Filter oncoming predicted objects;
note left: Compare ego's current pose and object's current pose,\nand filter out any object whose yaw difference exceeds\n<color:red>**collision_check.th_incoming_object_yaw**</color>;
:Transform predicted objects to extended predicted objects;
group "Filter target lane objects" {
if (Object's lateral distance\nfrom the centerline\nis more than\nhalf of ego's width?) then (TRUE)
if (Object's current pose\nis before the goal or\nthe end of the lane) then (TRUE)
if (Object overlaps target lane?) then (TRUE)
#LightGreen:To SUBPROCESS "Separate object based on its behavior in target lane";
if(can separate object in SUBPROCESS) then (TRUE)
stop
endif
else (FALSE)
if (Object is moving\nAND\nis a vehicle class\nAND\npath overlaps target lane?) then (TRUE)
#LightGreen:To SUBPROCESS "Separate object based on its behavior in target lane";
if(can separate object in SUBPROCESS) then (TRUE)
stop
endif
endif
endif
endif
#LightPink:From SUBPROCESS "Separate object based on its behavior in target lane";
if (Object is in expanded target lane\nAND\nis stopped\nAND\nin front of ego?) then (TRUE)
:Add object to <color:blue>**filtered_object.leading_objects.stopped_at_bound**</color> list;
stop
endif
else (FALSE)
if (Object overlaps preceding target lanes?) then (TRUE)
:Add object to <color:blue>**filtered_object.trailing_objects**</color> list;
stop
endif
endif
}
if (Object is in front of ego\nAND\nis before terminal\nAND\noverlaps current lane?) then (TRUE)
:Add object to <color:orange>**filtered_object.current_lane**</color> list;
stop
else (FALSE)
:Add object to <color:magenta>**filtered_object.others**</color> list;
endif
stop
#LightGreen:Start separating object based on its behavior in target lane;
if (Object is behind ego AND moving?) then (TRUE)
:Add object to <color:blue>**filtered_object.trailing_objects**</color> list;
:Can separate object;
stop
else (FALSE)
if (Object is in front of ego?) then (TRUE)
if (Object is moving?) then (TRUE)
:Add object to <color:blue>**filtered_object.leading_objects.moving**</color> list;
:Can separate object;
stop
else (FALSE)
:Add object to <color:blue>**filtered_object.leading_objects.stopped**</color> list;
:Can separate object;
stop
endif
endif
endif
#LightPink:Cant separate proceed with other checks;
@enduml
```

!!! note

As shown in the flowchart, oncoming objects are also filtered out. The filtering process considers the difference between the current orientation of the ego vehicle and that of the object. However, depending on the map's geometry, a certain threshold may need to be allowed. This threshold can be configured using the parameter collision_check.th_incoming_object_yaw.

##### Collision check in prepare phase

The ego vehicle may need to secure ample inter-vehicle distance ahead of the target vehicle before attempting a lane change. The flag `enable_collision_check_at_prepare_phase` can be enabled to gain this behavior. The following image illustrates the differences between the `false` and `true` cases.
Expand Down

0 comments on commit 9278b32

Please sign in to comment.