Apollo 11.0
自动驾驶开放平台
spline_1d_kernel.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
23#pragma once
24
25#include <vector>
26
27#include "Eigen/Core"
28
30
31namespace apollo {
32namespace planning {
33
35 public:
36 explicit Spline1dKernel(const Spline1d& spline1d);
37 Spline1dKernel(const std::vector<double>& x_knots,
38 const uint32_t spline_order);
39
40 // customized input / output method
41 void AddRegularization(const double regularized_param);
42 bool AddKernel(const Eigen::MatrixXd& kernel, const Eigen::MatrixXd& offset,
43 const double weight);
44 bool AddKernel(const Eigen::MatrixXd& kernel, const double weight);
45
46 Eigen::MatrixXd* mutable_kernel_matrix();
47 Eigen::MatrixXd* mutable_offset();
48
49 const Eigen::MatrixXd& kernel_matrix() const;
50 const Eigen::MatrixXd& offset() const;
51
52 // build-in kernel methods
53 void AddDerivativeKernelMatrix(const double weight);
54 void AddSecondOrderDerivativeMatrix(const double weight);
55 void AddThirdOrderDerivativeMatrix(const double weight);
56 void AddDerivativeKernelMatrixForSplineK(const uint32_t k,
57 const double weight);
58 void AddSecondOrderDerivativeMatrixForSplineK(const uint32_t k,
59 const double weight);
60 void AddThirdOrderDerivativeMatrixForSplineK(const uint32_t k,
61 const double weight);
62
63 // reference line kernel, x_coord in strictly increasing order (for path
64 // optimizer)
65 bool AddReferenceLineKernelMatrix(const std::vector<double>& x_coord,
66 const std::vector<double>& ref_fx,
67 const double weight);
68
69 // distance offset (for speed optimizer, given time optimize the distance can
70 // go)
71 void AddDistanceOffset(const double weight);
72
73 private:
74 void AddNthDerivativekernelMatrix(const uint32_t n, const double weight);
75 void AddNthDerivativekernelMatrixForSplineK(const uint32_t n,
76 const uint32_t k,
77 const double weight);
78 uint32_t FindIndex(const double x) const;
79
80 private:
81 Eigen::MatrixXd kernel_matrix_;
82 Eigen::MatrixXd offset_;
83 std::vector<double> x_knots_;
84 uint32_t spline_order_;
85 uint32_t total_params_;
86};
87
88} // namespace planning
89} // namespace apollo
void AddSecondOrderDerivativeMatrix(const double weight)
void AddDerivativeKernelMatrixForSplineK(const uint32_t k, const double weight)
void AddDistanceOffset(const double weight)
void AddRegularization(const double regularized_param)
const Eigen::MatrixXd & kernel_matrix() const
const Eigen::MatrixXd & offset() const
void AddThirdOrderDerivativeMatrix(const double weight)
void AddThirdOrderDerivativeMatrixForSplineK(const uint32_t k, const double weight)
Eigen::MatrixXd * mutable_kernel_matrix()
void AddDerivativeKernelMatrix(const double weight)
void AddSecondOrderDerivativeMatrixForSplineK(const uint32_t k, const double weight)
bool AddKernel(const Eigen::MatrixXd &kernel, const Eigen::MatrixXd &offset, const double weight)
bool AddReferenceLineKernelMatrix(const std::vector< double > &x_coord, const std::vector< double > &ref_fx, const double weight)
Planning module main class.
class register implement
Definition arena_queue.h:37
: piecewise smoothing spline class