Apollo 11.0
自动驾驶开放平台
spline_2d_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
21#pragma once
22
23#include <vector>
24
25#include "Eigen/Core"
26
29
30namespace apollo {
31namespace planning {
32
34 public:
35 Spline2dKernel(const std::vector<double>& t_knots,
36 const uint32_t spline_order);
37
38 // customized input output
39 void AddRegularization(const double regularization_param);
40 bool AddKernel(const Eigen::MatrixXd& kernel, const Eigen::MatrixXd& offset,
41 const double weight);
42 bool AddKernel(const Eigen::MatrixXd& kernel, const double weight);
43
44 Eigen::MatrixXd* mutable_kernel_matrix();
45 Eigen::MatrixXd* mutable_offset();
46
47 Eigen::MatrixXd kernel_matrix() const;
48 const Eigen::MatrixXd offset() const;
49
50 // build-in kernel methods
51 void AddDerivativeKernelMatrix(const double weight);
52 void AddSecondOrderDerivativeMatrix(const double weight);
53 void AddThirdOrderDerivativeMatrix(const double weight);
54
55 // reference line kernel, x_coord in strictly increasing order
57 const std::vector<double>& t_coord,
58 const std::vector<common::math::Vec2d>& ref_points, const double weight);
59
60 private:
61 void AddNthDerivativeKernelMatrix(const uint32_t n, const double weight);
62 uint32_t find_index(const double x) const;
63
64 private:
65 Eigen::MatrixXd kernel_matrix_;
66 Eigen::MatrixXd offset_;
67 std::vector<double> t_knots_;
68 uint32_t spline_order_;
69 size_t total_params_;
70};
71
72} // namespace planning
73} // namespace apollo
Eigen::MatrixXd kernel_matrix() const
bool AddReferenceLineKernelMatrix(const std::vector< double > &t_coord, const std::vector< common::math::Vec2d > &ref_points, const double weight)
Eigen::MatrixXd * mutable_kernel_matrix()
bool AddKernel(const Eigen::MatrixXd &kernel, const Eigen::MatrixXd &offset, const double weight)
void AddRegularization(const double regularization_param)
void AddDerivativeKernelMatrix(const double weight)
void AddSecondOrderDerivativeMatrix(const double weight)
void AddThirdOrderDerivativeMatrix(const double weight)
const Eigen::MatrixXd offset() const
Planning module main class.
class register implement
Definition arena_queue.h:37
: piecewise smoothing spline 2d class
Defines the Vec2d class.