Apollo 11.0
自动驾驶开放平台
osqp_spline_2d_solver.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 <vector>
24
25#include "gtest/gtest_prod.h"
26
27#include "osqp/osqp.h"
28
31
32namespace apollo {
33namespace planning {
34
35class OsqpSpline2dSolver final : public Spline2dSolver {
36 public:
37 OsqpSpline2dSolver(const std::vector<double>& t_knots, const uint32_t order);
38
39 void Reset(const std::vector<double>& t_knots, const uint32_t order) override;
40
41 // customize setup
44 Spline2d* mutable_spline() override;
45
46 // solve
47 bool Solve() override;
48
49 // extract
50 const Spline2d& spline() const override;
51
52 private:
53 FRIEND_TEST(OSQPSolverTest, basic_test);
54
55 private:
56 OSQPSettings* osqp_settings_ = nullptr;
57 OSQPWorkspace* work_ = nullptr; // Workspace
58 OSQPData* data_ = nullptr; // OSQPData
59
60 int last_num_constraint_ = 0;
61 int last_num_param_ = 0;
62 bool last_problem_success_ = false;
63};
64
65} // namespace planning
66} // namespace apollo
const Spline2d & spline() const override
Spline2dConstraint * mutable_constraint() override
void Reset(const std::vector< double > &t_knots, const uint32_t order) override
Spline2dKernel * mutable_kernel() override
Planning module main class.
class register implement
Definition arena_queue.h:37
: piecewise smoothing spline 2d class