首页 > 其他分享 >Apollo planning 模块(三):path decider

Apollo planning 模块(三):path decider

时间:2023-05-22 22:47:51浏览次数:37  
标签:status lane decider borrow planning mutable path Apollo

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

 

标签:status,lane,decider,borrow,planning,mutable,path,Apollo
From: https://www.cnblogs.com/cxacswx/p/17421979.html

相关文章

  • clip-path 剪切不规则路径后,阴影不生效问题
    正常来说:我们使用box-shadow都是能够生效的,但由于使用了clip剪切功能,使用阴影被剪切了所以我们在使用clip的时候只需要超出path就行了,比如:height:50px;width:100px;background:antiquewhite;clip-path:polygon(50%10%,0%100%,100%100%);box-......
  • [atARC153F]Tri-Colored Paths
    称一条边在环外当且仅当其两端点不全在环上用总方案数减去不合法的方案数,并分类讨论——Case1:图中不存在某种颜色的边否则,若存在简单环的颜色集合为\(\{1,2,3\}\),则环上每种颜色的边恰有一条否则,若颜色为\(1\)的边数\(\ge2\),则去掉其中一条后得到的简单路径矛盾记环上......
  • Python 02 Xpath
    XpathXpath(XMLPathLanguage)是在XML文档中选择节点的语言一、XPath路径表达式1、XPath节点在XPath中,有七种类型的节点:元素、属性、文本、命名空间、处理指令、注释以及文档(根)节点。XML文档是被作为节点树来对待的,树的根被称为文档节点或者根节点。2、XPath节点关系父(Pa......
  • Graphql(五)Apollo 文件传输
    本文介绍如何在ApolloGraphQL中实现文件的传输文件传输在GrapqhQL中官方建议文章ApolloServerFileUploadBestPractices提及了实现文件上传的几种方式,分别是:SignedURLsUsinganimageuploadserviceMultipartUploadRequests本文介绍我所尝试过的第一种和第三种。......
  • xpath解析使用extract()的各种情况分析
    返回一个SelectorList对象 http://scrapy-chs.readthedocs.io/zh_CN/0.24/topics/selectors.html#selectorlistSelectorList类是内建list类的子类,提供了一些额外的方法:xpath(query)css(query)extract()re()__nonzero__()返回一个list(就是系统自带的那个)里面是一些你......
  • Path环境变量
    一文搞懂Path环境变量 什么是Path环境变量?在探讨这个问题之前,我们需要了解什么是环境变量。“环境变量”和“path环境变量”其实是两个东西,这一点大家一定要区分开,不要混为一谈。“环境变量”是操作系统工作环境设置的一些选项或属性参数。每个环境变量由变量名和文件路径......
  • python内置库--os.path
    1简单介绍os.path模块提供了一系列函数,以便我们处理目录路径和文件2部分函数介绍os.path.abspath(path)对于path,返回其在该系统的绝对路径os.path.basename(path)返回路径path中的最后一部分os.path.commonprefix(list)接受包含多个路径的列表,返回所有路径的最长公......
  • Maven PKIX path building failed 错误提示
    最近公司的项目突然出现了下面的提示。PKIXpathbuildingfailed:sun.security.provider.certpath.SunCertPathBuilderException:unabletofindvalidcertificationpathtorequestedtarget->[Help2]  问题和解决出现上面的提示的问题是因为SSL签名的问题。但是我们......
  • go语言中处理路径的标准库--filepath
    ToSlash函数:funcToSlash(pathstring)string释义:将path中平台相关的路径分隔符转换为/例子:s:="F:\\golang_workspace\\leetcode\\aa.js"fmt.Println("path:",s)//ToSlash将path中平台相关的路径分隔符转换为'/'s=filepath.ToSlash(s)fmt.Printl......
  • Maven PKIX path building failed 错误提示
    最近公司的项目突然出现了下面的提示。PKIXpathbuildingfailed:sun.security.provider.certpath.SunCertPathBuilderException:unabletofindvalidcertificationpathtorequestedtarget->[Help2]  问题和解决出现上面的提示的问题是因为SSL签名的问题。......