Apollo  6.0
Open source self driving car software
fem_pos_deviation_smoother.h
Go to the documentation of this file.
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/proto/math/fem_pos_deviation_smoother_config.pb.h"
27 
28 namespace apollo {
29 namespace planning {
30 
31 /*
32  * @brief:
33  * This class solve an optimization problem:
34  * Y
35  * |
36  * | P(x1, y1) P(x2, y2)
37  * | P(x0, y0) ... P(x(k-1), y(k-1))
38  * |P(start)
39  * |
40  * |________________________________________________________ X
41  *
42  *
43  * Given an initial set of points from 0 to k-1, The goal is to find a set of
44  * points which makes the line P(start), P0, P(1) ... P(k-1) "smooth".
45  */
46 
48  public:
49  explicit FemPosDeviationSmoother(const FemPosDeviationSmootherConfig& config);
50 
51  bool Solve(const std::vector<std::pair<double, double>>& raw_point2d,
52  const std::vector<double>& bounds, std::vector<double>* opt_x,
53  std::vector<double>* opt_y);
54 
55  bool QpWithOsqp(const std::vector<std::pair<double, double>>& raw_point2d,
56  const std::vector<double>& bounds, std::vector<double>* opt_x,
57  std::vector<double>* opt_y);
58 
59  bool NlpWithIpopt(const std::vector<std::pair<double, double>>& raw_point2d,
60  const std::vector<double>& bounds,
61  std::vector<double>* opt_x, std::vector<double>* opt_y);
62 
63  bool SqpWithOsqp(const std::vector<std::pair<double, double>>& raw_point2d,
64  const std::vector<double>& bounds,
65  std::vector<double>* opt_x, std::vector<double>* opt_y);
66 
67  private:
68  FemPosDeviationSmootherConfig config_;
69 };
70 } // namespace planning
71 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
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)
Definition: fem_pos_deviation_smoother.h:47
FemPosDeviationSmoother(const FemPosDeviationSmootherConfig &config)
Planning module main class. It processes GPS and IMU as input, to generate planning info...
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 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 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)