#include <quartic_polynomial_curve1d.h>
|
| | QuarticPolynomialCurve1d ()=default |
| |
| | QuarticPolynomialCurve1d (const std::array< double, 3 > &start, const std::array< double, 2 > &end, const double param) |
| |
| | QuarticPolynomialCurve1d (const double x0, const double dx0, const double ddx0, const double dx1, const double ddx1, const double param) |
| |
| | QuarticPolynomialCurve1d (const QuarticPolynomialCurve1d &other) |
| |
| virtual | ~QuarticPolynomialCurve1d ()=default |
| |
| double | Evaluate (const std::uint32_t order, const double p) const override |
| |
| QuarticPolynomialCurve1d & | FitWithEndPointFirstOrder (const double x0, const double dx0, const double ddx0, const double x1, const double dx1, const double param) |
| | Interface with refine quartic polynomial by meets end first order and start second order boundary condition:
|
| |
| QuarticPolynomialCurve1d & | FitWithEndPointSecondOrder (const double x0, const double dx0, const double x1, const double dx1, const double ddx1, const double param) |
| | Interface with refine quartic polynomial by meets end point second order and start point first order boundary condition
|
| |
| QuarticPolynomialCurve1d & | IntegratedFromCubicCurve (const PolynomialCurve1d &other, const double init_value) |
| |
| QuarticPolynomialCurve1d & | DerivedFromQuinticCurve (const PolynomialCurve1d &other) |
| |
| double | ParamLength () const override |
| |
| std::string | ToString () const override |
| |
| double | Coef (const size_t order) const override |
| |
| size_t | Order () const override |
| |
| | PolynomialCurve1d ()=default |
| |
| virtual | ~PolynomialCurve1d ()=default |
| |
| | Curve1d ()=default |
| |
| virtual | ~Curve1d ()=default |
| |
◆ QuarticPolynomialCurve1d() [1/4]
| apollo::planning::QuarticPolynomialCurve1d::QuarticPolynomialCurve1d |
( |
| ) |
|
|
default |
◆ QuarticPolynomialCurve1d() [2/4]
| apollo::planning::QuarticPolynomialCurve1d::QuarticPolynomialCurve1d |
( |
const std::array< double, 3 > & |
start, |
|
|
const std::array< double, 2 > & |
end, |
|
|
const double |
param |
|
) |
| |
◆ QuarticPolynomialCurve1d() [3/4]
| apollo::planning::QuarticPolynomialCurve1d::QuarticPolynomialCurve1d |
( |
const double |
x0, |
|
|
const double |
dx0, |
|
|
const double |
ddx0, |
|
|
const double |
dx1, |
|
|
const double |
ddx1, |
|
|
const double |
param |
|
) |
| |
在文件 quartic_polynomial_curve1d.cc 第 37 行定义.
39 {
41 start_condition_[0] = x0;
42 start_condition_[1] = dx0;
43 start_condition_[2] = ddx0;
44 end_condition_[0] = dx1;
45 end_condition_[1] = ddx1;
46 ComputeCoefficients(x0, dx0, ddx0, dx1, ddx1, param);
47}
◆ QuarticPolynomialCurve1d() [4/4]
◆ ~QuarticPolynomialCurve1d()
| virtual apollo::planning::QuarticPolynomialCurve1d::~QuarticPolynomialCurve1d |
( |
| ) |
|
|
virtualdefault |
◆ Coef()
| double apollo::planning::QuarticPolynomialCurve1d::Coef |
( |
const size_t |
order | ) |
const |
|
overridevirtual |
◆ DerivedFromQuinticCurve()
在文件 quartic_polynomial_curve1d.cc 第 143 行定义.
144 {
145 CHECK_EQ(other.Order(), 5U);
146 param_ = other.ParamLength();
147 for (size_t i = 1; i < 6; ++i) {
148 coef_[i - 1] = other.Coef(i) * static_cast<double>(i);
149 }
150 return *this;
151}
◆ Evaluate()
| double apollo::planning::QuarticPolynomialCurve1d::Evaluate |
( |
const std::uint32_t |
order, |
|
|
const double |
p |
|
) |
| const |
|
overridevirtual |
实现了 apollo::planning::Curve1d.
在文件 quartic_polynomial_curve1d.cc 第 55 行定义.
56 {
57 switch (order) {
58 case 0: {
59 return (((coef_[4] * p + coef_[3]) * p + coef_[2]) * p + coef_[1]) * p +
60 coef_[0];
61 }
62 case 1: {
63 return ((4.0 * coef_[4] * p + 3.0 * coef_[3]) * p + 2.0 * coef_[2]) * p +
64 coef_[1];
65 }
66 case 2: {
67 return (12.0 * coef_[4] * p + 6.0 * coef_[3]) * p + 2.0 * coef_[2];
68 }
69 case 3: {
70 return 24.0 * coef_[4] * p + 6.0 * coef_[3];
71 }
72 case 4: {
73 return 24.0 * coef_[4];
74 }
75 default:
76 return 0.0;
77 }
78}
◆ FitWithEndPointFirstOrder()
| QuarticPolynomialCurve1d & apollo::planning::QuarticPolynomialCurve1d::FitWithEndPointFirstOrder |
( |
const double |
x0, |
|
|
const double |
dx0, |
|
|
const double |
ddx0, |
|
|
const double |
x1, |
|
|
const double |
dx1, |
|
|
const double |
param |
|
) |
| |
Interface with refine quartic polynomial by meets end first order and start second order boundary condition:
- 参数
-
| x0 | init point x location |
| dx0 | init point derivative |
| ddx0 | init point second order derivative |
| x1 | end point x location |
| dx1 | end point derivative |
| param | parameter length |
- 返回
- self
在文件 quartic_polynomial_curve1d.cc 第 80 行定义.
82 {
83 CHECK_GT(p, 0.0);
84
86
87 coef_[0] = x0;
88
89 coef_[1] = dx0;
90
91 coef_[2] = 0.5 * ddx0;
92
93 double p2 = p * p;
94 double p3 = p2 * p;
95 double p4 = p3 * p;
96
97 double b0 = x1 - coef_[0] - coef_[1] * p - coef_[2] * p2;
98 double b1 = dx1 - dx0 - ddx0 * p;
99
100 coef_[4] = (b1 * p - 3 * b0) / p4;
101 coef_[3] = (4 * b0 - b1 * p) / p3;
102 return *this;
103}
◆ FitWithEndPointSecondOrder()
| QuarticPolynomialCurve1d & apollo::planning::QuarticPolynomialCurve1d::FitWithEndPointSecondOrder |
( |
const double |
x0, |
|
|
const double |
dx0, |
|
|
const double |
x1, |
|
|
const double |
dx1, |
|
|
const double |
ddx1, |
|
|
const double |
param |
|
) |
| |
Interface with refine quartic polynomial by meets end point second order and start point first order boundary condition
在文件 quartic_polynomial_curve1d.cc 第 105 行定义.
107 {
108 CHECK_GT(p, 0.0);
109
111
112 coef_[0] = x0;
113
114 coef_[1] = dx0;
115
116 double p2 = p * p;
117 double p3 = p2 * p;
118 double p4 = p3 * p;
119
120 double b0 = x1 - coef_[0] - coef_[1] * p;
121 double b1 = dx1 - coef_[1];
122 double c1 = b1 * p;
123 double c2 = ddx1 * p2;
124
125 coef_[2] = (0.5 * c2 - 3 * c1 + 6 * b0) / p2;
126 coef_[3] = (-c2 + 5 * c1 - 8 * b0) / p3;
127 coef_[4] = (0.5 * c2 - 2 * c1 + 3 * b0) / p4;
128
129 return *this;
130}
◆ IntegratedFromCubicCurve()
在文件 quartic_polynomial_curve1d.cc 第 132 行定义.
133 {
134 CHECK_EQ(other.Order(), 3U);
135 param_ = other.ParamLength();
136 coef_[0] = init_value;
137 for (size_t i = 0; i < 4; ++i) {
138 coef_[i + 1] = other.Coef(i) / (static_cast<double>(i) + 1);
139 }
140 return *this;
141}
◆ Order()
| size_t apollo::planning::QuarticPolynomialCurve1d::Order |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ ParamLength()
| double apollo::planning::QuarticPolynomialCurve1d::ParamLength |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ ToString()
| std::string apollo::planning::QuarticPolynomialCurve1d::ToString |
( |
| ) |
const |
|
overridevirtual |
该类的文档由以下文件生成: