Apollo 11.0
自动驾驶开放平台
qp_spline_reference_line_smoother.h
浏览该文件的文档.
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
26#include "modules/common_msgs/planning_msgs/planning.pb.h"
27#include "modules/planning/planning_base/proto/reference_line_smoother_config.pb.h"
28
33
34namespace apollo {
35namespace planning {
36
38 public:
40 const ReferenceLineSmootherConfig& config);
41
42 virtual ~QpSplineReferenceLineSmoother() = default;
43
44 bool Smooth(const ReferenceLine& raw_reference_line,
45 ReferenceLine* const smoothed_reference_line) override;
46
47 void SetAnchorPoints(const std::vector<AnchorPoint>& anchor_points) override;
48
49 private:
50 void Clear();
51
52 bool Sampling();
53
54 bool AddConstraint();
55
56 bool AddKernel();
57
58 bool Solve();
59
60 bool ExtractEvaluatedPoints(
61 const ReferenceLine& raw_reference_line, const std::vector<double>& vec_t,
62 std::vector<common::PathPoint>* const path_points) const;
63
64 bool GetSFromParamT(const double t, double* const s) const;
65
66 std::uint32_t FindIndex(const double t) const;
67
68 private:
69 std::vector<double> t_knots_;
70 std::vector<AnchorPoint> anchor_points_;
71 std::unique_ptr<Spline2dSolver> spline_solver_;
72
73 double ref_x_ = 0.0;
74 double ref_y_ = 0.0;
75};
76
77} // namespace planning
78} // 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 > &anchor_points) override
Smoothing constraints
Planning module main class.
class register implement
Definition arena_queue.h:37