Apollo 11.0
自动驾驶开放平台
fem_pos_deviation_smoother.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2019 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
26#include "modules/planning/planning_base/proto/math/fem_pos_deviation_smoother_config.pb.h"
28
29namespace apollo {
30namespace planning {
31
32/*
33 * @brief:
34 * This class solve an optimization problem:
35 * Y
36 * |
37 * | P(x1, y1) P(x2, y2)
38 * | P(x0, y0) ... P(x(k-1), y(k-1))
39 * |P(start)
40 * |
41 * |________________________________________________________ X
42 *
43 *
44 * Given an initial set of points from 0 to k-1, The goal is to find a set of
45 * points which makes the line P(start), P0, P(1) ... P(k-1) "smooth".
46 */
47
49 public:
51
52 bool QpWithOsqp(const std::vector<std::pair<double, double>>& raw_point2d,
53 const std::vector<double>& bounds, std::vector<double>* opt_x,
54 std::vector<double>* opt_y);
55
56 bool NlpWithIpopt(const std::vector<std::pair<double, double>>& raw_point2d,
57 const std::vector<double>& bounds,
58 std::vector<double>* opt_x, std::vector<double>* opt_y);
59
60 bool SqpWithOsqp(const std::vector<std::pair<double, double>>& raw_point2d,
61 const std::vector<double>& bounds,
62 std::vector<double>* opt_x, std::vector<double>* opt_y);
63
64 private:
66
67 // park generic
68 public:
69 bool Solve(const std::vector<std::pair<double, double>>& raw_point2d,
70 const std::vector<double>& bounds, std::vector<double>* opt_x,
71 std::vector<double>* opt_y,
72 std::vector<std::vector<common::math::Vec2d>> point_box = {});
73
74 bool SqpWithOsqp(const std::vector<std::pair<double, double>>& raw_point2d,
75 const std::vector<double>& bounds,
76 std::vector<double>* opt_x, std::vector<double>* opt_y,
77 std::vector<std::vector<common::math::Vec2d>> point_box);
78};
79} // namespace planning
80} // namespace apollo
bool QpWithOsqp(const std::vector< std::pair< double, double > > &raw_point2d, const std::vector< double > &bounds, std::vector< double > *opt_x, std::vector< double > *opt_y)
bool NlpWithIpopt(const std::vector< std::pair< double, double > > &raw_point2d, const std::vector< double > &bounds, std::vector< double > *opt_x, std::vector< double > *opt_y)
bool SqpWithOsqp(const std::vector< std::pair< double, double > > &raw_point2d, const std::vector< double > &bounds, std::vector< double > *opt_x, std::vector< double > *opt_y)
bool Solve(const std::vector< std::pair< double, double > > &raw_point2d, const std::vector< double > &bounds, std::vector< double > *opt_x, std::vector< double > *opt_y, std::vector< std::vector< common::math::Vec2d > > point_box={})
Planning module main class.
class register implement
Definition arena_queue.h:37
Defines the Vec2d class.