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

#include <cubic_polynomial_curve1d.h>

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

Public 成员函数

 CubicPolynomialCurve1d ()=default
 
virtual ~CubicPolynomialCurve1d ()=default
 
 CubicPolynomialCurve1d (const std::array< double, 3 > &start, const double end, const double param)
 
 CubicPolynomialCurve1d (const double x0, const double dx0, const double ddx0, const double x1, const double param)
 x0 is the value when f(x = 0); dx0 is the value when f'(x = 0); ddx0 is the value when f''(x = 0); f(x = param) = x1
 
void DerivedFromQuarticCurve (const PolynomialCurve1d &other)
 
double Evaluate (const std::uint32_t order, const double p) const override
 
double ParamLength () const override
 
std::string ToString () const override
 
double Coef (const size_t order) const override
 
size_t Order () const override
 
- Public 成员函数 继承自 apollo::planning::PolynomialCurve1d
 PolynomialCurve1d ()=default
 
virtual ~PolynomialCurve1d ()=default
 
- Public 成员函数 继承自 apollo::planning::Curve1d
 Curve1d ()=default
 
virtual ~Curve1d ()=default
 

额外继承的成员函数

- Protected 属性 继承自 apollo::planning::PolynomialCurve1d
double param_ = 0.0
 

详细描述

在文件 cubic_polynomial_curve1d.h 第 31 行定义.

构造及析构函数说明

◆ CubicPolynomialCurve1d() [1/3]

apollo::planning::CubicPolynomialCurve1d::CubicPolynomialCurve1d ( )
default

◆ ~CubicPolynomialCurve1d()

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

◆ CubicPolynomialCurve1d() [2/3]

apollo::planning::CubicPolynomialCurve1d::CubicPolynomialCurve1d ( const std::array< double, 3 > &  start,
const double  end,
const double  param 
)

在文件 cubic_polynomial_curve1d.cc 第 31 行定义.

33 : CubicPolynomialCurve1d(start[0], start[1], start[2], end, param) {}

◆ CubicPolynomialCurve1d() [3/3]

apollo::planning::CubicPolynomialCurve1d::CubicPolynomialCurve1d ( const double  x0,
const double  dx0,
const double  ddx0,
const double  x1,
const double  param 
)

x0 is the value when f(x = 0); dx0 is the value when f'(x = 0); ddx0 is the value when f''(x = 0); f(x = param) = x1

在文件 cubic_polynomial_curve1d.cc 第 35 行定义.

39 {
40 ComputeCoefficients(x0, dx0, ddx0, x1, param);
41 param_ = param;
42 start_condition_[0] = x0;
43 start_condition_[1] = dx0;
44 start_condition_[2] = ddx0;
45 end_condition_ = x1;
46}

成员函数说明

◆ Coef()

double apollo::planning::CubicPolynomialCurve1d::Coef ( const size_t  order) const
overridevirtual

实现了 apollo::planning::PolynomialCurve1d.

在文件 cubic_polynomial_curve1d.cc 第 95 行定义.

95 {
96 CHECK_GT(4U, order);
97 return coef_[order];
98}

◆ DerivedFromQuarticCurve()

void apollo::planning::CubicPolynomialCurve1d::DerivedFromQuarticCurve ( const PolynomialCurve1d &  other)

在文件 cubic_polynomial_curve1d.cc 第 48 行定义.

49 {
50 CHECK_EQ(other.Order(), 4U);
51 param_ = other.ParamLength();
52 for (size_t i = 1; i < 5; ++i) {
53 coef_[i - 1] = other.Coef(i) * static_cast<double>(i);
54 }
55}

◆ Evaluate()

double apollo::planning::CubicPolynomialCurve1d::Evaluate ( const std::uint32_t  order,
const double  p 
) const
overridevirtual

实现了 apollo::planning::Curve1d.

在文件 cubic_polynomial_curve1d.cc 第 57 行定义.

58 {
59 switch (order) {
60 case 0: {
61 return ((coef_[3] * p + coef_[2]) * p + coef_[1]) * p + coef_[0];
62 }
63 case 1: {
64 return (3.0 * coef_[3] * p + 2.0 * coef_[2]) * p + coef_[1];
65 }
66 case 2: {
67 return 6.0 * coef_[3] * p + 2.0 * coef_[2];
68 }
69 case 3: {
70 return 6.0 * coef_[3];
71 }
72 default:
73 return 0.0;
74 }
75}

◆ Order()

size_t apollo::planning::CubicPolynomialCurve1d::Order ( ) const
inlineoverridevirtual

实现了 apollo::planning::PolynomialCurve1d.

在文件 cubic_polynomial_curve1d.h 第 57 行定义.

57{ return 3; }

◆ ParamLength()

double apollo::planning::CubicPolynomialCurve1d::ParamLength ( ) const
inlineoverridevirtual

实现了 apollo::planning::Curve1d.

在文件 cubic_polynomial_curve1d.h 第 52 行定义.

52{ return param_; }

◆ ToString()

std::string apollo::planning::CubicPolynomialCurve1d::ToString ( ) const
overridevirtual

实现了 apollo::planning::Curve1d.

在文件 cubic_polynomial_curve1d.cc 第 77 行定义.

77 {
78 return absl::StrCat(absl::StrJoin(coef_, "\t"), param_, "\n");
79}

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