Apollo 11.0
自动驾驶开放平台
spiral_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
17/*
18 * spiral_reference_line_smoother.h
19 */
20
21#pragma once
22
23#include <vector>
24
25#include "Eigen/Dense"
26
27#include "modules/common_msgs/planning_msgs/planning.pb.h"
28
32
33namespace apollo {
34namespace planning {
35
37 public:
39 const ReferenceLineSmootherConfig& config);
40
41 virtual ~SpiralReferenceLineSmoother() = default;
42
43 bool Smooth(const ReferenceLine& raw_reference_line,
44 ReferenceLine* const smoothed_reference_line) override;
45
46 // For offline navigation line smoothing
47 int SmoothStandAlone(std::vector<Eigen::Vector2d> point2d,
48 std::vector<double>* ptr_theta,
49 std::vector<double>* ptr_kappa,
50 std::vector<double>* ptr_dkappa,
51 std::vector<double>* ptr_s, std::vector<double>* ptr_x,
52 std::vector<double>* ptr_y) const;
53
54 void SetAnchorPoints(const std::vector<AnchorPoint>&) override;
55
56 std::vector<common::PathPoint> Interpolate(const std::vector<double>& theta,
57 const std::vector<double>& kappa,
58 const std::vector<double>& dkappa,
59 const std::vector<double>& s,
60 const std::vector<double>& x,
61 const std::vector<double>& y,
62 const double resolution) const;
63
64 private:
65 bool Smooth(std::vector<Eigen::Vector2d> point2d,
66 std::vector<double>* ptr_theta, std::vector<double>* ptr_kappa,
67 std::vector<double>* ptr_dkappa, std::vector<double>* ptr_s,
68 std::vector<double>* ptr_x, std::vector<double>* ptr_y) const;
69
70 private:
71 std::vector<common::PathPoint> Interpolate(
72 const double start_x, const double start_y, const double start_s,
73 const double theta0, const double kappa0, const double dkappa0,
74 const double theta1, const double kappa1, const double dkappa1,
75 const double delta_s, const double resolution) const;
76
77 common::PathPoint to_path_point(const double x, const double y,
78 const double s, const double theta,
79 const double kappa,
80 const double dkappa) const;
81
82 std::vector<AnchorPoint> anchor_points_;
83
84 bool fixed_start_point_ = false;
85
86 double fixed_start_x_ = 0.0;
87
88 double fixed_start_y_ = 0.0;
89
90 double fixed_start_theta_ = 0.0;
91
92 double fixed_start_kappa_ = 0.0;
93
94 double fixed_start_dkappa_ = 0.0;
95
96 double fixed_end_x_ = 0.0;
97
98 double fixed_end_y_ = 0.0;
99
100 double zero_x_ = 0.0;
101
102 double zero_y_ = 0.0;
103};
104
105} // namespace planning
106} // namespace apollo
std::vector< common::PathPoint > Interpolate(const std::vector< double > &theta, const std::vector< double > &kappa, const std::vector< double > &dkappa, const std::vector< double > &s, const std::vector< double > &x, const std::vector< double > &y, const double resolution) const
int SmoothStandAlone(std::vector< Eigen::Vector2d > point2d, std::vector< double > *ptr_theta, std::vector< double > *ptr_kappa, std::vector< double > *ptr_dkappa, std::vector< double > *ptr_s, std::vector< double > *ptr_x, std::vector< double > *ptr_y) const
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