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

feat(crosswalk): add option to slowdown at occluded crosswalks #6122

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
800457f
Add barebone function to add virtual occluded object
maxime-clem Dec 18, 2023
0f8b6f6
Switching to a simpler slowdown based approach
maxime-clem Jan 16, 2024
397196c
add detection areas at the front&back of the crosswalk
maxime-clem Jan 16, 2024
85179bb
Improve time buffer
maxime-clem Jan 17, 2024
0ff684e
Comment out SVG debug code
maxime-clem Jan 17, 2024
baa4eef
Check that ego did not already pass the crosswalk
maxime-clem Jan 18, 2024
99e688f
Add ROS params
maxime-clem Jan 19, 2024
aecd605
Split hpp/cpp
maxime-clem Jan 19, 2024
67f17b9
Add docstring
maxime-clem Jan 19, 2024
39c5861
Small refactor (point2d,point2d) -> segment2d
maxime-clem Jan 19, 2024
cfe7113
Remove svg code
maxime-clem Jan 19, 2024
18d726b
Refactor timers
maxime-clem Jan 19, 2024
fd7633e
Calculate the detection range based on the distance from the crosswalk
maxime-clem Jan 22, 2024
d736dab
Add option to ignore crosswalk with traffic light + apply max decel/jerk
maxime-clem Jan 22, 2024
830ee7e
Small refactor
maxime-clem Jan 23, 2024
610496c
[WIP] option to ignore occlusions behind predicted objects
maxime-clem Jan 23, 2024
882927c
[DEBUG] launch behavior_velocity_planner in gdb+konsole
maxime-clem Jan 24, 2024
6c2e993
Fix masking behind predicted objects
maxime-clem Jan 24, 2024
65687bd
Revert "[DEBUG] launch behavior_velocity_planner in gdb+konsole"
maxime-clem Jan 24, 2024
0622e47
pre-commit
maxime-clem Jan 24, 2024
891dc96
Refactor and add param to NOT ignore behind pedestrians
maxime-clem Jan 26, 2024
ea4193b
Change params to set the ignore vel threshold for each label
maxime-clem Jan 26, 2024
5a8901b
rename param
maxime-clem Jan 29, 2024
20736ad
fix timer
maxime-clem Feb 2, 2024
b681fe7
add ego lateral offset to detection range
maxime-clem Feb 2, 2024
f48deca
ignore occlusions only if the traffic light is red
maxime-clem Feb 3, 2024
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
6 changes: 2 additions & 4 deletions planning/behavior_velocity_crosswalk_module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ autoware_package()
pluginlib_export_plugin_description_file(behavior_velocity_planner plugins.xml)

ament_auto_add_library(${PROJECT_NAME} SHARED
src/debug.cpp
src/manager.cpp
src/scene_crosswalk.cpp
src/util.cpp
DIRECTORY
src
)

ament_auto_package(INSTALL_TO_SHARE config)
Expand Down
44 changes: 44 additions & 0 deletions planning/behavior_velocity_crosswalk_module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,50 @@ document.
| `max_slow_down_accel` | [m/ss] | double | minimum accel deceleration for safe brake |
| `no_relax_velocity` | [m/s] | double | if the current velocity is less than X m/s, ego always stops at the stop position(not relax deceleration constraints) |

### Occlusion

This feature makes ego slow down for a crosswalk that is occluded.

Occlusion of the crosswalk is determined using the occupancy grid.
An occlusion is a square of size `min_size` of occluded cells
(i.e., their values are between `free_space_max` and `occupied_min`)
of size `min_size`.
If an occlusion is found within range of the crosswalk,
then the velocity limit at the crosswalk is set to `slow_down_velocity` (or more to not break limits set by `max_slow_down_jerk` and `max_slow_down_accel`).
The range is calculated from the intersection between the ego path and the crosswalk and is equal to the time taken by ego to reach the crosswalk times the `occluded_object_velocity`.
This range is meant to be large when ego is far from the crosswalk and small when ego is close.

In order to avoid flickering decisions, a time buffer can be used such that the decision to add (or remove) the slow down is only taken
after an occlusion is detected (or not detected) for a consecutive time defined by the `time_buffer` parameter.

To ignore occlusions when the pedestrian light is red, `ignore_with_red_traffic_light` should be set to true.

To ignore temporary occlusions caused by moving objects,
`ignore_behind_predicted_objects` should be set to true.
By default, occlusions behind an object with velocity higher than `ignore_velocity_thresholds.default` are ignored.
This velocity threshold can be specified depending on the object type by specifying the object class label and velocity threshold in the parameter lists `ignore_velocity_thresholds.custom_labels` and `ignore_velocity_thresholds.custom_thresholds`.
To inflate the masking behind objects, their footprint can be made bigger using `extra_predicted_objects_size`.

<figure markdown>
![stuck_vehicle_attention_range](docs/with_occlusion.svg){width=600}
</figure>

| Parameter | Unit | Type | Description |
| ---------------------------------------------- | ----- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `enable` | [-] | bool | if true, ego will slow down around crosswalks that are occluded |
| `occluded_object_velocity` | [m/s] | double | assumed velocity of objects that may come out of the occluded space |
| `slow_down_velocity` | [m/s] | double | slow down velocity |
| `time_buffer` | [s] | double | consecutive time with/without an occlusion to add/remove the slowdown |
| `min_size` | [m] | double | minimum size of an occlusion (square side size) |
| `free_space_max` | [-] | double | maximum value of a free space cell in the occupancy grid |
| `occupied_min` | [-] | double | minimum value of an occupied cell in the occupancy grid |
| `ignore_with_red_traffic_light` | [-] | bool | if true, occlusions at crosswalks with traffic lights are ignored |
| `ignore_behind_predicted_objects` | [-] | bool | if true, occlusions behind predicted objects are ignored |
| `ignore_velocity_thresholds.default` | [m/s] | double | occlusions are only ignored behind objects with a higher or equal velocity |
| `ignore_velocity_thresholds.custom_labels` | [-] | string list | labels for which to define a non-default velocity threshold (see `autoware_auto_perception_msgs::msg::ObjectClassification` for all the labels) |
| `ignore_velocity_thresholds.custom_thresholds` | [-] | double list | velocities of the custom labels |
| `extra_predicted_objects_size` | [m] | double | extra size added to the objects for masking the occlusions |

### Others

In the `common` namespace, the following parameters are defined.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,20 @@
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 occlusions
occlusion:
enable: true # if true, ego will slowdown around crosswalks that are occluded
occluded_object_velocity: 1.0 # [m/s] assumed velocity of objects that may come out of the occluded space
slow_down_velocity: 1.0 # [m/s]
time_buffer: 1.0 # [s] consecutive time with/without an occlusion to add/remove the slowdown
min_size: 0.5 # [m] minimum size of an occlusion (square side size)
free_space_max: 43 # [-] maximum value of a free space cell in the occupancy grid
occupied_min: 58 # [-] minimum value of an occupied cell in the occupancy grid
ignore_with_red_traffic_light: true # [-] if true, occlusions at crosswalks with traffic lights are ignored
ignore_behind_predicted_objects: true # [-] if true, occlusions behind predicted objects are ignored
ignore_velocity_thresholds:
default: 0.5 # [m/s] occlusions are only ignored behind objects with a higher or equal velocity
custom_labels: ["PEDESTRIAN"] # labels for which to define a non-default velocity threshold (see autoware_auto_perception_msgs::msg::ObjectClassification for all the labels)
custom_thresholds: [0.0] # velocities of the custom labels
extra_predicted_objects_size: 0.5 # [m] extra size added to the objects for masking the occlusions
Loading
Loading