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 3a9e48ac5f05f5a7ea56c286b1ed1de7179ad19c..52fd4dd43021743e4a4a8184beecd08ca591ce11 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 181274a21aa74d1fbba41b1c3964cb64acd1289c..c75b85ff5e52dd9ba76ae451b8ff3a21174395a7 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 0deb14f300da6d4f52430156e38579b6962e2b04..589333b9704a3c0c157213952b472d2c47aead84 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