国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER

這篇具有很好參考價(jià)值的文章主要介紹了【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

TASK系列解析文章

1.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之LANE_CHANGE_DECIDER
2.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PATH_REUSE_DECIDER
3.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PATH_BORROW_DECIDER
4.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PATH_BOUNDS_DECIDER
5.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PIECEWISE_JERK_PATH_OPTIMIZER
6.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PATH_ASSESSMENT_DECIDER
7.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PATH_DECIDER
8.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER
9.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之SPEED_BOUNDS_PRIORI_DECIDER&&SPEED_BOUNDS_FINAL_DECIDER
10.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之SPEED_HEURISTIC_OPTIMIZER
11.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之SPEED_DECIDER
12.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PIECEWISE_JERK_SPEED_OPTIMIZER
13.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PIECEWISE_JERK_NONLINEAR_SPEED_OPTIMIZER(一)
14.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PIECEWISE_JERK_NONLINEAR_SPEED_OPTIMIZER(二)

前言

在Apollo星火計(jì)劃學(xué)習(xí)筆記——Apollo路徑規(guī)劃算法原理與實(shí)踐與【Apollo學(xué)習(xí)筆記】——Planning模塊講到……Stage::Process的PlanOnReferenceLine函數(shù)會依次調(diào)用task_list中的TASK,本文將會繼續(xù)以LaneFollow為例依次介紹其中的TASK部分究竟做了哪些工作。由于個(gè)人能力所限,文章可能有紕漏的地方,還請批評斧正。

modules/planning/conf/scenario/lane_follow_config.pb.txt配置文件中,我們可以看到LaneFollow所需要執(zhí)行的所有task。

