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: add behavior_velocity_planner package #27

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
05178e9
release v0.4.0
mitsudome-r Sep 18, 2020
33047c0
Fix typo (#700)
kenji-miyake Jul 16, 2020
8722fcb
Fix detection area (#701)
kenji-miyake Jul 17, 2020
a5f0dc1
intersection: change detection area length parameter from 100m to 200…
TakaHoribe Jul 17, 2020
ac8b68c
intersection: fix stuck vehicle behavior (#695)
TakaHoribe Jul 19, 2020
bb65801
Feature/intersection use spline interpolation library (#710)
rej55 Jul 29, 2020
7e85942
Feature/stop reason (#712)
tkimura4 Aug 3, 2020
2952e9e
Fix/stop reason (#724)
tkimura4 Aug 3, 2020
ba67138
Fix/spline interpolation in intersection module (#726)
rej55 Aug 4, 2020
9e20c34
fix clac signed distance bug (#733)
Aug 5, 2020
b1a1f94
intersection: ignore stop plane when path[0] is in detection area (#739)
TakaHoribe Aug 10, 2020
387219e
Publish tl states stamped (#744)
wep21 Aug 11, 2020
d0c3f44
update visualization marker (#759)
tkimura4 Aug 12, 2020
a977d4b
fix stack area (#758)
tkimura4 Aug 12, 2020
507e9e1
dont check pointcloud (#765)
yukkysaito Aug 13, 2020
fcae4f6
fix stop factor of merge_from_private_area (#749)
tkimura4 Aug 14, 2020
200f6d4
Revert "Publish tl states stamped (#744)" (#771)
yukkysaito Aug 14, 2020
959509e
fix intersection bug (#773)
tkimura4 Aug 14, 2020
93cc124
change uid of marker (#775)
tkimura4 Aug 14, 2020
d19aa9a
Fix/publish tl state stamped (#772)
wep21 Aug 14, 2020
32a06bb
Fix blind spot areas and logic for creating a stop line (#732)
wep21 Aug 17, 2020
a095222
Fix/intersection stuck detect area (#764)
tkimura4 Aug 17, 2020
999696a
avoid to input -1 index (#777)
tkimura4 Aug 18, 2020
6be0c2e
add dead line and pass through when over dead line (#784)
Aug 18, 2020
4ff6df4
Add arg for input tl topic name (#783)
wep21 Aug 19, 2020
0ecc942
change margin to 1.0m (#790)
yukkysaito Aug 19, 2020
f22ae30
fix insert target point bug (#798)
Aug 20, 2020
f3246e1
fix typo stop_liine to stop_line (#799)
TakaHoribe Aug 20, 2020
d68ca0d
traffic light scene module : fix bug and change param (#800)
yukkysaito Aug 20, 2020
dad6b7d
Intersection add debug comment (#803)
TakaHoribe Aug 20, 2020
eebc1b2
Fix intersection preceeding lane query (#807)
mitsudome-r Aug 20, 2020
1e1b90d
Fix blind spot area (#806)
wep21 Aug 20, 2020
3d11a9c
Revert "fix insert target point bug (#798)" (#815)
yukkysaito Aug 21, 2020
c08fa7a
Fix/traffic light state (#801)
yukkysaito Aug 21, 2020
a036d0d
change param (#821)
yukkysaito Aug 22, 2020
ae29380
stopline: parametrize check distance (#825)
TakaHoribe Aug 23, 2020
1ba75cd
Check if lanelets are sequential (#823)
wep21 Aug 24, 2020
4d38eae
fix uninitialized variables (#816)
kmiya Aug 25, 2020
f78eafb
Parameterization for calculating judge line distance (#831)
wep21 Aug 25, 2020
891f802
remove ROS1 packages temporarily
mitsudome-r Sep 29, 2020
0640659
Revert "remove ROS1 packages temporarily"
mitsudome-r Oct 8, 2020
7051d9d
add COLCON_IGNORE to ros1 packages
mitsudome-r Oct 8, 2020
229f1b1
Rename launch files to launch.xml (#28)
nnmm Oct 15, 2020
6701aa1
Port behavior_velocity_planner to ROS2 (#80)
nnmm Nov 16, 2020
59513fd
[ROS2] Fix behavior velocity planner (#110)
mitsudome-r Nov 24, 2020
6e0494b
Convert calls of Duration to Duration::from_seconds where appropriate…
nnmm Nov 30, 2020
c63af23
Rename h files to hpp (#142)
nnmm Dec 3, 2020
129a6df
Adjust copyright notice on 532 out of 699 source files (#143)
nnmm Dec 3, 2020
b22e4a4
Use quotes for includes where appropriate (#144)
nnmm Dec 7, 2020
b842c2e
Run uncrustify on the entire Pilot.Auto codebase (#151)
nnmm Dec 8, 2020
40bc0dd
fixing trasient_local in ROS2 packages (#160)
nik-tier4 Dec 11, 2020
fd20708
Enable cppcheck lints in behavior_velocity_planner (#159)
nnmm Dec 15, 2020
abc663b
Make launch files load vehicle model params dependent on argument (#228)
nnmm Dec 23, 2020
76d094f
change from vehicle_model to vehicle_param_file (#242)
k0suke-murakami Dec 24, 2020
4ee0eea
Ros2 v0.8 fix typo of "preceding" (#323)
isamu-takagi Feb 10, 2021
6b16c56
Ros2 v0.8.0 behavior velocity planner (#332)
taikitanaka3 Feb 17, 2021
dffb4a7
Rename ROS-related .yaml to .param.yaml (#352)
kenji-miyake Feb 24, 2021
e60bcd1
[behavior_velocity_planner]: Fix missing ros2 porting (#392)
wep21 Mar 1, 2021
e67ac6b
Fix error handling of tf lookupTransform (#405)
kenji-miyake Mar 4, 2021
99352a9
rm_std_msgs (#402)
taikitanaka3 Mar 5, 2021
0804e20
Sensor data qos (#407)
wep21 Mar 11, 2021
898dfad
Ros2 fix topic name part1 (#408)
isamu-takagi Mar 12, 2021
f07f801
Fix typo in planning module (#432)
kmiya Mar 18, 2021
674c0c8
fix traffic light module (#458)
tkimura4 Mar 25, 2021
5bc0e7f
change log type (#459)
tkimura4 Mar 25, 2021
8ff16c0
add use_sim-time option (#454)
tkimura4 Mar 26, 2021
8d572b4
Fix rolling build errors (#1225)
kenji-miyake Apr 5, 2021
6411e8f
Sync public repo (#1228)
mitsudome-r Apr 5, 2021
4f074f9
Unify Apache-2.0 license name (#1242)
kmiya Apr 15, 2021
388d818
Make planning modules components (#1263)
wep21 Apr 22, 2021
79189a4
Remove use_sim_time for set_parameter (#1260)
wep21 Apr 26, 2021
4df2065
Refactor vehicle info util (#1305)
kenji-miyake May 11, 2021
02583e9
fix slow/stop marker color & stop reason (#1347) (#1354)
wep21 May 20, 2021
4931bd8
fix intersection stop line (#1272) (#1349)
wep21 May 20, 2021
baf45a8
Avoid passing empty lanelets to getPolygonFromArcLength (#1371)
wep21 May 24, 2021
9da8191
Add perception traffic light state output (#1302)
isamu-takagi May 24, 2021
0a89257
Feature/consider jerk limit in passjudge (#1339) (#1351)
wep21 May 24, 2021
45b072d
Feature/refactor stop line module (#1343) (#1359)
wep21 May 27, 2021
ae02c52
Feature/add stop duration ros2 (#1380)
wep21 May 27, 2021
af0fd04
Fix topic name of external traffic light input (#1412)
wep21 Jun 3, 2021
9cfeb1e
publish perception and external tl_state for mlops (#1350) (#1375)
tkimura4 Jun 16, 2021
2528479
Fix/traffic light planning module (#1424) (#1487)
wep21 Jun 19, 2021
265591e
change msg type looking traffic light state (#1494)
wep21 Jun 23, 2021
1bdfdb2
Add namespace to behavior_velocity_planner (#1542)
kenji-miyake Jun 29, 2021
9eef52c
Avoid passing uninitialized index (#1609)
wep21 Jul 9, 2021
8f03da2
suppress warnings for behavior_velocity_planner (#1733)
h-ohta Aug 2, 2021
ebacc37
Fix -Wunused-parameter (#1836)
kenji-miyake Aug 14, 2021
fa04a7c
Fix compiler warnings (#1837)
kenji-miyake Aug 15, 2021
fcedbfb
Add autoware api (#1979)
isamu-takagi Aug 31, 2021
3ca9479
Feature/add virtual traffic light planner (#1588)
kenji-miyake Sep 3, 2021
a983fbb
add sort-package-xml hook in pre-commit (#1881)
KeisukeShima Sep 9, 2021
c9c7370
remove spline_interpolation, and create interpolation package that ha…
takayuki5168 Oct 1, 2021
8118441
Sync develop/fix interpolation and speed up calculation (#2290)
mkuri Nov 1, 2021
abbda26
fix argument order (#1502) (#1622)
wep21 Oct 21, 2021
591ad57
Change param (#1559) (#1677)
wep21 Oct 21, 2021
6a6b190
Feature/use spline module in behavior velocity planner (#1457) (#1495)
wep21 Oct 21, 2021
39c1645
Feature/porting behavior path planner (#1645)
wep21 Oct 21, 2021
634a59f
Fix/generate intersection stop (#1590) (#1679)
wep21 Oct 21, 2021
1f635c2
Fix/stop margin time ros2 (#1683)
wep21 Oct 21, 2021
b40f562
Feature/change stop lines handling to support parking car avoidance p…
wep21 Oct 21, 2021
fb4331e
Feature/porting occlusion spot (#1740)
wep21 Oct 21, 2021
4191dc8
fix function name and condition for detection area (#1758)
taikitanaka3 Oct 21, 2021
a33b0e9
Fix build warning for occlusion spot (#1766)
Oct 21, 2021
556605e
Fix passing uninitialized index (#1792)
wep21 Oct 21, 2021
2b10dd7
Fix/intersection bug (#1787)
tkimura4 Oct 21, 2021
fdbac87
replace velocity if collision point is too close to original path poi…
taikitanaka3 Oct 21, 2021
f6064a5
Fix compile warnings (#1852)
Oct 21, 2021
9b39509
Document / behavior velocity planner (#1767)
taikitanaka3 Oct 21, 2021
e465c0f
fix occlusion spot insert velocity ros2 (#1821)
taikitanaka3 Oct 21, 2021
5f450bf
Fix/current acc initialize (#1899)
satoshi-ota Oct 21, 2021
9a99105
Feature/improve intersection detection area (#1958)
tkimura4 Oct 21, 2021
d8d4486
[behavior_velocity_planner] remove unnecessary graph search to reduce…
TakaHoribe Aug 29, 2021
beba5cb
sort sidewalk slice by arc length (#1967)
taikitanaka3 Aug 30, 2021
a655319
Fix/merge from private area (#2005)
tkimura4 Sep 2, 2021
560d09a
Feature/intersection module detect obstacle (#1990)
tkimura4 Sep 2, 2021
718ae0a
occlusion spot lower min ego velocity (#2140)
taikitanaka3 Sep 29, 2021
986ffcb
add behavior velocity planner utils (#2113)
taikitanaka3 Oct 1, 2021
145bedb
use interpolation::slerp (#2161)
takayuki5168 Oct 4, 2021
cbed845
Update traffic light state if ref stop point is ahead of previous one…
tier4-autoware-private-bot[bot] Oct 17, 2021
3918b12
Change formatter to clang-format and black (#2332)
kenji-miyake Nov 2, 2021
d64fe79
Add COLCON_IGNORE (#500)
kenji-miyake Nov 4, 2021
c4843a6
rename topic name twist -> odometry (#568)
takayuki5168 Nov 10, 2021
93584ab
Auto/behavior velocity (#605)
takayuki5168 Nov 15, 2021
07e751e
Sync .auto branch with the latest branch in internal repository (#691)
wep21 Nov 18, 2021
083d68e
fix include (#710)
taikitanaka3 Nov 22, 2021
2343b21
use original path for calcSlowDownPoints (#723)
tkimura4 Nov 24, 2021
f1c6bac
fix traffic signal judge (#724)
tkimura4 Nov 24, 2021
6d4e268
Auto/separate readme behavior velocity (#730)
taikitanaka3 Nov 25, 2021
e63d69a
Fix no ground pointcloud topic name (#733)
wep21 Nov 25, 2021
59f1696
fix/rename segmentation namespace (#742)
satoshi-ota Nov 29, 2021
2afc791
Merge branch 'tier4/proposal' into 1-add-behavior-velocity-planner
1222-takeshi Dec 4, 2021
6d683cd
Merge branch 'tier4/proposal' into 1-add-behavior-velocity-planner
1222-takeshi Dec 6, 2021
fdb88dc
Merge branch 'tier4/proposal' into 1-add-behavior-velocity-planner
1222-takeshi Dec 6, 2021
3ef9755
Merge branch 'tier4/proposal' into 1-add-behavior-velocity-planner
1222-takeshi Dec 7, 2021
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
Prev Previous commit
Next Next commit
Feature/porting occlusion spot (#1740)
* Feature/occlusion_spot safety planner public road (#1594)

* add blind spot safety planner public road

* remove duplicated procesing

* remove unused private param

* renaming fix typo add comments

* fix spell check

* velocity -> relative velocity

* calc2d, To param, simplify search, To original

* add the num possible collision gurd

* computational cost reduction

* Cosmetic change for PossibleCollisionInfo

* add interpolation to possible collision value

* refactor codes

* fix details

* invalid point gurd

* To Param

* refacotor to occlusion spot util

* cosmetic change

* clean up blindspot

* To Occlusion Spot

* revise readme

* refactor drawing

* for better explanation

* fix velocity profile

* clean up details

* cosmetic change for debug marker

* use max velocity in obstacle info instead

* add gtest for Too Many Possible Collision case

* change case

* refactor readme

* minor fix

* add more occlusion spot explanation

* replace svg

* add gtest build path lanelet

* hotfix lateral distance and searching method

* update g test for lateral distance

* use faster search

* set more realistic param

* add lanelet subtype highway

* cosmetic change of reviews

* add occlusion spot module in private area (#1640)

* add occlusion spot in private

* For debugging change

* add spline interpolation to path

* add review changes

* adding minor change

* cosmetic change

* Vector to retval

* Blindspot To OcclusionSpot1

* To Occlusion Spot 2

* To Occlusions spot3

* update gtest with unified anchor

* remove anchor

* add test slice

* simplify interpolation

* Too Occlusion spot4

* add test buffer

* To Occlusion spot

* namespace gurd

* correct slice and add interpolation first

* handle self crossing with check for invation

* to ros debug stream

* removed unused interpolation

* add readme to plant uml

* cosmetic change

* minor change

* update readme

* review change

* change occlusion spot text color

* To Offset no Throw

* better debug marker

* catch only inversion error

* skip return in case of inversion

* for better grid

* simplify path lanelet at first

* remove std::cout

* for better path

* limit ego path inside target lanelet location

* remove last points

* cosmetic change for markers

* apply module for limited scene

* fix interpolation gurd

* for better params

* do not includes path behind

* remove dummy perception publisher

* Revert "remove dummy perception publisher"

This reverts commit 4acad985fe31dd9befaa21a16631495de6c3a117.

* replace hard coded occupancy grid option in psim

* remove respawn

* add arg to params and remove redundunt launch

* fix spell check

* fix default value

Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>

* Feature/occlusion spot private slice size param (#1703)

* add min slice size

* for a bit narrow lateral distance

* Update planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/config/occlusion_spot_param.yaml

Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>

Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>

* Rename files

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Porting to ros2

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* pre-commit fixes

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Fix typo

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Fix launch namespace

Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>

* Fix parameter type

Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>

* Update planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/src/scene_module/occlusion_spot/scene_occlusion_spot_in_private_road.cpp

Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>

Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com>
Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>
Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>
  • Loading branch information
4 people committed Nov 30, 2021
commit fb4331efdc91cbae489449ec111be5e285bb3147
43 changes: 43 additions & 0 deletions planning/behavior_velocity_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ find_package(Boost REQUIRED)
find_package(eigen3_cmake_module REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(PCL REQUIRED COMPONENTS common)
find_package(OpenCV REQUIRED)

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
Expand All @@ -42,6 +43,8 @@ set(BEHAVIOR_VELOCITY_PLANNER_DEPENDENCIES
tf2_ros
vehicle_info_util
visualization_msgs
nav_msgs
grid_map_ros
)


Expand Down Expand Up @@ -191,6 +194,28 @@ ament_target_dependencies(scene_module_virtual_traffic_light ${BEHAVIOR_VELOCITY
target_link_libraries(scene_module_virtual_traffic_light scene_module_lib)


# SceneModule OcclusionSpot
ament_auto_add_library(scene_module_occlusion_spot SHARED
src/scene_module/occlusion_spot/grid_utils.cpp
src/scene_module/occlusion_spot/geometry.cpp
src/scene_module/occlusion_spot/manager.cpp
src/scene_module/occlusion_spot/debug.cpp
src/scene_module/occlusion_spot/scene_occlusion_spot_in_public_road.cpp
src/scene_module/occlusion_spot/scene_occlusion_spot_in_private_road.cpp
src/scene_module/occlusion_spot/occlusion_spot_utils.cpp
src/scene_module/occlusion_spot/risk_predictive_braking.cpp
)

target_include_directories(scene_module_occlusion_spot
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

ament_target_dependencies(scene_module_occlusion_spot ${BEHAVIOR_VELOCITY_PLANNER_DEPENDENCIES})

target_link_libraries(scene_module_occlusion_spot scene_module_lib)

# Scene Module Manager
ament_auto_add_library(scene_module_manager SHARED
src/planner_manager.cpp
Expand Down Expand Up @@ -227,6 +252,7 @@ target_link_libraries(behavior_velocity_planner
scene_module_intersection
scene_module_traffic_light
scene_module_blind_spot
scene_module_occlusion_spot
scene_module_detection_area
scene_module_virtual_traffic_light
scene_module_manager
Expand All @@ -242,6 +268,23 @@ rclcpp_components_register_node(behavior_velocity_planner
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()

ament_add_gtest(occlusion_spot-test
test/src/utils.hpp
test/src/test_occlusion_spot_utils.cpp
test/src/test_risk_predictive_braking.cpp
test/src/test_geometry.cpp
test/src/test_grid_utils.cpp
test/src/test_performances.cpp
src/scene_module/occlusion_spot/geometry.cpp
src/scene_module/occlusion_spot/grid_utils.cpp
src/scene_module/occlusion_spot/occlusion_spot_utils.cpp
src/scene_module/occlusion_spot/risk_predictive_braking.cpp
)
target_link_libraries(occlusion_spot-test
gtest_main
scene_module_occlusion_spot
)
endif()

ament_auto_package(INSTALL_TO_SHARE
Expand Down
83 changes: 83 additions & 0 deletions planning/behavior_velocity_planner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ It consists of several modules.
- Intersection
- Stop Line
- Traffic Light
- Occlusion Spot

When each module plans velocity, it considers based on `base_link`(center of rear-wheel axis) pose.
So for example, in order to stop at a stop line with the vehicles' front on the stop line, it calculates `base_link` position from the distance between `base_link` to front and modifies path velocity from the `base_link` position.
Expand Down Expand Up @@ -45,6 +46,7 @@ So for example, in order to stop at a stop line with the vehicles' front on the
| `launch_intersection` | bool | whether to launch intersection module |
| `launch_traffic_light` | bool | whether to launch traffic light module |
| `launch_stop_line` | bool | whether to launch stop_line module |
| `launch_occlusion_spot` | bool | whether to launch occlusion_spot module |
| `forward_path_length` | double | forward path length |
| `backward_path_length` | double | backward path length |
| `max_accel` | double | (to be a global parameter) max acceleration of the vehicle |
Expand Down Expand Up @@ -126,3 +128,84 @@ Then, we can get `offset segment` and `offset from segment start`.
After that, we can calculate a offset point from `offset segment` and `offset`. This will be `stop_pose`.

![calculate_stop_pose](./docs/stop_line/calculate_stop_pose.drawio.svg)

### Occlusion Spot

#### Role

This module plans safe velocity to slow down before reaching collision point that hidden object is darting out from `occlusion spot` where driver can't see clearly because of obstacles.

![brief](./docs/occlusion_spot/occlusion_spot.svg)

### Occlusion Spot Private

This module only works in private road and use occupancy grid map to detect occlusion spots.

### Occlusion Spot Public

This module only works in public road and use dynamic objects to detect occlusion spots.

#### Module Parameters

| Parameter | Type | Description |
| -------------------- | ------ | ------------------------------------------------------------------------- |
| `pedestrian_vel` | double | [m/s] maximum velocity assumed pedestrian coming out from occlusion point |
| `safety_time_buffer` | double | [m/s] time buffer for the system delay |

| Parameter /threshold | Type | Description |
| ------------------------- | ------ | --------------------------------------------------------- |
| `detection_area_length`  | double | [m] the length of path to consider occlusion spot |
| `stuck_vehicle_vel` | double | [m/s] velocity below this value is assumed to stop |
| `lateral_distance` | double | [m] maximum lateral distance to consider hidden collision |

| Parameter /(public or private)\_road | Type | Description |
| ------------------------------------ | ------ | -------------------------------------------------------------------- |
| `min_velocity` | double | [m/s] minimum velocity to ignore occlusion spot |
| `ebs_decel` | double | [m/s^2] maximum deceleration to assume for emergency braking system. |
| `pbs_decel` | double | [m/s^2] deceleration to assume for predictive braking system |

| Parameter /sidewalk | Type | Description |
| ------------------------- | ------ | --------------------------------------------------------------- |
| `min_occlusion_spot_size` | double | [m] the length of path to consider occlusion spot |
| `focus_range` | double | [m] buffer around the ego path used to build the sidewalk area. |

| Parameter /grid | Type | Description |
| ---------------- | ------ | --------------------------------------------------------------- |
| `free_space_max` | double | [-] maximum value of a free space cell in the occupancy grid |
| `occupied_min` | double | [-] buffer around the ego path used to build the sidewalk area. |

#### Flowchart

```plantuml
@startuml
title modifyPathVelocity (Private/Public) Road
start

:get current road type;

if (road type is PUBLIC) then (yes)
:use dynamic object array info;
else if (road type is PRIVATE) then (yes)
:use occupancy grid map info;
else (no)
stop
endif

:generate possible collision;

:find possible collision between path and occlusion spot;

if (possible collision is found?) then (yes)
else (no)
stop
endif

:calculate collision path point;

:calculate safe velocity consider lateral distance and safe velocity;

:insertSafeVelocityToPath;

stop
@enduml
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**:
ros__parameters:
occlusion_spot:
pedestrian_vel: 1.0 # [m/s] assume pedestrian is dashing from occlusion at this velocity
safety_time_buffer: 0.1 # [m/s] assume pedestrian is dashing from occlusion at this velocity
threshold:
detection_area_length: 200.0 # [m] the length of path to consider occlusion spot
stuck_vehicle_vel: 1.0 # [m/s] velocity below this value is assumed to stop
lateral_distance: 1.5 # [m] maximum lateral distance to consider hidden collision
# road type parameters
public_road:
min_velocity: 5.0 # [m/s] minimum velocity to ignore occlusion spot
ebs_decel: -6.0 # [m/s^2] maximum deceleration to assume for emergency stops.
pbs_decel: -0.5 # [m/s^2] deceleration to assume for predictive braking stops
private_road:
min_velocity: 1.5 # [m/s] minimum velocity to ignore occlusion spot
ebs_decel: -4.0 # [m/s^2] maximum deceleration to assume for emergency stops.
pbs_decel: -0.5 # [m/s^2] deceleration to assume for predictive braking stops.
sidewalk:
min_occlusion_spot_size: 1.5 # [m] occupancy grid must contain an UNKNOWN area of at least size NxN to be considered a hidden obstacle.
slice_size: 0.5 # [m] size of sidewalk slices in both length and distance relative to the ego trajectory.
focus_range: 1.5 # [m] buffer around the ego path used to build the sidewalk area.
grid:
free_space_max: 40 # maximum value of a free space cell in the occupancy grid
occupied_min: 60 # minimum value of an occupied cell in the occupancy grid
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "autoware_perception_msgs/msg/dynamic_object_array.hpp"
#include "autoware_planning_msgs/msg/path.hpp"
#include "autoware_planning_msgs/msg/path_with_lane_id.hpp"
#include "nav_msgs/msg/occupancy_grid.hpp"
#include "rclcpp/rclcpp.hpp"
#include "sensor_msgs/msg/point_cloud2.hpp"

Expand Down Expand Up @@ -63,6 +64,8 @@ class BehaviorVelocityPlannerNode : public rclcpp::Node
sub_external_traffic_light_states_;
rclcpp::Subscription<autoware_v2x_msgs::msg::VirtualTrafficLightStateArray>::SharedPtr
sub_virtual_traffic_light_states_;
rclcpp::Subscription<nav_msgs::msg::OccupancyGrid>::SharedPtr
sub_occupancy_grid_;

void onTrigger(const autoware_planning_msgs::msg::PathWithLaneId::ConstSharedPtr input_path_msg);
void onDynamicObjects(
Expand All @@ -79,6 +82,7 @@ class BehaviorVelocityPlannerNode : public rclcpp::Node
const autoware_api_msgs::msg::IntersectionStatus::ConstSharedPtr msg);
void onVirtualTrafficLightStates(
const autoware_v2x_msgs::msg::VirtualTrafficLightStateArray::ConstSharedPtr msg);
void onOccupancyGrid(const nav_msgs::msg::OccupancyGrid::ConstSharedPtr msg);

// publisher
rclcpp::Publisher<autoware_planning_msgs::msg::Path>::SharedPtr path_pub_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "autoware_v2x_msgs/msg/virtual_traffic_light_state_array.hpp"
#include "geometry_msgs/msg/pose_stamped.hpp"
#include "geometry_msgs/msg/twist_stamped.hpp"
#include "nav_msgs/msg/occupancy_grid.hpp"
#include "sensor_msgs/msg/point_cloud2.hpp"
#include "std_msgs/msg/header.hpp"
#include "vehicle_info_util/vehicle_info_util.hpp"
Expand Down Expand Up @@ -70,6 +71,8 @@ struct PlannerData
autoware_perception_msgs::msg::DynamicObjectArray::ConstSharedPtr dynamic_objects;
pcl::PointCloud<pcl::PointXYZ>::ConstPtr no_ground_pointcloud;
lanelet::LaneletMapPtr lanelet_map;
// occupancy grid
nav_msgs::msg::OccupancyGrid::ConstSharedPtr occupancy_grid;

// other internal data
std::map<int, autoware_perception_msgs::msg::TrafficLightStateStamped> traffic_light_id_map;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright 2021 Tier IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SCENE_MODULE__OCCLUSION_SPOT__GEOMETRY_HPP_
#define SCENE_MODULE__OCCLUSION_SPOT__GEOMETRY_HPP_

#include <vector>

#include "boost/geometry.hpp"
#include "lanelet2_core/geometry/Lanelet.h"
#include "lanelet2_core/geometry/Point.h"

namespace behavior_velocity_planner
{
namespace geometry
{
namespace bg = boost::geometry;

// @brief represent the range of a slice
// (either by index on the lanelet centerline or by arc coordinates)
struct SliceRange
{
double min_length{};
double max_length{};
double min_distance{};
double max_distance{};
};

// @brief representation of a slice along a path
struct Slice
{
SliceRange range{};
lanelet::BasicPolygon2d polygon{};
};

//!< @brief build slices all along the trajectory
// using the given range and desired slice length and width
void buildSlices(
std::vector<Slice> & slices, const lanelet::ConstLanelet & path_lanelet,
const SliceRange & range, const double slice_length, const double slice_width);
//!< @brief build an interpolated polygon between the given bounds
void buildInterpolatedPolygon(
lanelet::BasicPolygon2d & polygons, const lanelet::BasicLineString2d & from_bound,
const lanelet::BasicLineString2d & to_bound, const double from_length, const double to_length,
const double from_ratio_dist, const double to_ratio_dist);
//!< @brief build sidewalk slice from path
std::vector<geometry::Slice> buildSidewalkSlices(
const lanelet::ConstLanelet & path_lanelet, const double longitudinal_offset,
const double lateral_offset, const double min_size, const double lateral_max_dist);
//!< @brief calculate interpolation between a and b at distance ratio t
template<typename T>
T lerp(T a, T b, double t)
{
return a + t * (b - a);
}

} // namespace geometry
} // namespace behavior_velocity_planner

#endif // SCENE_MODULE__OCCLUSION_SPOT__GEOMETRY_HPP_
Loading