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

#include <dp_road_graph.h>

apollo::planning::DpRoadGraph 的协作图:

Public 成员函数

 DpRoadGraph (const DpPolyPathConfig &config, const ReferenceLineInfo &reference_line_info, const SpeedData &speed_data)
 
 ~DpRoadGraph ()=default
 
bool FindPathTunnel (const common::TrajectoryPoint &init_point, const std::vector< const Obstacle * > &obstacles, PathData *const path_data)
 

详细描述

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

构造及析构函数说明

◆ DpRoadGraph()

apollo::planning::DpRoadGraph::DpRoadGraph ( const DpPolyPathConfig &  config,
const ReferenceLineInfo &  reference_line_info,
const SpeedData &  speed_data 
)

在文件 dp_road_graph.cc 第 41 行定义.

44 : config_(config),
45 reference_line_info_(reference_line_info),
46 reference_line_(reference_line_info.reference_line()),
47 speed_data_(speed_data) {}

◆ ~DpRoadGraph()

apollo::planning::DpRoadGraph::~DpRoadGraph ( )
default

成员函数说明

◆ FindPathTunnel()

bool apollo::planning::DpRoadGraph::FindPathTunnel ( const common::TrajectoryPoint &  init_point,
const std::vector< const Obstacle * > &  obstacles,
PathData *const  path_data 
)

在文件 dp_road_graph.cc 第 49 行定义.

51 {
52 CHECK_NOTNULL(path_data);
53
54 init_point_ = init_point;
55 if (!reference_line_.XYToSL(init_point_.path_point(), &init_sl_point_)) {
56 AERROR << "Fail to create init_sl_point from : "
57 << init_point.DebugString();
58 return false;
59 }
60 init_frenet_frame_point_ =
61 reference_line_.GetFrenetPoint(init_point_.path_point());
62
63 waypoint_sampler_->Init(&reference_line_info_, init_sl_point_,
64 init_frenet_frame_point_);
65 waypoint_sampler_->SetDebugLogger(planning_debug_);
66
67 std::vector<DpRoadGraphNode> min_cost_path;
68 if (!GenerateMinCostPath(obstacles, &min_cost_path)) {
69 AERROR << "Fail to generate graph!";
70 return false;
71 }
72 std::vector<common::FrenetFramePoint> frenet_path;
73 double accumulated_s = min_cost_path.front().sl_point.s();
74 const double path_resolution = config_.path_resolution();
75
76 for (size_t i = 1; i < min_cost_path.size(); ++i) {
77 const auto &prev_node = min_cost_path[i - 1];
78 const auto &cur_node = min_cost_path[i];
79
80 const double path_length = cur_node.sl_point.s() - prev_node.sl_point.s();
81 double current_s = 0.0;
82 const auto &curve = cur_node.min_cost_curve;
83 while (current_s + path_resolution / 2.0 < path_length) {
84 const double l = curve.Evaluate(0, current_s);
85 const double dl = curve.Evaluate(1, current_s);
86 const double ddl = curve.Evaluate(2, current_s);
87 common::FrenetFramePoint frenet_frame_point;
88 frenet_frame_point.set_s(accumulated_s + current_s);
89 frenet_frame_point.set_l(l);
90 frenet_frame_point.set_dl(dl);
91 frenet_frame_point.set_ddl(ddl);
92 frenet_path.push_back(std::move(frenet_frame_point));
93 current_s += path_resolution;
94 }
95 if (i == min_cost_path.size() - 1) {
96 accumulated_s += current_s;
97 } else {
98 accumulated_s += path_length;
99 }
100 }
101 path_data->SetReferenceLine(&reference_line_);
102 path_data->SetFrenetPath(FrenetFramePath(std::move(frenet_path)));
103 return true;
104}
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::FrenetFramePoint GetFrenetPoint(const common::PathPoint &path_point) const
#define AERROR
Definition log.h:44

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