Apollo 11.0
自动驾驶开放平台
discrete_points_reference_line_smoother.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
17#pragma once
18
19#include <utility>
20#include <vector>
21
22#include "modules/planning/planning_base/proto/reference_line_smoother_config.pb.h"
23
27
28namespace apollo {
29namespace planning {
30
32 public:
34 const ReferenceLineSmootherConfig& config);
35
37
38 bool Smooth(const ReferenceLine& raw_reference_line,
39 ReferenceLine* const smoothed_reference_line) override;
40
41 void SetAnchorPoints(const std::vector<AnchorPoint>&) override;
42
43 private:
44 bool CosThetaSmooth(
45 const std::vector<std::pair<double, double>>& raw_point2d,
46 const std::vector<double>& bounds,
47 std::vector<std::pair<double, double>>* ptr_smoothed_point2d);
48
49 bool FemPosSmooth(
50 const std::vector<std::pair<double, double>>& raw_point2d,
51 const std::vector<double>& bounds,
52 std::vector<std::pair<double, double>>* ptr_smoothed_point2d);
53
54 void NormalizePoints(std::vector<std::pair<double, double>>* xy_points);
55
56 void DeNormalizePoints(std::vector<std::pair<double, double>>* xy_points);
57
58 bool GenerateRefPointProfile(
59 const ReferenceLine& raw_reference_line,
60 const std::vector<std::pair<double, double>>& xy_points,
61 std::vector<ReferencePoint>* reference_points);
62
63 std::vector<AnchorPoint> anchor_points_;
64
65 double zero_x_ = 0.0;
66
67 double zero_y_ = 0.0;
68};
69
70} // namespace planning
71} // namespace apollo
bool Smooth(const ReferenceLine &raw_reference_line, ReferenceLine *const smoothed_reference_line) override
Smooth a given reference line
void SetAnchorPoints(const std::vector< AnchorPoint > &) override
Smoothing constraints
Planning module main class.
class register implement
Definition arena_queue.h:37