Apollo  6.0
Open source self driving car software
discrete_points_reference_line_smoother.h
Go to the documentation of this file.
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 
17 #pragma once
18 
19 #include <utility>
20 #include <vector>
21 
22 #include "modules/planning/proto/reference_line_smoother_config.pb.h"
26 
27 namespace apollo {
28 namespace planning {
29 
31  public:
33  const ReferenceLineSmootherConfig& config);
34 
35  virtual ~DiscretePointsReferenceLineSmoother() = default;
36 
37  bool Smooth(const ReferenceLine& raw_reference_line,
38  ReferenceLine* const smoothed_reference_line) override;
39 
40  void SetAnchorPoints(const std::vector<AnchorPoint>&) override;
41 
42  private:
43  bool CosThetaSmooth(
44  const std::vector<std::pair<double, double>>& raw_point2d,
45  const std::vector<double>& bounds,
46  std::vector<std::pair<double, double>>* ptr_smoothed_point2d);
47 
48  bool FemPosSmooth(
49  const std::vector<std::pair<double, double>>& raw_point2d,
50  const std::vector<double>& bounds,
51  std::vector<std::pair<double, double>>* ptr_smoothed_point2d);
52 
53  void NormalizePoints(std::vector<std::pair<double, double>>* xy_points);
54 
55  void DeNormalizePoints(std::vector<std::pair<double, double>>* xy_points);
56 
57  bool GenerateRefPointProfile(
58  const ReferenceLine& raw_reference_line,
59  const std::vector<std::pair<double, double>>& xy_points,
60  std::vector<ReferencePoint>* reference_points);
61 
62  std::vector<AnchorPoint> anchor_points_;
63 
64  double zero_x_ = 0.0;
65 
66  double zero_y_ = 0.0;
67 };
68 
69 } // namespace planning
70 } // namespace apollo
DiscretePointsReferenceLineSmoother(const ReferenceLineSmootherConfig &config)
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: discrete_points_reference_line_smoother.h:30
void SetAnchorPoints(const std::vector< AnchorPoint > &) override
bool Smooth(const ReferenceLine &raw_reference_line, ReferenceLine *const smoothed_reference_line) override
Definition: reference_line.h:39
Definition: reference_line_smoother.h:39