36 current_stage_(nullptr),
44 const std::string& name) {
48 auto* scenario =
injector_->planning_context()
49 ->mutable_planning_status()
52 scenario->set_scenario_type(
name_);
57 std::string class_name =
58 abi::__cxa_demangle(
typeid(*this).name(), 0, 0, &status);
67 "conf/scenario_conf.pb.txt");
70 std::string pipeline_config_path =
73 AINFO <<
"Load config path:" << pipeline_config_path;
77 AERROR <<
"Load pipeline of " <<
name_ <<
" failed!";
105 switch (ret.GetStageStatus()) {
120 if (next_stage.empty()) {
125 AERROR <<
"Failed to find config for stage: " << next_stage;
132 AWARN <<
"Current stage is a null pointer.";
147 AWARN <<
"Unexpected Stage return value: "
148 <<
static_cast<int>(ret.GetStageStatus());
161 if (
nullptr == stage_ptr ||
std::string GetPluginConfPath(const std::string &class_name, const std::string &conf_name)
get plugin configuration file location
static PluginManager * Instance()
get singleton instance of PluginManager
std::string GetPluginClassHomePath(const std::string &class_name)
@bried get plugin description file location that class belongs to
std::shared_ptr< Base > CreateInstance(const std::string &derived_class)
create plugin instance of derived class based on Base
static std::string GetFullPlanningClassName(const std::string &class_name)
Given the class name of planning module, combine the namespace "apollo::planning::" with it to create...
Frame holds all data for one planning cycle.
const ScenarioResult & SetScenarioStatus(const ScenarioStatusType &scenario_status)
Set the scenario status.
const ScenarioResult & SetStageResult(const StageResult &stage_result)
Set the stage status.
std::shared_ptr< Stage > current_stage_
virtual ScenarioResult Process(const common::TrajectoryPoint &planning_init_point, Frame *frame)
virtual bool Init(std::shared_ptr< DependencyInjector > injector, const std::string &name)
const std::string GetStage() const
virtual ScenarioContext * GetContext()=0
Get the scenario context.
void Reset()
Reset the scenario, used before entering the scenario.
std::unordered_map< std::string, const StagePipeline * > stage_pipeline_map_
std::shared_ptr< Stage > CreateStage(const StagePipeline &stage_pipeline)
Each scenario should define its own stages object's creation scenario will call stage's Stage::Proces...
ScenarioResult scenario_result_
std::shared_ptr< DependencyInjector > injector_
ScenarioPipeline scenario_pipeline_config_
Planning module main class.
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...
repeated StagePipeline stage