Apollo planning 模塊(三):path decider
lane follow場景為例,包含一個stage,每個stage又包含若干個task。在路徑決策方面,依次進行lane_change_decider、path_reuse_decider、path_lane_borrow_decider、path_bounds_decider。在路徑優化方面,依次進行piecewise_jerk_path_optimizer、path_assessment_decider、path_decider。

1.lane_change_decider
2.path_reuse_decider
3.path_lane_borrow_decider
Status PathLaneBorrowDecider::Process( Frame* const frame, ReferenceLineInfo* const reference_line_info) { // Sanity checks. CHECK_NOTNULL(frame); CHECK_NOTNULL(reference_line_info); // skip path_lane_borrow_decider if reused path if (FLAGS_enable_skip_path_tasks && reference_line_info->path_reusable()) { // for debug AINFO << "skip due to reusing path"; return Status::OK(); } // By default, don't borrow any lane. reference_line_info->set_is_path_lane_borrow(false); // Check if lane-borrowing is needed, if so, borrow lane. if (Decider::config_.path_lane_borrow_decider_config() .allow_lane_borrowing() && IsNecessaryToBorrowLane(*frame, *reference_line_info)) { reference_line_info->set_is_path_lane_borrow(true); } return Status::OK(); }
bool PathLaneBorrowDecider::IsNecessaryToBorrowLane( const Frame& frame, const ReferenceLineInfo& reference_line_info) { auto* mutable_path_decider_status = injector_->planning_context() ->mutable_planning_status() ->mutable_path_decider(); if (mutable_path_decider_status->is_in_path_lane_borrow_scenario()) { // If originally borrowing neighbor lane: if (mutable_path_decider_status->able_to_use_self_lane_counter() >= 6) { // If have been able to use self-lane for some time, then switch to // non-lane-borrowing. mutable_path_decider_status->set_is_in_path_lane_borrow_scenario(false); mutable_path_decider_status->clear_decided_side_pass_direction(); AINFO << "Switch from LANE-BORROW path to SELF-LANE path."; } } else { // If originally not borrowing neighbor lane: ADEBUG << "Blocking obstacle ID[" << mutable_path_decider_status->front_static_obstacle_id() << "]"; // ADC requirements check for lane-borrowing: if (!HasSingleReferenceLine(frame)) { return false; } //車速降低到規定車速值以下才允許借道:默認值 5 (單位:m/s或km/h???) if (!IsWithinSidePassingSpeedADC(frame)) { return false; } // Obstacle condition check for lane-borrowing:遮擋的障礙遠離路口才允許借道,否則可能導致在路口時無法駛入正確車道 if (!IsBlockingObstacleFarFromIntersection(reference_line_info)) { return false; } //是否長期阻擋車道:默認值3秒 if (!IsLongTermBlockingObstacle()) { return false; } //障礙物與目標點距離是否小于一定值??? if (!IsBlockingObstacleWithinDestination(reference_line_info)) { return false; } //是否為可超越車輛:救護車、警車不可超越 if (!IsSidePassableObstacle(reference_line_info)) { return false; } // switch to lane-borrowing // set side-pass direction const auto& path_decider_status = injector_->planning_context()->planning_status().path_decider(); if (path_decider_status.decided_side_pass_direction().empty()) { // first time init decided_side_pass_direction bool left_borrowable; bool right_borrowable; //根據當前車道左右車道線的類型,檢車左右車道是否可以借道(SOLID_YELLOW或者SOLID_WHITE不可以換道) CheckLaneBorrow(reference_line_info, &left_borrowable, &right_borrowable); if (!left_borrowable && !right_borrowable) { mutable_path_decider_status->set_is_in_path_lane_borrow_scenario(false); return false; } else { mutable_path_decider_status->set_is_in_path_lane_borrow_scenario(true); if (left_borrowable) { mutable_path_decider_status->add_decided_side_pass_direction( PathDeciderStatus::LEFT_BORROW); } if (right_borrowable) { mutable_path_decider_status->add_decided_side_pass_direction( PathDeciderStatus::RIGHT_BORROW); } } } AINFO << "Switch from SELF-LANE path to LANE-BORROW path."; } return mutable_path_decider_status->is_in_path_lane_borrow_scenario(); }
4.path_bounds_decider

浙公網安備 33010602011771號