Apollo 11.0
自动驾驶开放平台
lane_borrow_path_generic.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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 <tuple>
26#include <vector>
27#include <unordered_map>
28
29#include "modules/planning/tasks/lane_borrow_path_generic/proto/lane_borrow_path_generic.pb.h"
30
34
35namespace apollo {
36namespace planning {
37
40public:
41 bool Init(
42 const std::string& config_dir,
43 const std::string& name,
44 const std::shared_ptr<DependencyInjector>& injector) override;
45
46private:
47 apollo::common::Status Process(Frame* frame, ReferenceLineInfo* reference_line_info) override;
52 bool DecidePathBounds(std::vector<PathBoundary>* boundary);
58 bool OptimizePath(const std::vector<PathBoundary>& path_boundaries, std::vector<PathData>* candidate_path_data);
64 bool AssessPath(std::vector<PathData>* candidate_path_data, PathData* final_path);
70 bool GetBoundaryFromNeighborLane(
71 const SidePassDirection pass_direction,
72 PathBoundary* const path_bound,
73 std::string* borrow_lane_type);
74
75 bool GetBoundaryFromNudgeDecision(const SidePassDirection pass_direction, PathBoundary* const path_bound);
76
81 bool IsNecessaryToBorrowLane();
82
83 bool HasSingleReferenceLine(const Frame& frame);
84
85 bool IsWithinSidePassingSpeedADC(const Frame& frame);
86
87 bool IsLongTermBlockingObstacle();
88
89 bool IsSidePassableObstacle(const ReferenceLineInfo& reference_line_info);
90
91 bool IsEnableNudge(const ReferenceLineInfo& reference_line_info);
92
93 void UpdateSelfPathInfo();
94
95 bool IsNudgeFinish();
104 void CheckLaneBorrow(
105 const ReferenceLineInfo& reference_line_info,
106 bool* left_neighbor_lane_borrowable,
107 bool* right_neighbor_lane_borrowable);
115 bool CheckLaneBoundaryType(
116 const ReferenceLineInfo& reference_line_info,
117 const double check_s,
118 const SidePassDirection& lane_borrow_info);
125 void SetPathInfo(PathData* const path_data);
126
127 void GetSLPolygons(std::vector<SLPolygon>* polygons, LaneBorrowInfo lane_borrow_info);
128
130 std::vector<SidePassDirection> decided_side_pass_direction_;
131 int use_self_lane_;
132 std::string blocking_obstacle_id_;
133 bool is_in_path_lane_borrow_scenario_ = false;
134 std::unordered_map<std::string, double> narrowest_width_;
135};
136
138// Below are helper functions.
139
141 const std::vector<std::tuple<double, PathData::PathPointType, double>>& path_point_decision);
142
143int GetBackToInLaneIndex(const std::vector<std::tuple<double, PathData::PathPointType, double>>& path_point_decision);
144
145bool ComparePathData(
146 const ReferenceLineInfo& reference_line_info,
147 const PathData& lhs,
148 const PathData& rhs,
149 const Obstacle* blocking_obstacle,
150 const std::unordered_map<std::string, double>& narrowest_width);
151
153} // namespace planning
154} // 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
This is the class that associates an Obstacle with its path properties.
Definition obstacle.h:62
ReferenceLineInfo holds all data for one reference line.
Planning module main class.
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
int GetBackToInLaneIndex(const std::vector< PathPointDecision > &path_point_decision)
int ContainsOutOnReverseLane(const std::vector< PathPointDecision > &path_point_decision)
bool ComparePathData(const PathData &lhs, const PathData &rhs, const Obstacle *blocking_obstacle)
class register implement
Definition arena_queue.h:37