modules/planning/tasks/lane_follow_path/README_cn.md
LaneFollowPath决策生成借道路路径。
如下图所示:
函数获取规划起点的笛卡尔坐标,而后通过参考线,将笛卡尔坐标转换为frenet坐标。
函数通过对周围车道、车辆位置和静态障碍物的分析,来决定车辆行驶的路径边界(candidate_path_boundaries)。该task通过Frame获取自车位置,通过ReferenceLineInfo获取车道信息、参考线信息以及静态障碍物信息,最后将计算路径输出到ReferenceLineInfo中。
使用PathBoundsDeciderUtil::InitPathBoundary初始化路径边界。根据自车道信息更新路径边界,而后根据自车位置对路径边界进行拓展。调用GetBoundaryFromStaticObstacles根据静态障碍物在参考线上的投影再次更新路径边界。
函数用于优化路径。它接收两个参数:candidate_path_boundaries(路径边界)和candidate_path_data(存储候选路径数据)。
函数计算了路径曲率约束(ddl_bounds)、曲率变化率(jerk_bound)和参考路径(ref_l和weight_ref_l)。
调用PathOptimizerUtil::OptimizePath来优化路径。若优化成功,将计算路径path_data对象添加到candidate_path_data中。
该函数用于评估候选路径数据,并选择一个最终路径。
代码会遍历候选路径数据。对于每个路径数据,使用PathAssessmentDeciderUtil类的静态函数IsValidRegularPath来检查路径是否有效。其中会判断路径是否为空、路径是否远离参考线、路径是否远离道路、路径是否与静态障碍物碰撞、路径终点是否在逆向的临近车道上。
modules/planning/tasks/lane_follow_path/
├── BUILD
├── conf
│ └── default_conf.pb.txt
├── cyberfile.xml
├── lane_follow_path.cc
├── lane_follow_path.h
├── plugins.xml
├── proto
│ ├── BUILD
│ └── lane_follow_path.proto
└── README_cn.md
apollo::planning::LaneFollowPath
| 文件路径 | 类型/结构 | <div style="width: 300pt">说明</div> |
|---|---|---|
modules/planning/tasks/lane_follow_path/conf/default_conf.pb.txt | apollo::planning::LaneFollowPathConfig | LaneFollowPath 的配置文件 |
在 modules/planning/scenarios/xxxx/conf/pipeline.pb.txt 在期望增加LaneFollowPath插件的scenarios xxxx中增加相应的配置,配置参数中 name 表示task的名称,这个由用户自定义,表达清楚是哪个task即可, type 是task的类名称,即 LaneFollowPath。
task {
name: "LANE_FOLLOW_PATH"
type: "LaneFollowPath"
}
在modules/planning/tasks/lane_follow_path/conf/default_conf.pb.txt中,对LaneFollowPath插件的参数进行配置。
在modules/planning/planning_component/conf/planning.conf中,对作用在LaneFollowPath插件的gflag参数进行配置
mainboard -d modules/planning/planning_component/dag/planning.dag