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(dynamic_avoidance): avoid oncoming vehicles #3584

Conversation

takayuki5168
Copy link
Contributor

@takayuki5168 takayuki5168 commented Apr 28, 2023

Description

With this PR, oncoming vehicles can be avoided as follows.
NOTE: The parameters are tuned for the video to show how this works easily to understand.
Screencast from 2023年04月29日 00時58分05秒.webm

When testing like the above movie,

$ git diff
diff --git a/planning/behavior_path_planner/CMakeLists.txt b/planning/behavior_path_planner/CMakeLists.txt
index 78383f6146..710f287175 100644
--- a/planning/behavior_path_planner/CMakeLists.txt
+++ b/planning/behavior_path_planner/CMakeLists.txt
@@ -7,7 +7,7 @@ autoware_package()
 find_package(OpenCV REQUIRED)
 find_package(magic_enum CONFIG REQUIRED)
 
-set(COMPILE_WITH_OLD_ARCHITECTURE TRUE)
+set(COMPILE_WITH_OLD_ARCHITECTURE FALSE)
 
 set(common_src
   src/steering_factor_interface.cpp
  • add change in autoware_launch
$ git diff
diff --git a/autoware_launch/config/control/trajectory_follower/lateral/mpc.param.yaml b/autoware_launch/config/control/trajectory_follower/lateral/mpc.param.yaml
index 400bc926..0bd5f74f 100644
--- a/autoware_launch/config/control/trajectory_follower/lateral/mpc.param.yaml
+++ b/autoware_launch/config/control/trajectory_follower/lateral/mpc.param.yaml
@@ -19,12 +19,12 @@
     qp_solver_type: "osqp"                       # optimization solver option (unconstraint_fast or osqp)
     mpc_prediction_horizon: 50                   # prediction horizon step
     mpc_prediction_dt: 0.1                       # prediction horizon period [s]
-    mpc_weight_lat_error: 0.1                    # lateral error weight in matrix Q
+    mpc_weight_lat_error: 1.0                    # lateral error weight in matrix Q
     mpc_weight_heading_error: 0.0                # heading error weight in matrix Q
     mpc_weight_heading_error_squared_vel: 0.3    # heading error * velocity weight in matrix Q
     mpc_weight_steering_input: 1.0               # steering error weight in matrix R
     mpc_weight_steering_input_squared_vel: 0.25  # steering error * velocity weight in matrix R
-    mpc_weight_lat_jerk: 0.0                     # lateral jerk weight in matrix R
+    mpc_weight_lat_jerk: 0.1                     # lateral jerk weight in matrix R
     mpc_weight_steer_rate: 0.0                   # steering rate weight in matrix R
     mpc_weight_steer_acc: 0.000001               # steering angular acceleration weight in matrix R
     mpc_low_curvature_weight_lat_error: 0.1                    # lateral error weight in matrix Q in low curvature point
diff --git a/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/dynamic_avoidance/dynamic_avoidance.param.yaml b/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/dynamic_avoidance/dynamic_avoidance.param.yaml
index 6d19b619..c26cfaa2 100644
--- a/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/dynamic_avoidance/dynamic_avoidance.param.yaml
+++ b/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/dynamic_avoidance/dynamic_avoidance.param.yaml
@@ -15,7 +15,7 @@
         min_obstacle_vel: 1.0 # [m/s]
 
       drivable_area_generation:
-        lat_offset_from_obstacle: 0.8 # [m]
+        lat_offset_from_obstacle: 2.0 # [m]
         time_to_avoid_same_directional_object: 5.0 # [s]
         time_to_avoid_opposite_directional_object: 6.0 # [s]
-        max_lat_offset_to_avoid: 0.5 # [m]
+        max_lat_offset_to_avoid: 2.0 # [m]
diff --git a/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/scene_module_manager.param.yaml b/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/scene_module_manager.param.yaml
index 32da47b1..11aacd9e 100644
--- a/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/scene_module_manager.param.yaml
+++ b/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/scene_module_manager.param.yaml
@@ -53,7 +53,7 @@
       max_module_size: 1
 
     avoidance:
-      enable_module: true
+      enable_module: false
       enable_simultaneous_execution_as_approved_module: true
       enable_simultaneous_execution_as_candidate_module: false
       priority: 4
@@ -66,9 +66,8 @@
       enable_simultaneous_execution_as_candidate_module: false
       priority: 3
       max_module_size: 1
-
     dynamic_avoidance:
-      enable_module: false
+      enable_module: true
       enable_simultaneous_execution_as_approved_module: true
       enable_simultaneous_execution_as_candidate_module: true
       priority: 7
diff --git a/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/rtc_auto_mode_manager/rtc_auto_mode_manager.param.yaml b/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/rtc_auto_mode_manager/rtc_auto_mode_manager.param.yaml
index af82a346..c752f6cb 100644
--- a/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/rtc_auto_mode_manager/rtc_auto_mode_manager.param.yaml
+++ b/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/rtc_auto_mode_manager/rtc_auto_mode_manager.param.yaml
@@ -7,12 +7,10 @@
       - "intersection"
       - "no_stopping_area"
       - "traffic_light"
-      - "external_request_lane_change_left"
-      - "external_request_lane_change_right"
       - "lane_change_left"
       - "lane_change_right"
-      - "avoidance_left"
-      - "avoidance_right"
+      # - "avoidance_left"
+      # - "avoidance_right"
       - "goal_planner"
       - "pull_out"
       - "intersection_occlusion"
@@ -26,8 +24,8 @@
       - "traffic_light"
       - "lane_change_left"
       - "lane_change_right"
-      - "avoidance_left"
-      - "avoidance_right"
+      # - "avoidance_left"
+      # - "avoidance_right"
       - "goal_planner"
       - "pull_out"
       - "intersection_occlusion"
diff --git a/autoware_launch/config/planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner/obstacle_avoidance_planner.param.yaml b/autoware_launch/config/planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner/obstacle_avoidance_planner.param.yaml
index 01a8dfb4..420f3556 100644
--- a/autoware_launch/config/planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner/obstacle_avoidance_planner.param.yaml
+++ b/autoware_launch/config/planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner/obstacle_avoidance_planner.param.yaml
@@ -4,7 +4,7 @@
       enable_smoothing: true                                       # enable path smoothing by elastic band
       enable_skip_optimization: false                              # skip elastic band and model predictive trajectory
       enable_reset_prev_optimization: false                        # If true, optimization has no fix constraint to the previous result.
-      enable_outside_drivable_area_stop: true                      # stop if the ego's trajectory footprint is outside the drivable area
+      enable_outside_drivable_area_stop: false                     # stop if the ego's trajectory footprint is outside the drivable area
       use_footprint_polygon_for_outside_drivable_area_check: false # If false, only the footprint's corner points are considered.
 
       debug:
diff --git a/autoware_launch/rviz/autoware.rviz b/autoware_launch/rviz/autoware.rviz
index cdc4da53..d7e76f6c 100644

launcher PR: autowarefoundation/autoware_launch#335

Tests performed

planning simulator

Effects on system behavior

Can avoid oncoming vehicles when dynamic avoidance is set to True.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:planning Route planning, decision-making, and navigation. (auto-assigned) labels Apr 28, 2023
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
@codecov
Copy link

codecov bot commented Apr 28, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (24bce1e) 14.09% compared to head (1ad48b0) 14.09%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3584      +/-   ##
==========================================
- Coverage   14.09%   14.09%   -0.01%     
==========================================
  Files        1396     1396              
  Lines       97972    97976       +4     
  Branches    29077    29079       +2     
==========================================
  Hits        13808    13808              
- Misses      69500    69501       +1     
- Partials    14664    14667       +3     
Flag Coverage Δ *Carryforward flag
differential 15.41% <0.00%> (?)
total 14.09% <ø> (+<0.01%) ⬆️ Carriedforward from 24bce1e

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
...ule/dynamic_avoidance/dynamic_avoidance_module.hpp 0.00% <ø> (ø)
...or_path_planner/src/behavior_path_planner_node.cpp 19.87% <0.00%> (-0.08%) ⬇️
...ule/dynamic_avoidance/dynamic_avoidance_module.cpp 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@takayuki5168 takayuki5168 merged commit a98fd6c into autowarefoundation:main Apr 30, 2023
@takayuki5168 takayuki5168 deleted the feat/dynamic-avoidance-against-oncomming-vehicle branch April 30, 2023 07:23
Mingyu1991 pushed a commit to Mingyu1991/autoware.universe that referenced this pull request Jun 26, 2023
…3584)

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Mingyu Li <mingyu.li@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants