Apollo 11.0
自动驾驶开放平台
spline_2d_seg.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 <utility>
24#include <vector>
25
27
28namespace apollo {
29namespace planning {
30
32 public:
33 // order represent the number of parameters (not the highest order);
34 explicit Spline2dSeg(const uint32_t order);
35 Spline2dSeg(const std::vector<double>& x_param,
36 const std::vector<double>& y_param);
37 ~Spline2dSeg() = default;
38
39 bool SetParams(const std::vector<double>& x_param,
40 const std::vector<double>& y_param);
41
42 std::pair<double, double> operator()(const double t) const;
43 double x(const double t) const;
44 double y(const double t) const;
45 double DerivativeX(const double t) const;
46 double DerivativeY(const double t) const;
47 double SecondDerivativeX(const double t) const;
48 double SecondDerivativeY(const double t) const;
49 double ThirdDerivativeX(const double t) const;
50 double ThirdDerivativeY(const double t) const;
51
52 const PolynomialXd& spline_func_x() const;
53 const PolynomialXd& spline_func_y() const;
54 const PolynomialXd& DerivativeX() const;
55 const PolynomialXd& DerivativeY() const;
56 const PolynomialXd& SecondDerivativeX() const;
57 const PolynomialXd& SecondDerivativeY() const;
58 const PolynomialXd& ThirdDerivativeX() const;
59 const PolynomialXd& ThirdDerivativeY() const;
60
61 private:
62 PolynomialXd spline_func_x_;
63 PolynomialXd spline_func_y_;
64 PolynomialXd derivative_x_;
65 PolynomialXd derivative_y_;
66 PolynomialXd second_derivative_x_;
67 PolynomialXd second_derivative_y_;
68 PolynomialXd third_derivative_x_;
69 PolynomialXd third_derivative_y_;
70};
71
72} // namespace planning
73} // namespace apollo
const PolynomialXd & ThirdDerivativeY() const
const PolynomialXd & SecondDerivativeY() const
bool SetParams(const std::vector< double > &x_param, const std::vector< double > &y_param)
const PolynomialXd & ThirdDerivativeX() const
const PolynomialXd & DerivativeX() const
std::pair< double, double > operator()(const double t) const
const PolynomialXd & SecondDerivativeX() const
const PolynomialXd & spline_func_y() const
const PolynomialXd & DerivativeY() const
double y(const double t) const
double x(const double t) const
const PolynomialXd & spline_func_x() const
Planning module main class.
class register implement
Definition arena_queue.h:37