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

This class decides whether we should send rerouting request based on traffic situation. 更多...

#include <reference_line_end.h>

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

Public 成员函数

bool Init (const std::string &name, const std::shared_ptr< DependencyInjector > &injector) override
 
virtual ~ReferenceLineEnd ()=default
 
common::Status ApplyRule (Frame *const frame, ReferenceLineInfo *const reference_line_info)
 
void Reset () override
 
- Public 成员函数 继承自 apollo::planning::TrafficRule
 TrafficRule ()
 
virtual ~TrafficRule ()=default
 
std::string Getname ()
 

额外继承的成员函数

- Protected 成员函数 继承自 apollo::planning::TrafficRule
template<typename T >
bool LoadConfig (T *config)
 
- Protected 属性 继承自 apollo::planning::TrafficRule
std::shared_ptr< DependencyInjector > injector_
 
std::string config_path_
 
std::string name_
 

详细描述

This class decides whether we should send rerouting request based on traffic situation.

在文件 reference_line_end.h 第 36 行定义.

构造及析构函数说明

◆ ~ReferenceLineEnd()

virtual apollo::planning::ReferenceLineEnd::~ReferenceLineEnd ( )
virtualdefault

成员函数说明

◆ ApplyRule()

Status apollo::planning::ReferenceLineEnd::ApplyRule ( Frame *const  frame,
ReferenceLineInfo *const  reference_line_info 
)
virtual

实现了 apollo::planning::TrafficRule.

在文件 reference_line_end.cc 第 44 行定义.

45 {
46 const auto& reference_line = reference_line_info->reference_line();
47
48 ADEBUG << "ReferenceLineEnd length[" << reference_line.Length() << "]";
49 for (const auto& segment : reference_line_info->Lanes()) {
50 ADEBUG << " lane[" << segment.lane->lane().id().id() << "]";
51 }
52 // check
53 double remain_s =
54 reference_line.Length() - reference_line_info->AdcSlBoundary().end_s();
55 if (remain_s > config_.min_reference_line_remain_length()) {
56 return Status::OK();
57 }
58
59 // create a virtual stop wall at the end of reference line to stop the adc
60 std::string virtual_obstacle_id =
61 REF_LINE_END_VO_ID_PREFIX + reference_line_info->Lanes().Id();
62 double obstacle_start_s =
63 reference_line.Length() - 2 * FLAGS_virtual_stop_wall_length;
64 auto* obstacle = frame->CreateStopObstacle(
65 reference_line_info, virtual_obstacle_id, obstacle_start_s);
66 if (!obstacle) {
68 "Failed to create reference line end obstacle");
69 }
70 Obstacle* stop_wall = reference_line_info->AddObstacle(obstacle);
71 if (!stop_wall) {
72 return Status(
74 "Failed to create path obstacle for reference line end obstacle");
75 }
76
77 // build stop decision
78 const double stop_line_s = obstacle_start_s - config_.stop_distance();
79 auto stop_point = reference_line.GetReferencePoint(stop_line_s);
80
81 ObjectDecisionType stop;
82 auto stop_decision = stop.mutable_stop();
83 stop_decision->set_reason_code(StopReasonCode::STOP_REASON_DESTINATION);
84 stop_decision->set_distance_s(-config_.stop_distance());
85 stop_decision->set_stop_heading(stop_point.heading());
86 stop_decision->mutable_stop_point()->set_x(stop_point.x());
87 stop_decision->mutable_stop_point()->set_y(stop_point.y());
88 stop_decision->mutable_stop_point()->set_z(0.0);
89
90 auto* path_decision = reference_line_info->path_decision();
91 path_decision->AddLongitudinalDecision(Getname(), stop_wall->Id(), stop);
92
93 return Status::OK();
94}
static Status OK()
generate a success status.
Definition status.h:60
#define ADEBUG
Definition log.h:41

◆ Init()

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

重载 apollo::planning::TrafficRule .

在文件 reference_line_end.cc 第 34 行定义.

36 {
37 if (!TrafficRule::Init(name, injector)) {
38 return false;
39 }
40 // Load the config this task.
41 return TrafficRule::LoadConfig<ReferenceLineEndConfig>(&config_);
42}
virtual bool Init(const std::string &name, const std::shared_ptr< DependencyInjector > &injector)

◆ Reset()

void apollo::planning::ReferenceLineEnd::Reset ( )
inlineoverridevirtual

实现了 apollo::planning::TrafficRule.

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

43{}

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