Apollo 11.0
自动驾驶开放平台
spline_1d.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
29#pragma once
30
31#include <vector>
32
36
37namespace apollo {
38namespace planning {
39
40class Spline1d {
41 public:
42 Spline1d(const std::vector<double>& x_knots, const uint32_t order);
43
44 // @brief: given x return f(x) value, derivative, second order derivative and
45 // the third order;
46 double operator()(const double x) const;
47 double Derivative(const double x) const;
48 double SecondOrderDerivative(const double x) const;
49 double ThirdOrderDerivative(const double x) const;
50
51 // @brief: set spline segments
52 bool SetSplineSegs(const Eigen::MatrixXd& param_matrix, const uint32_t order);
53
54 const std::vector<double>& x_knots() const;
55 uint32_t spline_order() const;
56
57 const std::vector<Spline1dSeg>& splines() const;
58
59 private:
60 uint32_t FindIndex(const double x) const;
61
62 private:
63 std::vector<Spline1dSeg> splines_;
64 std::vector<double> x_knots_;
65 uint32_t spline_order_;
66};
67
68} // namespace planning
69} // namespace apollo
double operator()(const double x) const
Definition spline_1d.cc:34
double SecondOrderDerivative(const double x) const
Definition spline_1d.cc:51
const std::vector< Spline1dSeg > & splines() const
Definition spline_1d.cc:90
uint32_t spline_order() const
Definition spline_1d.cc:88
double Derivative(const double x) const
Definition spline_1d.cc:42
const std::vector< double > & x_knots() const
Definition spline_1d.cc:86
double ThirdOrderDerivative(const double x) const
Definition spline_1d.cc:59
bool SetSplineSegs(const Eigen::MatrixXd &param_matrix, const uint32_t order)
Definition spline_1d.cc:67
Planning module main class.
class register implement
Definition arena_queue.h:37
: polynomial smoothing spline