Apollo 11.0
自动驾驶开放平台
apollo::planning::SquareScenario类 参考

#include <square_scenario.h>

类 apollo::planning::SquareScenario 继承关系图:
apollo::planning::SquareScenario 的协作图:

Public 成员函数

bool Init (std::shared_ptr< DependencyInjector > injector, const std::string &name)
 
SquareContext * GetContext () override
 Get the scenario context.
 
bool IsTransferable (const Scenario *other_scenario, const Frame &frame) override
 Each scenario should define its own transfer condition, i.e., when it should allow to transfer from other scenario to itself.
 
- Public 成员函数 继承自 apollo::planning::Scenario
 Scenario ()
 
virtual ~Scenario ()=default
 
virtual ScenarioResult Process (const common::TrajectoryPoint &planning_init_point, Frame *frame)
 
virtual bool Exit (Frame *frame)
 
virtual bool Enter (Frame *frame)
 
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::Process function following a configured order, The return value of Stage::Process function determines the transition from one stage to another.
 
const ScenarioStatusType & GetStatus () const
 
const std::string GetStage () const
 
const std::string & GetMsg () const
 
const std::string & Name () const
 
void Reset ()
 Reset the scenario, used before entering the scenario.
 

额外继承的成员函数

- Protected 成员函数 继承自 apollo::planning::Scenario
template<typename T >
bool LoadConfig (T *config)
 
- Protected 属性 继承自 apollo::planning::Scenario
ScenarioResult scenario_result_
 
std::shared_ptr< Stage > current_stage_
 
std::unordered_map< std::string, const StagePipeline * > stage_pipeline_map_
 
std::string msg_
 
std::shared_ptr< DependencyInjector > injector_
 
std::string config_path_
 
std::string config_dir_
 
std::string name_
 
ScenarioPipeline scenario_pipeline_config_
 

详细描述

在文件 square_scenario.h 第 34 行定义.

成员函数说明

◆ GetContext()

SquareContext * apollo::planning::SquareScenario::GetContext ( )
inlineoverridevirtual

Get the scenario context.

实现了 apollo::planning::Scenario.

在文件 square_scenario.h 第 40 行定义.

40 {
41 return &context_;
42 }

◆ Init()

bool apollo::planning::SquareScenario::Init ( std::shared_ptr< DependencyInjector >  injector,
const std::string &  name 
)
virtual

重载 apollo::planning::Scenario .

在文件 square_scenario.cc 第 28 行定义.

28 {
29 if (!Scenario::Init(injector, name)) {
30 AERROR << "failed to init scenario" << Name();
31 return false;
32 }
33
34 if (!Scenario::LoadConfig<apollo::planning::ScenarioSquareConfig>(&context_.scenario_config)) {
35 AERROR << "fail to get config of scenario" << Name();
36 return false;
37 }
38
39 return true;
40}
virtual bool Init(std::shared_ptr< DependencyInjector > injector, const std::string &name)
Definition scenario.cc:43
const std::string & Name() const
Definition scenario.h:98
#define AERROR
Definition log.h:44
ScenarioSquareConfig scenario_config
Definition context.h:32

◆ IsTransferable()

bool apollo::planning::SquareScenario::IsTransferable ( const Scenario *  other_scenario,
const Frame &  frame 
)
overridevirtual

Each scenario should define its own transfer condition, i.e., when it should allow to transfer from other scenario to itself.

重载 apollo::planning::Scenario .

在文件 square_scenario.cc 第 42 行定义.

42 {
43 if (!frame.local_view().planning_command->has_lane_follow_command()) {
44 return false;
45 }
46 if (frame.reference_line_info().empty() || frame.reference_line_info().size() > 1) {
47 return false;
48 }
49 const auto& reference_line_info = frame.reference_line_info().front();
50 hdmap::PathOverlap junction_overlap;
51 if (reference_line_info.GetJunction(reference_line_info.AdcSlBoundary().end_s(), &junction_overlap) == 0) {
52 return false;
53 }
54 if (reference_line_info.AdcSlBoundary().start_s() < junction_overlap.start_s
55 || reference_line_info.AdcSlBoundary().end_s() > junction_overlap.end_s) {
56 return false;
57 }
58 context_.junction_id = junction_overlap.object_id;
59 AERROR << "JUNCTION ID" << context_.junction_id;
60 return true;
61}

该类的文档由以下文件生成: