Apollo  6.0
Open source self driving car software
piecewise_jerk_path_problem.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 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 
28 namespace apollo {
29 namespace planning {
30 
31 /*
32  * @brief:
33  * FEM stands for finite element method.
34  * This class solve an optimization problem:
35  * x
36  * |
37  * | P(s1, x1) P(s2, x2)
38  * | P(s0, x0) ... P(s(k-1), x(k-1))
39  * |P(start)
40  * |
41  * |________________________________________________________ s
42  *
43  * we suppose s(k+1) - s(k) == s(k) - s(k-1)
44  *
45  * Given the x, x', x'' at P(start), The goal is to find x0, x1, ... x(k-1)
46  * which makes the line P(start), P0, P(1) ... P(k-1) "smooth".
47  */
48 
50  public:
51  PiecewiseJerkPathProblem(const size_t num_of_knots, const double delta_s,
52  const std::array<double, 3>& x_init);
53 
54  virtual ~PiecewiseJerkPathProblem() = default;
55 
56  protected:
57  void CalculateKernel(std::vector<c_float>* P_data,
58  std::vector<c_int>* P_indices,
59  std::vector<c_int>* P_indptr) override;
60 
61  void CalculateOffset(std::vector<c_float>* q) override;
62 };
63 
64 } // namespace planning
65 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
void CalculateKernel(std::vector< c_float > *P_data, std::vector< c_int > *P_indices, std::vector< c_int > *P_indptr) override
Planning module main class. It processes GPS and IMU as input, to generate planning info...
Definition: piecewise_jerk_path_problem.h:49
PiecewiseJerkPathProblem(const size_t num_of_knots, const double delta_s, const std::array< double, 3 > &x_init)
Definition: piecewise_jerk_problem.h:49
void CalculateOffset(std::vector< c_float > *q) override