Apollo  6.0
Open source self driving car software
qp_spline_reference_line_smoother.h
Go to the documentation of this file.
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 <memory>
24 #include <vector>
25 
27 #include "modules/planning/proto/planning.pb.h"
28 #include "modules/planning/proto/reference_line_smoother_config.pb.h"
32 
33 namespace apollo {
34 namespace planning {
35 
37  public:
39  const ReferenceLineSmootherConfig& config);
40 
41  virtual ~QpSplineReferenceLineSmoother() = default;
42 
43  bool Smooth(const ReferenceLine& raw_reference_line,
44  ReferenceLine* const smoothed_reference_line) override;
45 
46  void SetAnchorPoints(const std::vector<AnchorPoint>& anchor_points) override;
47 
48  private:
49  void Clear();
50 
51  bool Sampling();
52 
53  bool AddConstraint();
54 
55  bool AddKernel();
56 
57  bool Solve();
58 
59  bool ExtractEvaluatedPoints(
60  const ReferenceLine& raw_reference_line, const std::vector<double>& vec_t,
61  std::vector<common::PathPoint>* const path_points) const;
62 
63  bool GetSFromParamT(const double t, double* const s) const;
64 
65  std::uint32_t FindIndex(const double t) const;
66 
67  private:
68  std::vector<double> t_knots_;
69  std::vector<AnchorPoint> anchor_points_;
70  std::unique_ptr<Spline2dSolver> spline_solver_;
71 
72  double ref_x_ = 0.0;
73  double ref_y_ = 0.0;
74 };
75 
76 } // namespace planning
77 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Planning module main class. It processes GPS and IMU as input, to generate planning info...
Definition: qp_spline_reference_line_smoother.h:36
bool Smooth(const ReferenceLine &raw_reference_line, ReferenceLine *const smoothed_reference_line) override
void SetAnchorPoints(const std::vector< AnchorPoint > &anchor_points) override
Definition: reference_line.h:39
Definition: reference_line_smoother.h:39
QpSplineReferenceLineSmoother(const ReferenceLineSmootherConfig &config)