Apollo 11.0
自动驾驶开放平台
path_reference_decider.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2020 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 <string>
25#include <vector>
26
27#include "modules/planning/planning_base/proto/planning_config.pb.h"
28#include "modules/planning/tasks/path_reference_decider/proto/path_reference_decider.pb.h"
32
33namespace apollo {
34namespace planning {
35class PathReferenceDecider : public Task {
36 public:
37 bool Init(const std::string &config_dir, const std::string &name,
38 const std::shared_ptr<DependencyInjector> &injector) override;
39
41 Frame *frame, ReferenceLineInfo *reference_line_info) override;
42
43 private:
44 apollo::common::Status Process(Frame *frame,
45 ReferenceLineInfo *reference_line_info);
46
55 bool IsValidPathReference(
56 const ReferenceLineInfo &reference_line_info,
57 const PathBoundary &path_bound,
58 const std::vector<common::PathPoint> &path_reference);
59
64 void PathBoundToLineSegments(
65 const PathBoundary &path_bound,
66 std::vector<std::vector<common::math::LineSegment2d>>
67 *path_bound_segments);
68
76 void EvaluatePathReference(
77 const PathBoundary &path_bound,
78 const std::vector<common::PathPoint> &path_reference,
79 std::vector<common::PathPoint> *evaluated_path_reference);
80
91 int IsPointWithinPathBounds(const ReferenceLineInfo &reference_line_info,
92 const PathBoundary &path_bound, const double x,
93 const double y);
94
101 size_t GetRegularPathBound(
102 const std::vector<PathBoundary> &path_bounds) const;
103
113 bool IsADCBoxAlongPathReferenceWithinPathBounds(
114 const std::vector<common::TrajectoryPoint> &path_reference,
115 const PathBoundary &regular_path_bound);
116
117 void ConvertTrajectoryToPath(
118 const std::vector<common::TrajectoryPoint> &trajectory,
119 std::vector<common::PathPoint> *path);
120
121 void RecordDebugInfo(const std::vector<common::PathPoint> &path_points,
122 const std::string &path_name,
123 ReferenceLineInfo *const reference_line_info);
124
125 private:
126 static int valid_path_reference_counter_; // count valid path reference
127 static int total_path_counter_; // count total path
128 PathReferenceDeciderConfig config_; // the config the task
129};
130
132 Task)
133
134} // namespace planning
135} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
Frame holds all data for one planning cycle.
Definition frame.h:62
bool Init(const std::string &config_dir, const std::string &name, const std::shared_ptr< DependencyInjector > &injector) override
apollo::common::Status Execute(Frame *frame, ReferenceLineInfo *reference_line_info) override
ReferenceLineInfo holds all data for one reference line.
Planning module main class.
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
class register implement
Definition arena_queue.h:37