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

#include <st_boundary_mapper.h>

apollo::planning::STBoundaryMapper 的协作图:

Public 成员函数

 STBoundaryMapper (const SpeedBoundsDeciderConfig &config, const ReferenceLine &reference_line, const PathData &path_data, const double planning_distance, const double planning_time, const std::shared_ptr< DependencyInjector > &injector)
 
virtual ~STBoundaryMapper ()=default
 
common::Status ComputeSTBoundary (PathDecision *path_decision) const
 

详细描述

在文件 st_boundary_mapper.h 第 41 行定义.

构造及析构函数说明

◆ STBoundaryMapper()

apollo::planning::STBoundaryMapper::STBoundaryMapper ( const SpeedBoundsDeciderConfig &  config,
const ReferenceLine &  reference_line,
const PathData &  path_data,
const double  planning_distance,
const double  planning_time,
const std::shared_ptr< DependencyInjector > &  injector 
)

在文件 st_boundary_mapper.cc 第 52 行定义.

57 : speed_bounds_config_(config),
58 reference_line_(reference_line),
59 path_data_(path_data),
60 vehicle_param_(common::VehicleConfigHelper::GetConfig().vehicle_param()),
61 planning_max_distance_(planning_distance),
62 planning_max_time_(planning_time),
63 injector_(injector) {}
static const VehicleConfig & GetConfig()
Get the current vehicle configuration.

◆ ~STBoundaryMapper()

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

成员函数说明

◆ ComputeSTBoundary()

Status apollo::planning::STBoundaryMapper::ComputeSTBoundary ( PathDecision *  path_decision) const

在文件 st_boundary_mapper.cc 第 65 行定义.

65 {
66 // Sanity checks.
67 CHECK_GT(planning_max_time_, 0.0);
68 if (path_data_.discretized_path().size() < 2) {
69 AERROR << "Fail to get params because of too few path points. path points "
70 "size: "
71 << path_data_.discretized_path().size() << ".";
72 return Status(ErrorCode::PLANNING_ERROR,
73 "Fail to get params because of too few path points");
74 }
75
76 // Go through every obstacle.
77 Obstacle* stop_obstacle = nullptr;
78 ObjectDecisionType stop_decision;
79 double min_stop_s = std::numeric_limits<double>::max();
80 for (const auto* ptr_obstacle_item : path_decision->obstacles().Items()) {
81 Obstacle* ptr_obstacle = path_decision->Find(ptr_obstacle_item->Id());
82 ACHECK(ptr_obstacle != nullptr);
83
84 // If no longitudinal decision has been made, then plot it onto ST-graph.
85 if (!ptr_obstacle->HasLongitudinalDecision()) {
86 ComputeSTBoundary(ptr_obstacle);
87 continue;
88 }
89
90 // If there is a longitudinal decision, then fine-tune boundary.
91 const auto& decision = ptr_obstacle->LongitudinalDecision();
92 if (decision.has_stop()) {
93 // 1. Store the closest stop fence info.
94 // TODO(all): store ref. s value in stop decision; refine the code then.
95 common::SLPoint stop_sl_point;
96 reference_line_.XYToSL(decision.stop().stop_point(), &stop_sl_point);
97 const double stop_s = stop_sl_point.s();
98
99 if (stop_s < min_stop_s) {
100 stop_obstacle = ptr_obstacle;
101 min_stop_s = stop_s;
102 stop_decision = decision;
103 }
104 } else if (decision.has_follow() || decision.has_overtake() ||
105 decision.has_yield()) {
106 // 2. Depending on the longitudinal overtake/yield decision,
107 // fine-tune the upper/lower st-boundary of related obstacles.
108 ComputeSTBoundaryWithDecision(ptr_obstacle, decision);
109 } else if (!decision.has_ignore()) {
110 // 3. Ignore those unrelated obstacles.
111 AWARN << "No mapping for decision: " << decision.DebugString();
112 }
113 }
114 if (stop_obstacle) {
115 bool success = MapStopDecision(stop_obstacle, stop_decision);
116 if (!success) {
117 const std::string msg = "Fail to MapStopDecision.";
118 AERROR << msg;
119 return Status(ErrorCode::PLANNING_ERROR, msg);
120 }
121 }
122
123 return Status::OK();
124}
static Status OK()
generate a success status.
Definition status.h:60
const DiscretizedPath & discretized_path() const
Definition path_data.cc:90
bool XYToSL(const common::math::Vec2d &xy_point, common::SLPoint *const sl_point, double warm_start_s=-1.0) const
Transvert Cartesian coordinates to Frenet.
common::Status ComputeSTBoundary(PathDecision *path_decision) const
#define ACHECK(cond)
Definition log.h:80
#define AERROR
Definition log.h:44
#define AWARN
Definition log.h:43

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