Apollo 11.0
自动驾驶开放平台
spline_1d_solver.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
27#include "modules/planning/planning_base/proto/math/qp_problem.pb.h"
28
33
34namespace apollo {
35namespace planning {
36
38 public:
39 Spline1dSolver(const std::vector<double>& x_knots, const uint32_t order)
40 : spline_(x_knots, order),
41 constraint_(x_knots, order),
42 kernel_(x_knots, order) {}
43
44 virtual ~Spline1dSolver() = default;
45
46 virtual void Reset(const std::vector<double>& x_knots, const uint32_t order) {
47 spline_ = Spline1d(x_knots, order);
48 constraint_ = Spline1dConstraint(x_knots, order);
49 kernel_ = Spline1dKernel(x_knots, order);
50 }
51
55
57
58 virtual bool Solve() = 0;
59
60 // output
61 virtual const Spline1d& spline() const { return spline_; }
62
63 // convert qp problem to proto
64 void GenerateProblemProto(QuadraticProgrammingProblem* const qp_proto) const;
65
66 protected:
67 void ConvertMatrixXdToProto(const Eigen::MatrixXd& matrix,
68 QPMatrix* const proto) const;
69
70 protected:
74
78};
79
80} // namespace planning
81} // namespace apollo
virtual ~Spline1dSolver()=default
void ConvertMatrixXdToProto(const Eigen::MatrixXd &matrix, QPMatrix *const proto) const
virtual Spline1dKernel * mutable_spline_kernel()
virtual const Spline1d & spline() const
Spline1dSolver(const std::vector< double > &x_knots, const uint32_t order)
virtual void Reset(const std::vector< double > &x_knots, const uint32_t order)
void GenerateProblemProto(QuadraticProgrammingProblem *const qp_proto) const
virtual Spline1dConstraint * mutable_spline_constraint()
Planning module main class.
class register implement
Definition arena_queue.h:37
: quadratic programming base class
: piecewise smoothing spline class
: wrapp up solver constraint interface with direct methods and preset methods
: wrap up solver constraint interface with direct methods and preset methods