From 9137960c0e949799a97acbf4b043c56752dbb7a2 Mon Sep 17 00:00:00 2001 From: Shu Jiang Date: Fri, 28 Aug 2020 17:29:30 -0700 Subject: [PATCH] Planning: disable extending path bounds to include adc in the hybrid scenario --- .../scenario/lane_follow_hybrid_config.pb.txt | 1 + modules/planning/proto/task_config.proto | 1 + .../path_bounds_decider.cc | 36 ++++++++++++------- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/modules/planning/conf/scenario/lane_follow_hybrid_config.pb.txt b/modules/planning/conf/scenario/lane_follow_hybrid_config.pb.txt index 3a9e48ac5f..52fd4dd430 100644 --- a/modules/planning/conf/scenario/lane_follow_hybrid_config.pb.txt +++ b/modules/planning/conf/scenario/lane_follow_hybrid_config.pb.txt @@ -58,6 +58,7 @@ stage_config: { task_type: PATH_BOUNDS_DECIDER path_bounds_decider_config { adc_buffer_coeff: 0.0 + is_extend_lane_bands_to_include_adc: false } } task_config: { diff --git a/modules/planning/proto/task_config.proto b/modules/planning/proto/task_config.proto index 181274a21a..c75b85ff5e 100644 --- a/modules/planning/proto/task_config.proto +++ b/modules/planning/proto/task_config.proto @@ -152,6 +152,7 @@ message PathBoundsDeciderConfig { optional double pull_over_approach_lon_distance_adjust_factor = 6 [default = 1.5]; optional double adc_buffer_coeff = 7 [default = 1.0]; + optional bool is_extend_lane_bands_to_include_adc = 8 [default = true]; } ////////////////////////////////// diff --git a/modules/planning/tasks/deciders/path_bounds_decider/path_bounds_decider.cc b/modules/planning/tasks/deciders/path_bounds_decider/path_bounds_decider.cc index 0deb14f300..589333b970 100644 --- a/modules/planning/tasks/deciders/path_bounds_decider/path_bounds_decider.cc +++ b/modules/planning/tasks/deciders/path_bounds_decider/path_bounds_decider.cc @@ -1181,24 +1181,36 @@ bool PathBoundsDecider::GetBoundaryFromLanesAndADC( curr_lane_left_width + (lane_borrow_info == LaneBorrowInfo::LEFT_BORROW ? curr_neighbor_lane_width : 0.0); - double curr_left_bound_adc = - std::fmax(adc_l_to_lane_center_, - adc_l_to_lane_center_ + ADC_speed_buffer) + - GetBufferBetweenADCCenterAndEdge() + ADC_buffer; - double curr_left_bound = - std::fmax(curr_left_bound_lane, curr_left_bound_adc) - offset_to_map; double curr_right_bound_lane = -curr_lane_right_width - (lane_borrow_info == LaneBorrowInfo::RIGHT_BORROW ? curr_neighbor_lane_width : 0.0); - double curr_right_bound_adc = - std::fmin(adc_l_to_lane_center_, - adc_l_to_lane_center_ + ADC_speed_buffer) - - GetBufferBetweenADCCenterAndEdge() - ADC_buffer; - double curr_right_bound = - std::fmin(curr_right_bound_lane, curr_right_bound_adc) - offset_to_map; + + double curr_left_bound = 0.0; + double curr_right_bound = 0.0; + + if (config_.path_bounds_decider_config() + .is_extend_lane_bands_to_include_adc()) { + double curr_left_bound_adc = + std::fmax(adc_l_to_lane_center_, + adc_l_to_lane_center_ + ADC_speed_buffer) + + GetBufferBetweenADCCenterAndEdge() + ADC_buffer; + curr_left_bound = + std::fmax(curr_left_bound_lane, curr_left_bound_adc) - offset_to_map; + + double curr_right_bound_adc = + std::fmin(adc_l_to_lane_center_, + adc_l_to_lane_center_ + ADC_speed_buffer) - + GetBufferBetweenADCCenterAndEdge() - ADC_buffer; + curr_right_bound = + std::fmin(curr_right_bound_lane, curr_right_bound_adc) - + offset_to_map; + } else { + curr_left_bound = curr_left_bound_lane - offset_to_map; + curr_right_bound = curr_right_bound_lane - offset_to_map; + } ADEBUG << "At s = " << curr_s << ", left_lane_bound = " << curr_lane_left_width -- GitLab