docs/应用实践/开发调试教程/Apollo规划实践/Apollo贴边行驶/贴边行驶使用教程.md
EdgeFollowPath用于生成贴边自动驾驶路径。该task通过Frame获取自车位置,通过ReferenceLineInfo获取车道信息、参考线信息以及静态障碍物信息,结合感知与地图路沿信息生成Path,最后将计算路径输出到ReferenceLineInfo中。
junction区域,并且车辆将要进入junction中,则不进行贴边路径规划。is_useable为false,则不使用感知路沿信息。FLAGS_disable_perception_edge_info,是否禁用感知路沿信息。candidate_path_boundaries)。遍历已决定的侧通道通行方向(decided_side_pass_direction_),对每个方向都尝试找到路径边界。
使用PathBoundsDeciderUtil::InitPathBoundary初始化路径边界。根据车道信息和ego的位置更新路径边界。根据静态障碍物在参考线上的投影再次更新路径边界。
其中包括ProcessEdgeFollowPathBounds(),对路沿边界进行处理。
path_road_boundary_,计算路沿右边界path_road_boundary_。path_boundary,由于做QP求解边界。candidate_path_boundaries(路径边界)和candidate_path_data(存储候选路径数据)。函数计算了路径曲率约束(ddl_bounds)、曲率变化率(jerk_bound)和参考路径(ref_l和weight_ref_l)。
调用PathOptimizerUtil::OptimizePath来优化路径。若优化成功,将计算路径path_data对象添加到candidate_path_data中。
其中包括对牵引点的计算,CalculateTowingDis(),计算横向牵引的L值,引入到优化的代价中,实现优化中将路径向右侧牵引。
根据path_road_boundary_的右边界、主车半车宽、预设贴边距离FLAGS_edge_follow_buffer计算横向牵引的L值,towing_l。
该函数用于评估候选路径数据,并选择一个最终路径。
代码会遍历候选路径数据。对于每个路径数据,使用PathAssessmentDeciderUtil类的静态函数IsValidRegularPath来检查路径是否有效。其中会判断路径是否为空、路径是否远离参考线、路径是否远离道路、路径是否与静态障碍物碰撞、路径终点是否在逆向的临近车道上。TrimTailingOutLanePoints剔除道路末端非本车道的路径点。ComparePathData根据道路长度、是否借道逆向车道、自车横向位置、更快回到本车道等因素选择合适的路径。
modules/planning/tasks/edge_follow_path/
├── BUILD
├── conf
│ └── default_conf.pb.txt
├── cyberfile.xml
├── edge_follow_path.cc
├── edge_follow_path.h
├── plugins.xml
├── proto
│ ├── BUILD
│ └── edge_follow_path.proto
└── README_cn.md
| 文件路径 | 类型/结构 | <div style="width: 300pt">说明</div> |
|---|---|---|
modules/planning/tasks/edge_follow_path/conf/default_conf.pb.txt | apollo::planning::EdgeFollowPathConfig | EdgeFollowPath 的配置文件 |
在 modules/planning/scenarios/xxxx/conf/pipeline.pb.txt 在期望增加EdgeFollowPath插件的scenarios xxxx中增加相应的配置,配置参数中name表示task的名称,这个由用户自定义,表达清楚是哪个task即可,type是task的类名称,即EdgeFollowPath。
task {
name: "EDGE_FOLLOW_PATH"
type: "EdgeFollowPath"
}
在modules/planning/tasks/edge_follow_path/conf/default_conf.pb.txt中,对EdgeFollowPath插件的参数进行配置。
在modules/planning/planning_component/conf/planning.conf中,对作用在EdgeFollowPath插件的gflag参数进行配置
mainboard -d modules/planning/planning_component/dag/planning.dag