Apollo 10.0
自动驾驶开放平台
README_cn

planning-scenario-bare-intersection-unprotected

简介

BareIntersectionUnprotectedScenario: 无保护裸露交叉路口场景,在交通路口既没有停止标志,也没有交通灯,车辆在路口前一段距离范围内切换到此场景。

IsTransferable: 场景切入条件

  1. 当前command为lane_follow_command
  2. 参考线不为空
  3. 排序后遇到的overlap不为空

获取overlap信息:从参考线信息的first_encounter_overlaps_中获取最先遇到的traffic_sign_overlappnc_junction_overlap

  • 考虑最近的pnc_junction_overlap,主车距离路口小于start_bare_intersection_scenario_distance,大于0米,表示进入无保护裸露交叉路口场景。

Stages

阶段名 类型 描述
BARE_INTERSECTION_UNPROTECTED_APPROACH apollo::planning::BareIntersectionUnprotectedStageApproach 主车减速接近无保护路口区域
BARE_INTERSECTION_UNPROTECTED_INTERSECTION_CRUISE apollo::planning::BareIntersectionUnprotectedStageIntersectionCruise 主车通过路口

1. BARE_INTERSECTION_UNPROTECTED_APPROACH

BareIntersectionUnprotectedStageApproach : 该阶段用于主车减速接近无保护路口区域,主车距离达到阈值后退出。

Process: 该阶段处理的主函数,输入为规划初始点 planning_init_pointFrame;输出为当前阶段处理状态StageResult

  • ExecuteTaskOnReferenceLine:输入为规划初始点planning_init_pointFrame信息,按照该stage配置的task列表,依次进行规划。
  • 通过reference_line_info中的overlap,检查路口是否存在。如果不存在,则FinishScenario(),直接退出BareIntersectionUnprotectedScenario场景。
  • 检查主车到路口距离,如果满足distance_adc_to_pnc_junction < -kPassStopLineBuffer,进入FinishStage,结束当前Stage,进入BARE_INTERSECTION_UNPROTECTED_INTERSECTION_CRUISE阶段。
  • 设置主车限速,实现主车减速接近路口。
  • 设置路口路权,reference_line_info.SetJunctionRightOfWay,主车处于非保护状态。
  • 再次执行Task 规划,ExecuteTaskOnReferenceLine
  • CheckClear:统计主车需要等待的障碍物序列wait_for_obstacle_ids
  • 参数配置策略:enable_explicit_stop。如果True,则在主车需要等到,设置stop = true,为wait_for_obstacle_ids障碍物建立STOP虚拟墙。在连续5帧不需要等待的情况下,stop = false

CheckClear: 检查当前是否由障碍物阻塞。

  • 输入为const ReferenceLineInfo& reference_line_info, std::vector<std::string>* wait_for_obstacle_ids
  • 引用传参wait_for_obstacle_ids,在函数执行之后,返回阻塞需要等待的障碍物序列。

FinishStage: 该阶段的退出函数。

  • 退出BARE_INTERSECTION_UNPROTECTED_APPROACH阶段,进入BARE_INTERSECTION_UNPROTECTED_INTERSECTION_CRUISE阶段。
  • 重新设置巡航限速为FLAGS_default_cruise_speed

2. BARE_INTERSECTION_UNPROTECTED_INTERSECTION_CRUISE

BareIntersectionUnprotectedStageApproach : 该阶段用于主车通过路口。

Process: 该阶段处理的主函数,输入为规划初始点 planning_init_pointFrame;输出为当前阶段处理状态StageResult

  • ExecuteTaskOnReferenceLine:输入为规划初始点planning_init_pointFrame信息,按照该stage配置的task列表,依次进行规划。
  • CheckDone:检查主车是否通过路口。如果通过,进入FinishStage,结束当前Stage。否则,返回状态值StageStatusType::RUNNING

CheckDone: 基类BaseStageCruise的一个成员函数。

  • 输入为:const Frame& frame, const PlanningContext* context, const bool right_of_way_status
  • 在无保护路口时,right_of_way_status = false。检查主车是否依然处于路口。

FinishStage: 该阶段的退出函数。

  • 退出BARE_INTERSECTION_UNPROTECTED_INTERSECTION_CRUISE阶段,退出BareIntersectionUnprotectedScenario场景。

目录结构

modules/planning/scenarios/bare_intersection_unprotected/
├── bare_intersection_unprotected_scenario.cc
├── bare_intersection_unprotected_scenario.h
├── bare_intersection_unprotected_scenario_test.cc
├── BUILD
├── conf
│ ├── pipeline.pb.txt
│ └── scenario_conf.pb.txt
├── cyberfile.xml
├── images
│ └── bare_intersection_scenario.png
├── plugins.xml
├── proto
│ ├── bare_intersection_unprotected_scenario.proto
│ └── BUILD
├── README_cn.md
├── stage_approach.cc
├── stage_approach.h
├── stage_approach_test.cc
├── stage_intersection_cruise.cc
└── stage_intersection_cruise.h

模块

BareIntersectionUnprotectedScenario 插件

apollo::planning::BareIntersectionUnprotectedScenario

配置

文件路径 类型/结构
说明
modules/planning/scenarios/bare_intersection_unprotected/conf/scenario_conf.pb.txt apollo::planning::ScenarioBareIntersectionUnprotectedConfig 场景的配置文件
modules/planning/scenarios/bare_intersection_unprotected/conf/pipeline.pb.txt apollo::planning::ScenarioPipeline 场景的流水线文件
modules/planning/planning_component/conf/planning_config.pb.txt apollo::planning::PlanningConfig planning组件的配置文件

使用方式

配置加载 EmergencyStopScenario 插件
  • modules/planning/planning_component/conf/planning_config.pb.txt文件中增加standard_planning_config的配置,配置使用当前场景插件。
    shell
    # modules/planning/planning_component/conf/planning_config.pb.txt
    standard_planning_config {
    planner_type: ......
    planner_public_road_config {
    ......
    scenario {
    name: "BARE_INTERSECTION_UNPROTECTED"
    type: "BareIntersectionUnprotectedScenario"
    }
    ......
    }
    }
  • modules/planning/scenarios/bare_intersection_unprotected/conf/pipeline.pb.txt中编辑该场景下所有Stage,以及各Stage对应的Task列表。
  • 同时支持自主开发,对于新增Stage插件,需要添加至modules/planning/scenarios/bare_intersection_unprotected/plugins.xml
    # modules/planning/scenarios/bare_intersection_unprotected/plugins.xml
    <library path="modules/planning/scenarios/bare_intersection_unprotected/libbare_intersection_unprotected_scenario.so">
    <class type="apollo::planning::BareIntersectionUnprotectedScenario" base_class="apollo::planning::Scenario"></class>
    <class type="apollo::planning::BareIntersectionUnprotectedStageApproach" base_class="apollo::planning::Stage"></class>
    <class type="apollo::planning::BareIntersectionUnprotectedStageIntersectionCruise" base_class="apollo::planning::Stage"></class>
    </library>

配置 EmergencyStopScenario 参数

文档意见反馈

如果您在使用文档的过程中,遇到任何问题,请到我们在【开发者社区】建立的 反馈意见收集问答页面,反馈相关的问题。我们会根据反馈意见对文档进行迭代优化。