diff --git a/planning/behavior_velocity_crosswalk_module/README.md b/planning/behavior_velocity_crosswalk_module/README.md
index 95abf3b00f970..218989482ec97 100644
--- a/planning/behavior_velocity_crosswalk_module/README.md
+++ b/planning/behavior_velocity_crosswalk_module/README.md
@@ -17,20 +17,26 @@ 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.
- ![stop_margin](docs/stop_margin.svg){width=1000}
+ ![stop_distance_from_object](docs/stop_distance_from_object.svg){width=1000}
stop margin
-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.
![stop_line](docs/stop_line.svg){width=700}
@@ -38,27 +44,27 @@ The stop line is the reference point for the stopping position of the vehicle, b
- ![stop_line_distance](docs/stop_line_distance.svg){width=700}
+ ![stop_distance_from_crosswalk](docs/stop_distance_from_crosswalk.svg){width=700}
virtual stop point
-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.
- ![stop_line_margin](docs/stop_line_margin.svg){width=1000}
+ ![far_object_threshold](docs/far_object_threshold.svg){width=1000}
stop at wide crosswalk
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 |
| --------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
@@ -76,32 +82,26 @@ If there are low speed or stop vehicle ahead of the crosswalk, and there is not
stuck vehicle attention range
-| 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.
@@ -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;
@@ -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.
![no-intension](docs/no-intension.svg){width=1000}
diff --git a/planning/behavior_velocity_crosswalk_module/config/crosswalk.param.yaml b/planning/behavior_velocity_crosswalk_module/config/crosswalk.param.yaml
index 8a4b80a44d84d..edd37092ba49d 100644
--- a/planning/behavior_velocity_crosswalk_module/config/crosswalk.param.yaml
+++ b/planning/behavior_velocity_crosswalk_module/config/crosswalk.param.yaml
@@ -1,41 +1,51 @@
/**:
ros__parameters:
crosswalk:
- show_processing_time: false # [-] whether to show processing time
+ common:
+ show_processing_time: false # [-] whether to show processing time
+ # param for input data
+ traffic_light_state_timeout: 3.0 # [s] timeout threshold for traffic light signal
# param for stop position
- stop_line_distance: 3.5 # [m] make stop line away from crosswalk when no explicit stop line exists
- stop_line_margin: 10.0 # [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_margin: 2.0 # [m] the vehicle decelerates to be able to stop in front of object with margin
- stop_position_threshold: 1.0 # [m] threshold for check whether the vehicle stop in front of crosswalk
+ stop_position:
+ stop_position_threshold: 1.0 # [m] threshold to check whether the vehicle stops in front of crosswalk for yielding
- # param for ego velocity
- min_slow_down_velocity: 2.78 # [m/s] target vehicle velocity when module receive slow down command from FOA (2.78 m/s = 10.0 kmph)
- max_slow_down_jerk: -1.5 # [m/sss] minimum jerk deceleration for safe brake
- max_slow_down_accel: -2.5 # [m/ss] minimum accel deceleration for safe brake
- no_relax_velocity: 2.78 # [m/s] if the current velocity is less than X m/s, ego always stops at the stop position(not relax deceleration constraints 2.78 m/s = 10 kmph)
+ # For the Lanelet2 map with no explicit stop lines
+ stop_distance_from_crosswalk: 3.5 # [m] make stop line away from crosswalk
+ # For the case where the crosswalk width is very wide
+ far_object_threshold: 10.0 # [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).
+ # For the case where the stop position is determined according to the object position.
+ stop_distance_from_object: 2.0 # [m] the vehicle decelerates to be able to stop in front of object with margin
- # param for stuck vehicle
- stuck_vehicle_velocity: 1.0 # [m/s] maximum velocity threshold whether the vehicle is stuck
- max_lateral_offset: 2.0 # [m] maximum lateral offset for stuck vehicle position should be looked
- stuck_vehicle_attention_range: 10.0 # [m] the detection area is defined as X meters behind the crosswalk
+ # param for ego's slow down velocity
+ slow_down:
+ min_slow_down_velocity: 2.78 # [m/s] target vehicle velocity when module receive slow down command from FOA (2.78 m/s = 10.0 kmph)
+ max_slow_down_jerk: -1.5 # [m/sss] minimum jerk deceleration for safe brake
+ max_slow_down_accel: -2.5 # [m/ss] minimum accel deceleration for safe brake
+ no_relax_velocity: 2.78 # [m/s] if the current velocity is less than X m/s, ego always stops at the stop position(not relax deceleration constraints 2.78 m/s = 10 kmph)
- # param for pass judge logic
- disable_stop_for_yield_cancel: false
- ego_pass_first_margin: 6.0 # [s] time margin for ego pass first situation (the module judges that ego don't have to stop at TTC + MARGIN < TTV condition)
- ego_pass_later_margin: 10.0 # [s] time margin for object pass first situation (the module judges that ego don't have to stop at TTV + MARGIN < TTC condition)
- stop_object_velocity_threshold: 0.28 # [m/s] velocity threshold for the module to judge whether the objects is stopped (0.28 m/s = 1.0 kmph)
- min_object_velocity: 1.39 # [m/s] minimum object velocity (compare the estimated velocity by perception module with this parameter and adopt the larger one to calculate TTV. 1.39 m/s = 5.0 kmph)
- max_yield_timeout: 3.0 # [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: 3.0 # [s] the amount of time which ego should be stopping to query whether it yields or not
+ # param for stuck vehicles
+ stuck_vehicle:
+ stuck_vehicle_velocity: 1.0 # [m/s] maximum velocity threshold whether the vehicle is stuck
+ max_stuck_vehicle_lateral_offset: 2.0 # [m] maximum lateral offset for stuck vehicle position should be looked
+ stuck_vehicle_attention_range: 10.0 # [m] the detection area is defined as X meters behind the crosswalk
- # param for input data
- tl_state_timeout: 3.0 # [s] timeout threshold for traffic light signal
+ # param for pass judge logic
+ pass_judge:
+ ego_pass_first_margin: 6.0 # [s] time margin for ego pass first situation (the module judges that ego don't have to stop at TTC + MARGIN < TTV condition)
+ ego_pass_later_margin: 10.0 # [s] time margin for object pass first situation (the module judges that ego don't have to stop at TTV + MARGIN < TTC condition)
+ stop_object_velocity_threshold: 0.28 # [m/s] velocity threshold for the module to judge whether the objects is stopped (0.28 m/s = 1.0 kmph)
+ min_object_velocity: 1.39 # [m/s] minimum object velocity (compare the estimated velocity by perception module with this parameter and adopt the larger one to calculate TTV. 1.39 m/s = 5.0 kmph)
+ ## param for yielding
+ disable_stop_for_yield_cancel: false
+ timeout_no_intention_to_walk: 3.0 # [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.
+ timeout_ego_stop_for_yield: 3.0 # [s] the amount of time which ego should be stopping to query whether it yields or not
- # param for target area & object
- crosswalk_attention_range: 1.0 # [m] the detection area is defined as -X meters before the crosswalk to +X meters behind the crosswalk
- target_object:
- unknown: true # [-] whether to look and stop by UNKNOWN objects
- bicycle: true # [-] whether to look and stop by BICYCLE objects
- motorcycle: true # [-] whether to look and stop by MOTORCYCLE objects (tmp: currently it is difficult for perception modules to detect bicycles and motorcycles separately.)
- pedestrian: true # [-] whether to look and stop by PEDESTRIAN objects
+ # param for target object filtering
+ object_filtering:
+ crosswalk_attention_range: 1.0 # [m] the detection area is defined as -X meters before the crosswalk to +X meters behind the crosswalk
+ target_object:
+ unknown: true # [-] whether to look and stop by UNKNOWN objects
+ bicycle: true # [-] whether to look and stop by BICYCLE objects
+ motorcycle: true # [-] whether to look and stop by MOTORCYCLE objects (tmp: currently it is difficult for perception modules to detect bicycles and motorcycles separately.)
+ pedestrian: true # [-] whether to look and stop by PEDESTRIAN objects
diff --git a/planning/behavior_velocity_crosswalk_module/docs/stop_line.svg b/planning/behavior_velocity_crosswalk_module/docs/stop_line.svg
index d4724cba3cbbb..c2d486a7d3541 100644
--- a/planning/behavior_velocity_crosswalk_module/docs/stop_line.svg
+++ b/planning/behavior_velocity_crosswalk_module/docs/stop_line.svg
@@ -129,13 +129,13 @@