Apollo 11.0
自动驾驶开放平台
quartic_polynomial_curve1d.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
21#pragma once
22
23#include <array>
24#include <string>
25
27
28namespace apollo {
29namespace planning {
30
31// 1D quartic polynomial curve: (x0, dx0, ddx0) -- [0, param] --> (dx1, ddx1)
33 public:
35
36 QuarticPolynomialCurve1d(const std::array<double, 3>& start,
37 const std::array<double, 2>& end,
38 const double param);
39
40 QuarticPolynomialCurve1d(const double x0, const double dx0, const double ddx0,
41 const double dx1, const double ddx1,
42 const double param);
43
45
46 virtual ~QuarticPolynomialCurve1d() = default;
47
48 double Evaluate(const std::uint32_t order, const double p) const override;
49
62 const double x0, const double dx0, const double ddx0, const double x1,
63 const double dx1, const double param);
64
70 const double x0, const double dx0, const double x1, const double dx1,
71 const double ddx1, const double param);
72
73 /*
74 * Integrated from cubic curve with init value
75 */
77 const PolynomialCurve1d& other, const double init_value);
78
79 /*
80 * Derived from quintic curve
81 */
83 const PolynomialCurve1d& other);
84
85 double ParamLength() const override { return param_; }
86
87 std::string ToString() const override;
88
89 double Coef(const size_t order) const override;
90
91 size_t Order() const override { return 4; }
92
93 private:
94 void ComputeCoefficients(const double x0, const double dx0, const double ddx0,
95 const double dx1, const double ddx1,
96 const double param);
97
98 std::array<double, 5> coef_ = {{0.0, 0.0, 0.0, 0.0, 0.0}};
99 std::array<double, 3> start_condition_ = {{0.0, 0.0, 0.0}};
100 std::array<double, 2> end_condition_ = {{0.0, 0.0}};
101};
102
103} // namespace planning
104} // namespace apollo
QuarticPolynomialCurve1d & IntegratedFromCubicCurve(const PolynomialCurve1d &other, const double init_value)
double Coef(const size_t order) const override
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 ...
double Evaluate(const std::uint32_t order, const double p) const override
QuarticPolynomialCurve1d & DerivedFromQuinticCurve(const PolynomialCurve1d &other)
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 con...
Planning module main class.
class register implement
Definition arena_queue.h:37