1. Planning Component 启动时,通过Init 函数,按照配置文件,逐级初始化(注册scenario,初始化scenario, 初始化stage)
2. 通过prediction的输入数据,调用Proc 函数启动每一次的规划。
Planner Init
- PlanningComponent.Init 通过构造函数调用PlanningBase.Init(OnLanePlanning:Init)
- 通过OnLanePlanning:Init 函数调用 planner_dispatcher_->Init(); (planner_dispatcher被配置为PublicRoadPlanner)
- PublicRoadPlanner::Init函数通过调用 scenario_manager_.Init 对Scenario进行初始化
通过CreateScenario 创建对应的scenario 类, 默认为Lane Follow 类型。所以会实例化一个lane_follow_scenario类
- 在构造lane_follow_scenario类时,先通过其父类Scenario的Init 函数去调用配置文件。
Scenairo:Init 函数中,通过CreateStage函数将对应scenario中的第一个stage 设为current stage
CreateStage 函数中通过New 一个LaneFollowStage 对象,然后通过其基类Stage的构造函数,createtask