Apollo 11.0
自动驾驶开放平台
rule_based_stop_decider.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2019 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#pragma once
18
19#include <memory>
20#include <string>
21
22#include "modules/planning/tasks/rule_based_stop_decider/proto/rule_based_stop_decider.pb.h"
26
27namespace apollo {
28namespace planning {
29
31 public:
32 bool Init(const std::string& config_dir, const std::string& name,
33 const std::shared_ptr<DependencyInjector>& injector) override;
34
35 private:
37 Frame* const frame,
38 ReferenceLineInfo* const reference_line_info) override;
39
40 // @brief Rule-based stop at path end
41 void AddPathEndStop(Frame* const frame,
42 ReferenceLineInfo* const reference_line_info);
43
44 // @brief Rule-based stop for urgent lane change
45 void CheckLaneChangeUrgency(Frame* const frame);
46
47 // @brief Rule-based stop for side pass on reverse lane
48 void StopOnSidePass(Frame* const frame,
49 ReferenceLineInfo* const reference_line_info);
50
51 // @brief Check if necessary to set stop fence used for nonscenario side pass
52 bool CheckSidePassStop(const PathData& path_data,
53 const ReferenceLineInfo& reference_line_info,
54 double* stop_s_on_pathdata);
55
56 // @brief Set stop fence for side pass
57 bool BuildSidePassStopFence(const PathData& path_data,
58 const double stop_s_on_pathdata,
59 common::PathPoint* stop_point, Frame* const frame,
60 ReferenceLineInfo* const reference_line_info);
61
62 // @brief Check if ADV stop at a stop fence
63 bool CheckADCStop(const PathData& path_data,
64 const ReferenceLineInfo& reference_line_info,
65 const double stop_s_on_pathdata);
66
67 // @brief Check if needed to check clear again for side pass
68 bool CheckClearDone(const ReferenceLineInfo& reference_line_info,
69 const common::PathPoint& stop_point);
70
71 private:
72 static constexpr char const* PATH_END_VO_ID_PREFIX = "PATH_END_";
74 bool is_clear_to_change_lane_ = false;
75 bool is_change_lane_planning_succeed_ = false;
76};
77
79 Task)
80
81} // namespace planning
82} // 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
ReferenceLineInfo holds all data for one reference line.
bool Init(const std::string &config_dir, const std::string &name, const std::shared_ptr< DependencyInjector > &injector) override
Planning module main class.
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
class register implement
Definition arena_queue.h:37