stage_config: {
  stage_type: LANE_FOLLOW_DEFAULT_STAGE
  enabled: true
  task_type: LANE_CHANGE_DECIDER
  task_type: PATH_REUSE_DECIDER
  task_type: PATH_LANE_BORROW_DECIDER
  task_type: PATH_BOUNDS_DECIDER
  task_type: PIECEWISE_JERK_PATH_OPTIMIZER
  task_type: PATH_ASSESSMENT_DECIDER
  task_type: PATH_DECIDER
  task_type: RULE_BASED_STOP_DECIDER
  task_type: SPEED_BOUNDS_PRIORI_DECIDER
  task_type: SPEED_HEURISTIC_OPTIMIZER
  task_type: SPEED_DECIDER
  task_type: SPEED_BOUNDS_FINAL_DECIDER
  task_type: PIECEWISE_JERK_SPEED_OPTIMIZER
  # task_type: PIECEWISE_JERK_NONLINEAR_SPEED_OPTIMIZER
  task_type: RSS_DECIDER

本文將繼續(xù)介紹LaneFollow的第8個(gè)TASK——RULE_BASED_STOP_DECIDER

基于規(guī)則的停止決策是規(guī)劃模塊的任務(wù),屬于task中的decider類別。基于規(guī)則的停止決策根據(jù)一些規(guī)則來設(shè)置停止標(biāo)志。

RULE_BASED_STOP_DECIDER相關(guān)配置

modules/planning/conf/planning_config.pb.txt

default_task_config: {
  task_type: RULE_BASED_STOP_DECIDER
  rule_based_stop_decider_config {
    max_adc_stop_speed: 0.5
    max_valid_stop_distance: 1.0
    search_beam_length: 20.0
    search_beam_radius_intensity: 0.08
    search_range: 3.14
    is_block_angle_threshold: 0.5
  }
}

modules/planning/proto/task_config.proto

// RuleBasedStopDeciderConfig

message RuleBasedStopDeciderConfig {
  optional double max_adc_stop_speed = 1 [default = 0.3];
  optional double max_valid_stop_distance = 2 [default = 0.5];
  optional double search_beam_length = 3 [default = 5.0];
  optional double search_beam_radius_intensity = 4 [default = 0.08];
  optional double search_range = 5 [default = 3.14];
  optional double is_block_angle_threshold = 6 [default = 1.57];

  optional double approach_distance_for_lane_change = 10 [default = 80.0];
  optional double urgent_distance_for_lane_change = 11 [default = 50.0];
}

RULE_BASED_STOP_DECIDER總體流程

【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER,Apollo,自動(dòng)駕駛,planning,決策規(guī)劃,算法,人工智能,apollo

  • 輸入
    apollo::common::Status RuleBasedStopDecider::Process(Frame *const frame, ReferenceLineInfo *const reference_line_info)
    輸入是frame和reference_line_info。

  • 輸出
    輸出保存到reference_line_info中。

代碼流程及框架
Process中的代碼流程如下圖所示。

【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER,Apollo,自動(dòng)駕駛,planning,決策規(guī)劃,算法,人工智能,apollo

apollo::common::Status RuleBasedStopDecider::Process(
    Frame *const frame, ReferenceLineInfo *const reference_line_info) {
  // 1. Rule_based stop for side pass onto reverse lane
  StopOnSidePass(frame, reference_line_info);

  // 2. Rule_based stop for urgent lane change
  if (FLAGS_enable_lane_change_urgency_checking) {
    CheckLaneChangeUrgency(frame);
  }

  // 3. Rule_based stop at path end position
  AddPathEndStop(frame, reference_line_info);

  return Status::OK();
}

主要核心的函數(shù)就是StopOnSidePass、CheckLaneChangeUrgency以及AddPathEndStop,接著分別對三者進(jìn)行剖析。

StopOnSidePass

【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER,Apollo,自動(dòng)駕駛,planning,決策規(guī)劃,算法,人工智能,apollo
【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER,Apollo,自動(dòng)駕駛,planning,決策規(guī)劃,算法,人工智能,apollo

void RuleBasedStopDecider::StopOnSidePass(
    Frame *const frame, ReferenceLineInfo *const reference_line_info) {
  static bool check_clear;// 默認(rèn)false
  static common::PathPoint change_lane_stop_path_point;
  // 獲取path data
  const PathData &path_data = reference_line_info->path_data();
  double stop_s_on_pathdata = 0.0;
  // 找到"self"類型的路徑,return
  if (path_data.path_label().find("self") != std::string::npos) {
    check_clear = false;
    change_lane_stop_path_point.Clear();
    return;
  }
  // CheckClearDone:Check if needed to check clear again for side pass
  // 如果check_clear為true,且CheckClearDone成功。設(shè)置check_clear為false
  if (check_clear &&
      CheckClearDone(*reference_line_info, change_lane_stop_path_point)) {
    check_clear = false;
  }
  // CheckSidePassStop:Check if necessary to set stop fence used for nonscenario side pass
  // 如果check_clear為false,CheckSidePassStop為true
  if (!check_clear &&
      CheckSidePassStop(path_data, *reference_line_info, &stop_s_on_pathdata)) {
    // 如果障礙物沒有阻塞且可以換道,直接return
    if (!LaneChangeDecider::IsPerceptionBlocked(
            *reference_line_info,
            rule_based_stop_decider_config_.search_beam_length(),
            rule_based_stop_decider_config_.search_beam_radius_intensity(),
            rule_based_stop_decider_config_.search_range(),
            rule_based_stop_decider_config_.is_block_angle_threshold()) &&
        LaneChangeDecider::IsClearToChangeLane(reference_line_info)) {
      return;
    }
    // 檢查adc是否停在了stop fence前,否返回true
    if (!CheckADCStop(path_data, *reference_line_info, stop_s_on_pathdata)) {
      // 設(shè)置stop fence,成功就執(zhí)行 check_clear = true;
      if (!BuildSidePassStopFence(path_data, stop_s_on_pathdata,
                                  &change_lane_stop_path_point, frame,
                                  reference_line_info)) {
        AERROR << "Set side pass stop fail";
      }
    } else {
      if (LaneChangeDecider::IsClearToChangeLane(reference_line_info)) {
        check_clear = true;
      }
    }
  }
}

CheckClearDone

// Check if needed to check clear again for side pass
bool RuleBasedStopDecider::CheckClearDone(
    const ReferenceLineInfo &reference_line_info,
    const common::PathPoint &stop_point) {
  // 獲取ADC的SL坐標(biāo)
  const double adc_front_edge_s = reference_line_info.AdcSlBoundary().end_s();
  const double adc_back_edge_s = reference_line_info.AdcSlBoundary().start_s();
  const double adc_start_l = reference_line_info.AdcSlBoundary().start_l();
  const double adc_end_l = reference_line_info.AdcSlBoundary().end_l();
  double lane_left_width = 0.0;
  double lane_right_width = 0.0;
  reference_line_info.reference_line().GetLaneWidth(
      (adc_front_edge_s + adc_back_edge_s) / 2.0, &lane_left_width,
      &lane_right_width);
  SLPoint stop_sl_point;
  // 獲取停止點(diǎn)的SL坐標(biāo)
  reference_line_info.reference_line().XYToSL(stop_point, &stop_sl_point);
  // use distance to last stop point to determine if needed to check clear
  // again
  if (adc_back_edge_s > stop_sl_point.s()) {
    if (adc_start_l > -lane_right_width || adc_end_l < lane_left_width) {
      return true;
    }
  }
  return false;
}

CheckSidePassStop

// @brief Check if necessary to set stop fence used for nonscenario side pass
bool RuleBasedStopDecider::CheckSidePassStop(
    const PathData &path_data, const ReferenceLineInfo &reference_line_info,
    double *stop_s_on_pathdata) {
  const std::vector<std::tuple<double, PathData::PathPointType, double>>
      &path_point_decision_guide = path_data.path_point_decision_guide();
  // 初始化類型
  PathData::PathPointType last_path_point_type =
      PathData::PathPointType::UNKNOWN;
  // 遍歷 path_point_decision_guide
  for (const auto &point_guide : path_point_decision_guide) {
    // 若上一點(diǎn)在車道內(nèi),這一點(diǎn)在逆行車道上
    if (last_path_point_type == PathData::PathPointType::IN_LANE &&
        std::get<1>(point_guide) ==
            PathData::PathPointType::OUT_ON_REVERSE_LANE) {
      *stop_s_on_pathdata = std::get<0>(point_guide);
      // Approximate the stop fence s based on the vehicle position
      const auto &vehicle_config =
          common::VehicleConfigHelper::Instance()->GetConfig();
      const double ego_front_to_center =
          vehicle_config.vehicle_param().front_edge_to_center();
      common::PathPoint stop_pathpoint;
      // 獲取stop point
      if (!path_data.GetPathPointWithRefS(*stop_s_on_pathdata,
                                          &stop_pathpoint)) {
        AERROR << "Can't get stop point on path data";
        return false;
      }
      const double ego_theta = stop_pathpoint.theta();
      Vec2d shift_vec{ego_front_to_center * std::cos(ego_theta),
                      ego_front_to_center * std::sin(ego_theta)};
      // stop_fence的位置
      const Vec2d stop_fence_pose =
          shift_vec + Vec2d(stop_pathpoint.x(), stop_pathpoint.y());
      double stop_l_on_pathdata = 0.0;
      const auto &nearby_path = reference_line_info.reference_line().map_path();
      nearby_path.GetNearestPoint(stop_fence_pose, stop_s_on_pathdata,
                                  &stop_l_on_pathdata);
      return true;
    }
    last_path_point_type = std::get<1>(point_guide);
  }
  return false;
}

IsPerceptionBlocked

參數(shù)解釋:

search_beam_length 掃描長度
search_beam_radius_intensity 掃描間隔
search_range 依據(jù)ADC中心的掃描范圍
is_block_angle_threshold 篩選障礙物所占角度大小的閾值

bool LaneChangeDecider::IsPerceptionBlocked(
    const ReferenceLineInfo& reference_line_info,
    const double search_beam_length, const double search_beam_radius_intensity,
    const double search_range, const double is_block_angle_threshold) {
  // search_beam_length: 20.0 //is the length of scanning beam
  // search_beam_radius_intensity: 0.08 //is the resolution of scanning
  // search_range: 3.14 	//is the scanning range centering at ADV heading
  // is_block_angle_threshold: 0.5 //is the threshold to tell how big a block angle range is perception blocking
  // 獲取車輛狀態(tài)、位置、航向角
  const auto& vehicle_state = reference_line_info.vehicle_state();
  const common::math::Vec2d adv_pos(vehicle_state.x(), vehicle_state.y());
  const double adv_heading = vehicle_state.heading();
  // 遍歷障礙物
  for (auto* obstacle :
       reference_line_info.path_decision().obstacles().Items()) {
    // NormalizeAngle將給定的角度值規(guī)范化到一個(gè)特定的范圍內(nèi)(-π到π之間)
    double left_most_angle =
        common::math::NormalizeAngle(adv_heading + 0.5 * search_range);
    double right_most_angle =
        common::math::NormalizeAngle(adv_heading - 0.5 * search_range);
    bool right_most_found = false;
    // 跳過虛擬障礙物
    if (obstacle->IsVirtual()) {
      ADEBUG << "skip one virtual obstacle";
      continue;
    }
    // 獲取障礙物多邊形
    const auto& obstacle_polygon = obstacle->PerceptionPolygon();
    // 按角度進(jìn)行搜索
    for (double search_angle = 0.0; search_angle < search_range;
         search_angle += search_beam_radius_intensity) {
      common::math::Vec2d search_beam_end(search_beam_length, 0.0);
      const double beam_heading = common::math::NormalizeAngle(
          adv_heading - 0.5 * search_range + search_angle);
      // search_beam_end繞adv_pos旋轉(zhuǎn)beam_heading角度
      search_beam_end.SelfRotate(beam_heading);
      search_beam_end += adv_pos;
      // 構(gòu)造線段
      common::math::LineSegment2d search_beam(adv_pos, search_beam_end);
      // 判斷最右邊界是否找到,并更新右邊界角度
      if (!right_most_found && obstacle_polygon.HasOverlap(search_beam)) {
        right_most_found = true;
        right_most_angle = beam_heading;
      }
      // 如果最右邊界已找到,且障礙物的感知多邊形與搜索光束無重疊,則更新左邊界角度并跳出循環(huán)。
      if (right_most_found && !obstacle_polygon.HasOverlap(search_beam)) {
        left_most_angle = beam_heading;
        break;
      }
    }
    // 如果最右邊界未找到,則繼續(xù)處理下一個(gè)障礙物。(說明該障礙物不在搜索范圍內(nèi))
    if (!right_most_found) {
      // obstacle is not in search range
      continue;
    }
    // 判斷閾值,過濾掉小的障礙物
    if (std::fabs(common::math::NormalizeAngle(
            left_most_angle - right_most_angle)) > is_block_angle_threshold) {
      return true;
    }
  }

  return false;
}

IsClearToChangeLane

這個(gè)在【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之LANE_CHANGE_DECIDER已經(jīng)有過介紹。

CheckSidePassStop

// @brief Check if necessary to set stop fence used for nonscenario side pass
bool RuleBasedStopDecider::CheckSidePassStop(
    const PathData &path_data, const ReferenceLineInfo &reference_line_info,
    double *stop_s_on_pathdata) {
  const std::vector<std::tuple<double, PathData::PathPointType, double>>
      &path_point_decision_guide = path_data.path_point_decision_guide();
  // 初始化類型
  PathData::PathPointType last_path_point_type =
      PathData::PathPointType::UNKNOWN;
  // 遍歷 path_point_decision_guide
  for (const auto &point_guide : path_point_decision_guide) {
    // 若上一點(diǎn)在車道內(nèi),這一點(diǎn)在逆行車道上
    if (last_path_point_type == PathData::PathPointType::IN_LANE &&
        std::get<1>(point_guide) ==
            PathData::PathPointType::OUT_ON_REVERSE_LANE) {
      *stop_s_on_pathdata = std::get<0>(point_guide);
      // Approximate the stop fence s based on the vehicle position
      const auto &vehicle_config =
          common::VehicleConfigHelper::Instance()->GetConfig();
      const double ego_front_to_center =
          vehicle_config.vehicle_param().front_edge_to_center();
      common::PathPoint stop_pathpoint;
      // 獲取stop point
      if (!path_data.GetPathPointWithRefS(*stop_s_on_pathdata,
                                          &stop_pathpoint)) {
        AERROR << "Can't get stop point on path data";
        return false;
      }
      const double ego_theta = stop_pathpoint.theta();
      Vec2d shift_vec{ego_front_to_center * std::cos(ego_theta),
                      ego_front_to_center * std::sin(ego_theta)};
      // stop_fence的位置
      const Vec2d stop_fence_pose =
          shift_vec + Vec2d(stop_pathpoint.x(), stop_pathpoint.y());
      double stop_l_on_pathdata = 0.0;
      const auto &nearby_path = reference_line_info.reference_line().map_path();
      nearby_path.GetNearestPoint(stop_fence_pose, stop_s_on_pathdata,
                                  &stop_l_on_pathdata);
      return true;
    }
    last_path_point_type = std::get<1>(point_guide);
  }
  return false;
}

BuildStopDecision

/*
 * @brief: build virtual obstacle of stop wall, and add STOP decision
 */
int BuildStopDecision(const std::string& stop_wall_id, const double stop_line_s,
                      const double stop_distance,
                      const StopReasonCode& stop_reason_code,
                      const std::vector<std::string>& wait_for_obstacles,
                      const std::string& decision_tag, Frame* const frame,
                      ReferenceLineInfo* const reference_line_info) {
  CHECK_NOTNULL(frame);
  CHECK_NOTNULL(reference_line_info);

  // 檢查停止線是否在參考線上
  const auto& reference_line = reference_line_info->reference_line();
  if (!WithinBound(0.0, reference_line.Length(), stop_line_s)) {
    AERROR << "stop_line_s[" << stop_line_s << "] is not on reference line";
    return 0;
  }

  // create virtual stop wall
  const auto* obstacle =
      frame->CreateStopObstacle(reference_line_info, stop_wall_id, stop_line_s);
  if (!obstacle) {
    AERROR << "Failed to create obstacle [" << stop_wall_id << "]";
    return -1;
  }
  const Obstacle* stop_wall = reference_line_info->AddObstacle(obstacle);
  if (!stop_wall) {
    AERROR << "Failed to add obstacle[" << stop_wall_id << "]";
    return -1;
  }

  // build stop decision
  const double stop_s = stop_line_s - stop_distance;
  const auto& stop_point = reference_line.GetReferencePoint(stop_s);
  const double stop_heading =
      reference_line.GetReferencePoint(stop_s).heading();

  ObjectDecisionType stop;
  auto* stop_decision = stop.mutable_stop();
  stop_decision->set_reason_code(stop_reason_code);
  stop_decision->set_distance_s(-stop_distance);
  stop_decision->set_stop_heading(stop_heading);
  stop_decision->mutable_stop_point()->set_x(stop_point.x());
  stop_decision->mutable_stop_point()->set_y(stop_point.y());
  stop_decision->mutable_stop_point()->set_z(0.0);

  for (size_t i = 0; i < wait_for_obstacles.size(); ++i) {
    stop_decision->add_wait_for_obstacle(wait_for_obstacles[i]);
  }

  auto* path_decision = reference_line_info->path_decision();
  path_decision->AddLongitudinalDecision(decision_tag, stop_wall->Id(), stop);

  return 0;
}

ELSE:涉及到的一些其他函數(shù)

NormalizeAngle

NormalizeAngle將給定的角度值規(guī)范化到一個(gè)特定的范圍內(nèi)(-π到π之間)

double NormalizeAngle(const double angle) {
  double a = std::fmod(angle + M_PI, 2.0 * M_PI);
  if (a < 0.0) {
    a += (2.0 * M_PI);
  }
  return a - M_PI;
}
SelfRotate

將向量繞原點(diǎn)旋轉(zhuǎn) a n g l e angle angle角。

void Vec2d::SelfRotate(const double angle) {
  double tmp_x = x_;
  x_ = x_ * cos(angle) - y_ * sin(angle);
  y_ = tmp_x * sin(angle) + y_ * cos(angle);
}

CheckLaneChangeUrgency

檢查緊急換道,當(dāng)FLAGS_enable_lane_change_urgency_checking為true時(shí),啟用函數(shù)。
【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER,Apollo,自動(dòng)駕駛,planning,決策規(guī)劃,算法,人工智能,apollo【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER,Apollo,自動(dòng)駕駛,planning,決策規(guī)劃,算法,人工智能,apollo

void RuleBasedStopDecider::CheckLaneChangeUrgency(Frame *const frame) {
  // 直接進(jìn)入循環(huán),檢查每個(gè)reference_line_info
  for (auto &reference_line_info : *frame->mutable_reference_line_info()) {
    // Check if the target lane is blocked or not
    // 1. 檢查目標(biāo)道路是否阻塞,如果在change lane path上,就跳過
    if (reference_line_info.IsChangeLanePath()) {
      is_clear_to_change_lane_ =
          LaneChangeDecider::IsClearToChangeLane(&reference_line_info);
      is_change_lane_planning_succeed_ =
          reference_line_info.Cost() < kStraightForwardLineCost;
      continue;
    }
    // If it's not in lane-change scenario || (target lane is not blocked &&
    // change lane planning succeed), skip
    // 2.如果不是換道的場景,或者(目標(biāo)lane沒有阻塞)并且換道規(guī)劃成功,跳過
    if (frame->reference_line_info().size() <= 1 ||
        (is_clear_to_change_lane_ && is_change_lane_planning_succeed_)) {
      continue;
    }
    // When the target lane is blocked in change-lane case, check the urgency
    // Get the end point of current routing
    const auto &route_end_waypoint =
        reference_line_info.Lanes().RouteEndWaypoint();
    // If can't get lane from the route's end waypoint, then skip
    // 3.在route的末端無法獲得lane,跳過
    if (!route_end_waypoint.lane) {
      continue;
    }
    auto point = route_end_waypoint.lane->GetSmoothPoint(route_end_waypoint.s);
    auto *reference_line = reference_line_info.mutable_reference_line();
    common::SLPoint sl_point;
    // Project the end point to sl_point on current reference lane
    // 將當(dāng)前參考線的點(diǎn)映射到frenet坐標(biāo)系下
    if (reference_line->XYToSL(point, &sl_point) &&
        reference_line->IsOnLane(sl_point)) {
      // Check the distance from ADC to the end point of current routing
      double distance_to_passage_end =
          sl_point.s() - reference_line_info.AdcSlBoundary().end_s();
      // If ADC is still far from the end of routing, no need to stop, skip
      // 4. 如果adc距離routing終點(diǎn)較遠(yuǎn),不需要停止,跳過
      if (distance_to_passage_end >
          rule_based_stop_decider_config_.approach_distance_for_lane_change()) {
        continue;
      }
      // In urgent case, set a temporary stop fence and wait to change lane
      // TODO(Jiaxuan Xu): replace the stop fence to more intelligent actions
      // 5.如果遇到緊急情況,設(shè)置臨時(shí)的stop fence,等待換道
      const std::string stop_wall_id = "lane_change_stop";
      std::vector<std::string> wait_for_obstacles;
      util::BuildStopDecision(
          stop_wall_id, sl_point.s(),
          rule_based_stop_decider_config_.urgent_distance_for_lane_change(),
          StopReasonCode::STOP_REASON_LANE_CHANGE_URGENCY, wait_for_obstacles,
          "RuleBasedStopDecider", frame, &reference_line_info);
    }
  }
}

AddPathEndStop

【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER,Apollo,自動(dòng)駕駛,planning,決策規(guī)劃,算法,人工智能,apollo

void RuleBasedStopDecider::AddPathEndStop(
    Frame *const frame, ReferenceLineInfo *const reference_line_info) {
  // 路徑不為空且起點(diǎn)到終點(diǎn)的距離不小于20m
  if (!reference_line_info->path_data().path_label().empty() &&
      reference_line_info->path_data().frenet_frame_path().back().s() -
              reference_line_info->path_data().frenet_frame_path().front().s() <
          FLAGS_short_path_length_threshold) { 
    // FLAGS_short_path_length_threshold: Threshold for too short path length(20m)
    
    // 創(chuàng)建虛擬墻的ID
    const std::string stop_wall_id =
        PATH_END_VO_ID_PREFIX + reference_line_info->path_data().path_label();
    std::vector<std::string> wait_for_obstacles;
    // 創(chuàng)建stop fence
    util::BuildStopDecision(
        stop_wall_id,
        reference_line_info->path_data().frenet_frame_path().back().s() - 5.0,
        0.0, StopReasonCode::STOP_REASON_REFERENCE_END, wait_for_obstacles,
        "RuleBasedStopDecider", frame, reference_line_info);
  }
}

參考

[1] 基于規(guī)則的停止決策文章來源地址http://www.zghlxwxcb.cn/news/detail-690920.html

到了這里,關(guān)于【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之RULE_BASED_STOP_DECIDER的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PIECEWISE_JERK_NONLINEAR_SPEED_OPTIMIZER(二)

    【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PIECEWISE_JERK_NONLINEAR_SPEED_OPTIMIZER(二)

    1.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之LANE_CHANGE_DECIDER 2.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PATH_REUSE_DECIDER 3.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PATH_BORROW_DECIDER 4.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PATH_BOUNDS_DECIDER 5.【Apollo學(xué)習(xí)筆記】——規(guī)劃模塊TASK之PIECEWISE_JERK_PATH_OPTIMI

    2024年02月09日
    瀏覽(23)
  • Apollo規(guī)劃模塊代碼學(xué)習(xí)(1): 算法架構(gòu)原理、運(yùn)行機(jī)制一文詳解

    Apollo規(guī)劃模塊代碼學(xué)習(xí)(1): 算法架構(gòu)原理、運(yùn)行機(jī)制一文詳解

    Apollo開源自動(dòng)駕駛平臺中,高清地圖模塊提供了每個(gè)在線模塊都可以訪問的高清地圖。感知和定位模塊提供了必要的動(dòng)態(tài)環(huán)境信息,可以在預(yù)測模塊中進(jìn)一步用于預(yù)測未來的環(huán)境狀態(tài)。運(yùn)動(dòng)規(guī)劃模塊考慮所有信息,以生成安全平滑的軌跡,并將其輸入車輛控制模塊。 目前Ap

    2024年01月25日
    瀏覽(19)
  • 【Apollo學(xué)習(xí)筆記】—— Routing模塊

    【Apollo學(xué)習(xí)筆記】—— Routing模塊

    Apollo的routing模塊讀取高精地圖原始信息,用于根據(jù)輸入 RoutingRequest 信息在 base_map 中選取匹配最近的點(diǎn)作為導(dǎo)航軌跡的起點(diǎn)和終點(diǎn),讀取依據(jù) base_map 生成的 routing_map 作為 topo_graph ,然后通過Astar算法在拓?fù)鋱D中搜索連接起始點(diǎn)的最優(yōu)路徑 RoutingResponse ,作為輸出發(fā)送出去。

    2024年02月15日
    瀏覽(23)
  • Apollo星火計(jì)劃學(xué)習(xí)筆記——Apollo開放空間規(guī)劃算法原理與實(shí)踐

    Apollo星火計(jì)劃學(xué)習(xí)筆記——Apollo開放空間規(guī)劃算法原理與實(shí)踐

    Apollo星火計(jì)劃課程鏈接如下 星火計(jì)劃2.0基礎(chǔ)課:https://apollo.baidu.com/community/online-course/2 星火計(jì)劃2.0專項(xiàng)課:https://apollo.baidu.com/community/online-course/12 ????開放空間算法的配置主要在 valet_parking_config.pb.txt 中,分為4個(gè)部分: OPEN_SPACE_ROI_DECIDER 、 OPEN_SPACE_TRAJECTORY_PROVIDER 、 OPE

    2023年04月10日
    瀏覽(26)
  • Apollo星火計(jì)劃學(xué)習(xí)筆記——Apollo決策規(guī)劃技術(shù)詳解及實(shí)現(xiàn)(以交通燈場景檢測為例)

    Apollo星火計(jì)劃學(xué)習(xí)筆記——Apollo決策規(guī)劃技術(shù)詳解及實(shí)現(xiàn)(以交通燈場景檢測為例)

    Apollo星火計(jì)劃課程鏈接如下 星火計(jì)劃2.0基礎(chǔ)課:https://apollo.baidu.com/community/online-course/2 星火計(jì)劃2.0專項(xiàng)課:https://apollo.baidu.com/community/online-course/12 星火計(jì)劃學(xué)習(xí)筆記——第七講自動(dòng)駕駛規(guī)劃技術(shù)原理1 ●目的 ○ 保障無人車的行車安全并且遵守交規(guī) ○ 為路徑和速度的平滑優(yōu)

    2024年02月07日
    瀏覽(52)
  • 自動(dòng)駕駛規(guī)劃模塊學(xué)習(xí)筆記-多項(xiàng)式曲線

    自動(dòng)駕駛運(yùn)動(dòng)規(guī)劃中會用到各種曲線,主要用于生成車輛變道的軌跡,高速場景中使用的是五次多項(xiàng)式曲線,城市場景中使用的是分段多項(xiàng)式曲線(piecewise),相比多項(xiàng)式,piecewise能夠生成更為復(fù)雜的路徑。另外對于自由空間,可以使用A*搜索出的軌跡再加以cilqr加以平滑,也

    2024年02月05日
    瀏覽(22)
  • Apollo Planning學(xué)習(xí)(9)-------速度規(guī)劃

    Apollo Planning學(xué)習(xí)(9)-------速度規(guī)劃

    順著之前學(xué)習(xí)public road planner 的路徑規(guī)劃中l(wèi)ane follow的task,在得到的規(guī)劃路徑上再進(jìn)行速度規(guī)劃。大致思路為先利用ST Graph,將障礙物、限速等投影在ST圖上,利用全局搜索方法DP算法得到?jīng)Q策,開辟一個(gè)凸空間,在利用最優(yōu)化方法(二次優(yōu)化和非線性優(yōu)化)進(jìn)行速度規(guī)劃。 所

    2024年02月12日
    瀏覽(15)
  • Apollo Planning學(xué)習(xí)(2)-------路徑規(guī)劃

    Apollo Planning學(xué)習(xí)(2)-------路徑規(guī)劃

    本次學(xué)習(xí)的Apollo版本為6.0版本,因?yàn)閺?.0開始軌跡規(guī)劃算法主要使用的就是public road,所以本次主要學(xué)習(xí)該算法,該算法的核心思想是PV解耦,即Path-Velocity的解耦,其主要包含兩個(gè)過程:1.路徑規(guī)劃,2.速度規(guī)劃。 路徑規(guī)劃其實(shí)已經(jīng)發(fā)展很多年,從早期的機(jī)器人到現(xiàn)在的無人駕

    2024年02月09日
    瀏覽(16)
  • Apollo決策規(guī)劃算法學(xué)習(xí)Chapter3 速度規(guī)劃算法

    Apollo決策規(guī)劃算法學(xué)習(xí)Chapter3 速度規(guī)劃算法

    第一章 Apollo決策規(guī)劃算法基本概念 第二章 Apollo決策規(guī)劃之路徑規(guī)劃算法 第三章 Apollo決策規(guī)劃之速度規(guī)劃算法 本文為第三章,主要講解 Apollo決策規(guī)劃算法中的速度規(guī)劃算法,EM planner的速度規(guī)劃算法同樣是是通過動(dòng)態(tài)規(guī)劃和二次規(guī)劃實(shí)現(xiàn)的,下面來細(xì)講速度規(guī)劃算法。 1)回

    2024年02月11日
    瀏覽(98)
  • 【Apollo學(xué)習(xí)筆記】—— 相機(jī)仿真

    【Apollo學(xué)習(xí)筆記】—— 相機(jī)仿真

    本文是對Cyber RT的學(xué)習(xí)記錄,文章可能存在不嚴(yán)謹(jǐn)、不完善、有缺漏的部分,還請大家多多指出。這一章的內(nèi)容還是比較簡單的,直接上代碼與結(jié)果。 課程地址 : https://apollo.baidu.com/community/course/outline/329?activeId=10200 更多還請參考 : [1] Apollo星火計(jì)劃學(xué)習(xí)筆記——第三講(Apollo

    2024年02月13日
    瀏覽(19)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包