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

#include <discrete_points_reference_line_smoother.h>

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

Public 成员函数

 DiscretePointsReferenceLineSmoother (const ReferenceLineSmootherConfig &config)
 
virtual ~DiscretePointsReferenceLineSmoother ()=default
 
bool Smooth (const ReferenceLine &raw_reference_line, ReferenceLine *const smoothed_reference_line) override
 Smooth a given reference line
 
void SetAnchorPoints (const std::vector< AnchorPoint > &) override
 Smoothing constraints
 
- Public 成员函数 继承自 apollo::planning::ReferenceLineSmoother
 ReferenceLineSmoother (const ReferenceLineSmootherConfig &config)
 
virtual ~ReferenceLineSmoother ()=default
 

额外继承的成员函数

- Protected 属性 继承自 apollo::planning::ReferenceLineSmoother
ReferenceLineSmootherConfig config_
 

详细描述

构造及析构函数说明

◆ DiscretePointsReferenceLineSmoother()

apollo::planning::DiscretePointsReferenceLineSmoother::DiscretePointsReferenceLineSmoother ( const ReferenceLineSmootherConfig &  config)
explicit

在文件 discrete_points_reference_line_smoother.cc 第 32 行定义.

34 : ReferenceLineSmoother(config) {}
ReferenceLineSmoother(const ReferenceLineSmootherConfig &config)

◆ ~DiscretePointsReferenceLineSmoother()

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

成员函数说明

◆ SetAnchorPoints()

void apollo::planning::DiscretePointsReferenceLineSmoother::SetAnchorPoints ( const std::vector< AnchorPoint > &  achor_points)
overridevirtual

Smoothing constraints

实现了 apollo::planning::ReferenceLineSmoother.

在文件 discrete_points_reference_line_smoother.cc 第 176 行定义.

177 {
178 CHECK_GT(anchor_points.size(), 1U);
179 anchor_points_ = anchor_points;
180}

◆ Smooth()

bool apollo::planning::DiscretePointsReferenceLineSmoother::Smooth ( const ReferenceLine &  ,
ReferenceLine *const   
)
overridevirtual

Smooth a given reference line

实现了 apollo::planning::ReferenceLineSmoother.

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

38 {
39 std::vector<std::pair<double, double>> raw_point2d;
40 std::vector<double> anchorpoints_lateralbound;
41
42 for (const auto& anchor_point : anchor_points_) {
43 raw_point2d.emplace_back(anchor_point.path_point.x(),
44 anchor_point.path_point.y());
45 anchorpoints_lateralbound.emplace_back(anchor_point.lateral_bound);
46 }
47
48 // fix front and back points to avoid end states deviate from the center of
49 // road
50 anchorpoints_lateralbound.front() = 0.0;
51 anchorpoints_lateralbound.back() = 0.0;
52
53 NormalizePoints(&raw_point2d);
54
55 bool status = false;
56
57 const auto& smoothing_method = config_.discrete_points().smoothing_method();
58 std::vector<std::pair<double, double>> smoothed_point2d;
59 switch (smoothing_method) {
61 status = CosThetaSmooth(raw_point2d, anchorpoints_lateralbound,
62 &smoothed_point2d);
63 break;
65 status = FemPosSmooth(raw_point2d, anchorpoints_lateralbound,
66 &smoothed_point2d);
67 break;
68 default:
69 AERROR << "Smoother type not defined";
70 return false;
71 }
72
73 if (!status) {
74 AERROR << "discrete_points reference line smoother fails";
75 return false;
76 }
77
78 DeNormalizePoints(&smoothed_point2d);
79
80 std::vector<ReferencePoint> ref_points;
81 GenerateRefPointProfile(raw_reference_line, smoothed_point2d, &ref_points);
82
84
85 if (ref_points.size() < 2) {
86 AERROR << "Fail to generate smoothed reference line.";
87 return false;
88 }
89
90 *smoothed_reference_line = ReferenceLine(ref_points);
91 return true;
92}
static void RemoveDuplicates(std::vector< ReferencePoint > *points)
#define AERROR
Definition log.h:44

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