Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from autowarefoundation:main #274

Merged
merged 3 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion planning/behavior_velocity_crosswalk_module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
src/debug.cpp
src/manager.cpp
src/scene_crosswalk.cpp
src/scene_walkway.cpp
src/util.cpp
)

Expand Down
80 changes: 40 additions & 40 deletions planning/behavior_velocity_crosswalk_module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,54 @@ The manager launch crosswalk scene modules when the reference path conflicts cro

#### Common parameters

| Parameter | Type | Description |
| ---------------------- | ---- | ------------------------------- |
| `show_processing_time` | bool | whether to show processing time |
| Parameter | Type | Description |
| ----------------------------- | ---- | ------------------------------- |
| `common.show_processing_time` | bool | whether to show processing time |

#### Parameters for input data

| Parameter | Type | Description |
| ------------------------------------ | ------ | ---------------------------------------------- |
| `common.traffic_light_state_timeout` | double | [s] timeout threshold for traffic light signal |

#### Parameters for stop position

The crosswalk module determines a stop position at least `stop_margin` away from the object.
The crosswalk module determines a stop position at least `stop_distance_from_object` away from the object.

<figure markdown>
![stop_margin](docs/stop_margin.svg){width=1000}
![stop_distance_from_object](docs/stop_distance_from_object.svg){width=1000}
<figcaption>stop margin</figcaption>
</figure>

The stop line is the reference point for the stopping position of the vehicle, but if there is no stop line in front of the crosswalk, the position `stop_line_distance` meters before the crosswalk is the virtual stop line for the vehicle. Then, if the stop position determined from `stop_margin` exists in front of the stop line determined from the HDMap or `stop_line_distance`, the actual stop position is determined according to `stop_margin` in principle, and vice versa.
The stop line is the reference point for the stopping position of the vehicle, but if there is no stop line in front of the crosswalk, the position `stop_distance_from_crosswalk` meters before the crosswalk is the virtual stop line for the vehicle. Then, if the stop position determined from `stop_distance_from_object` exists in front of the stop line determined from the HDMap or `stop_distance_from_crosswalk`, the actual stop position is determined according to `stop_distance_from_object` in principle, and vice versa.

<figure markdown>
![stop_line](docs/stop_line.svg){width=700}
<figcaption>explicit stop line</figcaption>
</figure>

<figure markdown>
![stop_line_distance](docs/stop_line_distance.svg){width=700}
![stop_distance_from_crosswalk](docs/stop_distance_from_crosswalk.svg){width=700}
<figcaption>virtual stop point</figcaption>
</figure>

On the other hand, if pedestrian (bicycle) is crossing **wide** crosswalks seen in scramble intersections, and the pedestrian position is more than `stop_line_margin` meters away from the stop line, the actual stop position is determined to be `stop_margin` and pedestrian position, not at the stop line.
On the other hand, if pedestrian (bicycle) is crossing **wide** crosswalks seen in scramble intersections, and the pedestrian position is more than `far_object_threshold` meters away from the stop line, the actual stop position is determined to be `stop_distance_from_object` and pedestrian position, not at the stop line.

<figure markdown>
![stop_line_margin](docs/stop_line_margin.svg){width=1000}
![far_object_threshold](docs/far_object_threshold.svg){width=1000}
<figcaption>stop at wide crosswalk</figcaption>
</figure>

See the workflow in algorithms section.

| Parameter | Type | Description |
| ------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `stop_margin` | double | [m] the vehicle decelerates to be able to stop in front of object with margin |
| `stop_line_distance` | double | [m] make stop line away from crosswalk when no explicit stop line exists |
| `stop_line_margin` | double | [m] if objects cross X meters behind the stop line, the stop position is determined according to the object position (stop_margin meters before the object) |
| `stop_position_threshold` | double | [m] threshold for check whether the vehicle stop in front of crosswalk |
| Parameter | Type | Description |
| -------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `stop_position.stop_distance_from_object` | double | [m] the vehicle decelerates to be able to stop in front of object with margin |
| `stop_position.stop_distance_from_crosswalk` | double | [m] make stop line away from crosswalk when no explicit stop line exists |
| `stop_position.far_object_threshold` | double | [m] if objects cross X meters behind the stop line, the stop position is determined according to the object position (stop_distance_from_object meters before the object) |
| `stop_position.stop_position_threshold` | double | [m] threshold for check whether the vehicle stop in front of crosswalk |

#### Parameters for ego velocity
#### Parameters for ego's slow down velocity

| Parameter | Type | Description |
| --------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -76,32 +82,26 @@ If there are low speed or stop vehicle ahead of the crosswalk, and there is not
<figcaption>stuck vehicle attention range</figcaption>
</figure>

| Parameter | Type | Description |
| ------------------------------- | ------ | ---------------------------------------------------------------------- |
| `stuck_vehicle_velocity` | double | [m/s] maximum velocity threshold whether the vehicle is stuck |
| `max_lateral_offset` | double | [m] maximum lateral offset for stuck vehicle position should be looked |
| `stuck_vehicle_attention_range` | double | [m] the detection area is defined as X meters behind the crosswalk |
| Parameter | Type | Description |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------- |
| `stuck_vehicle.stuck_vehicle_velocity` | double | [m/s] maximum velocity threshold whether the vehicle is stuck |
| `stuck_vehicle.max_stuck_vehicle_lateral_offset` | double | [m] maximum lateral offset for stuck vehicle position should be looked |
| `stuck_vehicle.stuck_vehicle_attention_range` | double | [m] the detection area is defined as X meters behind the crosswalk |

