Apollo  6.0
Open source self driving car software
spline_seg_kernel.h
Go to the documentation of this file.
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 
25 #pragma once
26 
27 #include <string>
28 
29 #include "Eigen/Core"
30 #include "cyber/common/macros.h"
31 
32 namespace apollo {
33 namespace planning {
34 
36  public:
37  // generating kernel matrix
38  Eigen::MatrixXd Kernel(const uint32_t num_params, const double accumulated_x);
39 
40  // only support N <= 3 cases
41  Eigen::MatrixXd NthDerivativeKernel(const uint32_t n,
42  const uint32_t num_params,
43  const double accumulated_x);
44 
45  private:
46  Eigen::MatrixXd DerivativeKernel(const uint32_t num_of_params,
47  const double accumulated_x);
48  Eigen::MatrixXd SecondOrderDerivativeKernel(const uint32_t num_of_params,
49  const double accumulated_x);
50  Eigen::MatrixXd ThirdOrderDerivativeKernel(const uint32_t num_of_params,
51  const double accumulated_x);
52 
53  void IntegratedTermMatrix(const uint32_t num_of_params, const double x,
54  const std::string& type,
55  Eigen::MatrixXd* term_matrix) const;
56  void CalculateFx(const uint32_t num_of_params);
57  void CalculateDerivative(const uint32_t num_of_params);
58  void CalculateSecondOrderDerivative(const uint32_t num_of_params);
59  void CalculateThirdOrderDerivative(const uint32_t num_of_params);
60 
61  const uint32_t reserved_order_ = 5;
62  Eigen::MatrixXd kernel_fx_;
63  Eigen::MatrixXd kernel_derivative_;
64  Eigen::MatrixXd kernel_second_order_derivative_;
65  Eigen::MatrixXd kernel_third_order_derivative_;
66 
68 };
69 
70 } // namespace planning
71 } // namespace apollo
Definition: spline_seg_kernel.h:35
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Planning module main class. It processes GPS and IMU as input, to generate planning info...
Eigen::MatrixXd Kernel(const uint32_t num_params, const double accumulated_x)
Eigen::MatrixXd NthDerivativeKernel(const uint32_t n, const uint32_t num_params, const double accumulated_x)
#define DECLARE_SINGLETON(classname)
Definition: macros.h:52