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

#include <frenet_frame_path.h>

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

Public 成员函数

 FrenetFramePath ()=default
 
 FrenetFramePath (std::vector< common::FrenetFramePoint > points)
 
double Length () const
 
common::FrenetFramePoint EvaluateByS (const double s) const
 
common::FrenetFramePoint GetNearestPoint (const SLBoundary &sl) const
 Get the FrenetFramePoint that is within SLBoundary, or the one with smallest l() in SLBoundary's s range [start_s(), end_s()]
 

详细描述

在文件 frenet_frame_path.h 第 32 行定义.

构造及析构函数说明

◆ FrenetFramePath() [1/2]

apollo::planning::FrenetFramePath::FrenetFramePath ( )
default

◆ FrenetFramePath() [2/2]

apollo::planning::FrenetFramePath::FrenetFramePath ( std::vector< common::FrenetFramePoint >  points)
explicit

在文件 frenet_frame_path.cc 第 33 行定义.

34 : std::vector<FrenetFramePoint>(std::move(points)) {}

成员函数说明

◆ EvaluateByS()

FrenetFramePoint apollo::planning::FrenetFramePath::EvaluateByS ( const double  s) const

在文件 frenet_frame_path.cc 第 73 行定义.

73 {
74 CHECK_GT(size(), 1U);
75 auto it_lower = std::lower_bound(begin(), end(), s, LowerBoundComparator);
76 if (it_lower == begin()) {
77 return front();
78 } else if (it_lower == end()) {
79 return back();
80 }
81 const auto& p0 = *(it_lower - 1);
82 const auto s0 = p0.s();
83 const auto& p1 = *it_lower;
84 const auto s1 = p1.s();
85
86 FrenetFramePoint p;
87 p.set_s(s);
88 p.set_l(common::math::lerp(p0.l(), s0, p1.l(), s1, s));
89 p.set_dl(common::math::lerp(p0.dl(), s0, p1.dl(), s1, s));
90 p.set_ddl(common::math::lerp(p0.ddl(), s0, p1.ddl(), s1, s));
91 return p;
92}
T lerp(const T &x0, const double t0, const T &x1, const double t1, const double t)
Linear interpolation between two points of type T.

◆ GetNearestPoint()

FrenetFramePoint apollo::planning::FrenetFramePath::GetNearestPoint ( const SLBoundary &  sl) const

Get the FrenetFramePoint that is within SLBoundary, or the one with smallest l() in SLBoundary's s range [start_s(), end_s()]

在文件 frenet_frame_path.cc 第 43 行定义.

43 {
44 auto it_lower =
45 std::lower_bound(begin(), end(), sl.start_s(), LowerBoundComparator);
46 if (it_lower == end()) {
47 return back();
48 }
49 auto it_upper =
50 std::upper_bound(it_lower, end(), sl.end_s(), UpperBoundComparator);
51 double min_dist = std::numeric_limits<double>::max();
52 auto min_it = it_upper;
53 for (auto it = it_lower; it != it_upper; ++it) {
54 if (it->l() >= sl.start_l() && it->l() <= sl.end_l()) {
55 return *it;
56 } else if (it->l() > sl.end_l()) {
57 double diff = it->l() - sl.end_l();
58 if (diff < min_dist) {
59 min_dist = diff;
60 min_it = it;
61 }
62 } else {
63 double diff = sl.start_l() - it->l();
64 if (diff < min_dist) {
65 min_dist = diff;
66 min_it = it;
67 }
68 }
69 }
70 return *min_it;
71}
float diff(Image< float > *I, int x1, int y1, int x2, int y2)
Dissimilarity measure between pixels

◆ Length()

double apollo::planning::FrenetFramePath::Length ( ) const

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

36 {
37 if (empty()) {
38 return 0.0;
39 }
40 return back().s() - front().s();
41}

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