#### Parameters for pass judge logic

Also see algorithm section.

| Parameter | Type | Description |
| -------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ego_pass_first_margin` | double | [s] time margin for ego pass first situation |
| `ego_pass_later_margin` | double | [s] time margin for object pass first situation |
| `stop_object_velocity_threshold` | double | [m/s] velocity threshold for the module to judge whether the objects is stopped |
| `min_object_velocity` | double | [m/s] minimum object velocity (compare the estimated velocity by perception module with this parameter and adopt the larger one to calculate TTV.) |
| `max_yield_timeout` | double | [s] if the pedestrian does not move for X seconds after stopping before the crosswalk, the module judge that ego is able to pass first. |
| `ego_yield_query_stop_duration` | double | [s] the amount of time which ego should be stopping to query whether it yields or not. |

#### Parameters for input data

| Parameter | Type | Description |
| ------------------ | ------ | ---------------------------------------------- |
| `tl_state_timeout` | double | [s] timeout threshold for traffic light signal |
| Parameter | Type | Description |
| ------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pass_judge.ego_pass_first_margin` | double | [s] time margin for ego pass first situation |
| `pass_judge.ego_pass_later_margin` | double | [s] time margin for object pass first situation |
| `pass_judge.stop_object_velocity_threshold` | double | [m/s] velocity threshold for the module to judge whether the objects is stopped |
| `pass_judge.min_object_velocity` | double | [m/s] minimum object velocity (compare the estimated velocity by perception module with this parameter and adopt the larger one to calculate TTV.) |
| `pass_judge.timeout_no_intention_to_walk` | double | [s] if the pedestrian does not move for X seconds after stopping before the crosswalk, the module judge that ego is able to pass first. |
| `pass_judge.timeout_ego_stop_for_yield` | double | [s] the amount of time which ego should be stopping to query whether it yields or not. |

#### Parameters for target area & object
#### Parameters for object filtering

As a countermeasure against pedestrians attempting to cross outside the crosswalk area, this module watches not only the crosswalk zebra area but also in front of and behind space of the crosswalk, and if there are pedestrians or bicycles attempting to pass through the watch area, this module judges whether ego should pass or stop.

Expand Down Expand Up @@ -131,15 +131,15 @@ The stop position is determined by the existence of the stop line defined by the

```plantuml
start
:calculate stop point from **stop_margin** (POINT-1);
:calculate stop point from **stop_distance_from_object** (POINT-1);
if (There is the stop line in front of the crosswalk?) then (yes)
:calculate stop point from stop line (POINT-2.1);
else (no)
:calculate stop point from **stop_line_distance** (POINT-2.2);
:calculate stop point from **stop_distance_from_crosswalk** (POINT-2.2);
endif
if (The distance ego to **POINT-1** is shorter than the distance ego to **POINT-2**) then (yes)
:ego stops at POINT-1;
else if (The distance ego to **POINT-1** is longer than the distance ego to **POINT-2** + **stop_line_margin**) then (yes)
else if (The distance ego to **POINT-1** is longer than the distance ego to **POINT-2** + **far_object_threshold**) then (yes)
:ego stops at POINT-1;
else (no)
:ego stops at POINT-2;
Expand Down Expand Up @@ -191,7 +191,7 @@ end

#### Dead lock prevention

If there are objects stop within a radius of `min_object_velocity * ego_pass_later_margin` meters from virtual collision point, this module judges that ego should stop based on the pass judge logic described above at all times. In such a situation, even if the pedestrian has no intention of crossing, ego continues the stop decision on the spot. So, this module has another logic for dead lock prevention, and if the object continues to stop for more than `max_yield_timeout` seconds after ego stops in front of the crosswalk, this module judges that the object has no intention of crossing and switches from **STOP** state to **PASS** state. The parameter `stop_object_velocity_threshold` is used to judge whether the objects are stopped or not. In addition, if the object starts to move after the module judges that the object has no intention of crossing, this module judges whether ego should stop or not once again.
If there are objects stop within a radius of `min_object_velocity * ego_pass_later_margin` meters from virtual collision point, this module judges that ego should stop based on the pass judge logic described above at all times. In such a situation, even if the pedestrian has no intention of crossing, ego continues the stop decision on the spot. So, this module has another logic for dead lock prevention, and if the object continues to stop for more than `timeout_no_intention_to_walk` seconds after ego stops in front of the crosswalk, this module judges that the object has no intention of crossing and switches from **STOP** state to **PASS** state. The parameter `stop_object_velocity_threshold` is used to judge whether the objects are stopped or not. In addition, if the object starts to move after the module judges that the object has no intention of crossing, this module judges whether ego should stop or not once again.

<figure markdown>
![no-intension](docs/no-intension.svg){width=1000}
Expand Down
Loading