Apollo 11.0
自动驾驶开放平台
piecewise_jerk_path_problem.h
浏览该文件的文档.
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
28namespace apollo {
29namespace 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 void set_extra_constraints(const ObsCornerConstraints& extra_constraints) {
56 extra_constraints_ = extra_constraints;
57 }
58
60 vertex_constraints_ = vertexs;
61 }
62
63 protected:
64 void CalculateKernel(std::vector<c_float>* P_data,
65 std::vector<c_int>* P_indices,
66 std::vector<c_int>* P_indptr) override;
67
68 void CalculateOffset(std::vector<c_float>* q) override;
69
70 void CalculateAffineConstraint(std::vector<c_float>* A_data,
71 std::vector<c_int>* A_indices,
72 std::vector<c_int>* A_indptr,
73 std::vector<c_float>* lower_bounds,
74 std::vector<c_float>* upper_bounds) override;
75
76 OSQPSettings* SolverDefaultSettings() override;
77
78 private:
79 ObsCornerConstraints extra_constraints_;
80 ADCVertexConstraints vertex_constraints_;
81};
82
83} // namespace planning
84} // namespace apollo
void CalculateOffset(std::vector< c_float > *q) override
void set_vertex_constraints(const ADCVertexConstraints &vertexs)
void CalculateAffineConstraint(std::vector< c_float > *A_data, std::vector< c_int > *A_indices, std::vector< c_int > *A_indptr, std::vector< c_float > *lower_bounds, std::vector< c_float > *upper_bounds) override
void CalculateKernel(std::vector< c_float > *P_data, std::vector< c_int > *P_indices, std::vector< c_int > *P_indptr) override
void set_extra_constraints(const ObsCornerConstraints &extra_constraints)
Planning module main class.
class register implement
Definition arena_queue.h:37