Apollo 11.0
自动驾驶开放平台
lane_borrow_path.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 "modules/planning/tasks/lane_borrow_path/proto/lane_borrow_path.pb.h"
30
31namespace apollo {
32namespace planning {
33
36 public:
37 bool Init(const std::string& config_dir, const std::string& name,
38 const std::shared_ptr<DependencyInjector>& injector) override;
39
40 private:
42 Frame* frame, ReferenceLineInfo* reference_line_info) override;
47 bool DecidePathBounds(std::vector<PathBoundary>* boundary);
53 bool OptimizePath(const std::vector<PathBoundary>& path_boundaries,
54 std::vector<PathData>* candidate_path_data);
60 bool AssessPath(std::vector<PathData>* candidate_path_data,
61 PathData* final_path);
67 bool GetBoundaryFromNeighborLane(const SidePassDirection pass_direction,
68 PathBoundary* const path_bound,
69 std::string* borrow_lane_type);
74 bool IsNecessaryToBorrowLane();
75
76 bool HasSingleReferenceLine(const Frame& frame);
77
78 bool IsWithinSidePassingSpeedADC(const Frame& frame);
79
80 bool IsLongTermBlockingObstacle();
81
82 bool IsBlockingObstacleWithinDestination(
83 const ReferenceLineInfo& reference_line_info);
84
85 bool IsBlockingObstacleFarFromIntersection(
86 const ReferenceLineInfo& reference_line_info);
87
88 bool IsSidePassableObstacle(const ReferenceLineInfo& reference_line_info);
89
90 void UpdateSelfPathInfo();
99 void CheckLaneBorrow(const ReferenceLineInfo& reference_line_info,
100 bool* left_neighbor_lane_borrowable,
101 bool* right_neighbor_lane_borrowable);
109 bool CheckLaneBoundaryType(const ReferenceLineInfo& reference_line_info,
110 const double check_s,
111 const SidePassDirection& lane_borrow_info);
118 void SetPathInfo(PathData* const path_data);
119 LaneBorrowPathConfig config_;
120 std::vector<SidePassDirection> decided_side_pass_direction_;
121 int use_self_lane_;
122 std::string blocking_obstacle_id_;
123};
124
126// Below are helper functions.
127
129 const std::vector<std::tuple<double, PathData::PathPointType, double>>&
130 path_point_decision);
131
133 const std::vector<std::tuple<double, PathData::PathPointType, double>>&
134 path_point_decision);
135
136bool ComparePathData(const PathData& lhs, const PathData& rhs,
137 const Obstacle* blocking_obstacle);
138
140} // namespace planning
141} // 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