Apollo中提到了几种轨迹规划方法,这里简要介绍Lattice,主要思路可以参考这一篇博文,我为了自己方便理解代码,于是把代码的步骤和注释整理了。文件路径:apollo\modules\planning\planner\lattice\lattice_planner.cc。
- obtain a reference line and transform it to the PathPoint format.
-
compute the matched point of the init planning point on the reference line.
-
according to the matched point, compute the init state in Frenet frame.
-
parse the decision and get the planning target.
-
generate 1d trajectory bundle for longitudinal and lateral respectively.(Trajectory1dGenerator)
-
first, evaluate the feasibility of the 1d trajectories according to dynamic constraints. second, evaluate the feasible longitudinal and lateral trajectory pairs and sort them according to the cost.(TrajectoryEvaluator)
-
always get the best pair of trajectories to combine; return the first collision-free trajectory.(TrajectoryCombiner:combine two 1d trajectories to one 2d trajectory。ConstraintChecker:check longitudinal and lateral acceleration considering trajectory curvatures。CollisionChecker:check collision with other obstacles)