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

#include <valet_parking_scenario.h>

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

Public 成员函数

bool Init (std::shared_ptr< DependencyInjector > injector, const std::string &name) override
 
ValetParkingContext * GetContext () override
 Get the scenario context.
 
bool IsTransferable (const Scenario *const 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_
 

详细描述

在文件 valet_parking_scenario.h 第 43 行定义.

成员函数说明

◆ GetContext()

ValetParkingContext * apollo::planning::ValetParkingScenario::GetContext ( )
inlineoverridevirtual

Get the scenario context.

实现了 apollo::planning::Scenario.

在文件 valet_parking_scenario.h 第 51 行定义.

51{ return &context_; }

◆ Init()

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

重载 apollo::planning::Scenario .

在文件 valet_parking_scenario.cc 第 36 行定义.

37 {
38 if (init_) {
39 return true;
40 }
41
42 if (!Scenario::Init(injector, name)) {
43 AERROR << "failed to init scenario" << Name();
44 return false;
45 }
46
47 if (!Scenario::LoadConfig<ScenarioValetParkingConfig>(
48 &context_.scenario_config)) {
49 AERROR << "fail to get config of scenario" << Name();
50 return false;
51 }
53 CHECK_NOTNULL(hdmap_);
54 init_ = true;
55 return true;
56}
static const HDMap * BaseMapPtr()
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

◆ IsTransferable()

bool apollo::planning::ValetParkingScenario::IsTransferable ( const Scenario *const  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 .

在文件 valet_parking_scenario.cc 第 58 行定义.

59 {
60 // TODO(all) Implement available parking spot detection by preception results
61 if (!frame.local_view().planning_command->has_parking_command()) {
62 return false;
63 }
64 if (other_scenario == nullptr || frame.reference_line_info().empty()) {
65 return false;
66 }
67 std::string target_parking_spot_id;
68 if (frame.local_view().planning_command->has_parking_command() &&
69 frame.local_view()
70 .planning_command->parking_command()
71 .has_parking_spot_id()) {
72 target_parking_spot_id = frame.local_view()
73 .planning_command->parking_command()
74 .parking_spot_id();
75 } else {
76 ADEBUG << "No parking space id from routing";
77 return false;
78 }
79
80 if (target_parking_spot_id.empty()) {
81 return false;
82 }
83
84 const auto& nearby_path =
85 frame.reference_line_info().front().reference_line().map_path();
86 PathOverlap parking_space_overlap;
87 const auto& vehicle_state = frame.vehicle_state();
88
89 if (!SearchTargetParkingSpotOnPath(nearby_path, target_parking_spot_id,
90 &parking_space_overlap)) {
91 ADEBUG << "No such parking spot found after searching all path forward "
92 "possible"
93 << target_parking_spot_id;
94 return false;
95 }
96 double parking_spot_range_to_start =
98 if (!CheckDistanceToParkingSpot(frame, vehicle_state, nearby_path,
99 parking_spot_range_to_start,
100 parking_space_overlap)) {
101 ADEBUG << "target parking spot found, but too far, distance larger than "
102 "pre-defined distance"
103 << target_parking_spot_id;
104 return false;
105 }
106 context_.target_parking_spot_id = target_parking_spot_id;
107 return true;
108}
#define ADEBUG
Definition log.h:41

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