Apollo  6.0
Open source self driving car software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
obstacles_prioritizer.h
Go to the documentation of this file.
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 #include <unordered_set>
22 #include <vector>
23 
24 #include "cyber/common/macros.h"
25 
30 
31 namespace apollo {
32 namespace prediction {
33 
35  public:
36  ObstaclesPrioritizer() = delete;
37 
38  explicit ObstaclesPrioritizer(
39  const std::shared_ptr<ContainerManager>& container_manager);
40 
41  void AssignIgnoreLevel();
42 
43  void AssignCautionLevel();
44 
45  private:
46  void AssignCautionLevelInJunction(const Obstacle& ego_vehicle,
47  ObstaclesContainer* obstacles_container,
48  const std::string& junction_id);
49 
50  void AssignCautionLevelCruiseKeepLane(
51  const Obstacle& ego_vehicle, ObstaclesContainer* obstacles_container);
52 
53  void AssignCautionLevelCruiseChangeLane(
54  const Obstacle& ego_vehicle, ObstaclesContainer* obstacles_container);
55 
56  void AssignCautionLevelByEgoReferenceLine(
57  const Obstacle& ego_vehicle, ObstaclesContainer* obstacles_container);
58 
59  void AssignCautionLevelPedestrianByEgoReferenceLine(
60  const Obstacle& ego_vehicle, ObstaclesContainer* obstacles_container);
61 
62  void AssignCautionLevelPedestrianInFront(
63  const Obstacle& ego_vehicle, ObstaclesContainer* obstacles_container);
64 
65  void RankingCautionLevelObstacles(const Obstacle& ego_vehicle,
66  ObstaclesContainer* obstacles_container);
67 
68  void AssignCautionByMerge(
69  const Obstacle& ego_vehicle,
70  std::shared_ptr<const hdmap::LaneInfo> lane_info_ptr,
71  std::unordered_set<std::string>* const visited_lanes,
72  ObstaclesContainer* obstacles_container);
73 
74  void AssignCautionByOverlap(
75  const Obstacle& ego_vehicle,
76  std::shared_ptr<const hdmap::LaneInfo> lane_info_ptr,
77  std::unordered_set<std::string>* const visited_lanes,
78  ObstaclesContainer* obstacles_container);
79 
80  void SetCautionBackward(
81  const double distance, const Obstacle& ego_vehicle,
82  std::shared_ptr<const hdmap::LaneInfo> start_lane_info_ptr,
83  std::unordered_set<std::string>* const visited_lanes,
84  ObstaclesContainer* obstacles_container);
85 
86  void SetCautionIfCloseToEgo(const Obstacle& ego_vehicle,
87  const double distance_threshold,
88  Obstacle* obstacle_ptr);
89 
90  private:
91  std::unordered_set<std::string> ego_back_lane_id_set_;
92 
93  std::shared_ptr<ContainerManager> container_manager_;
94 
95  std::string ego_lane_id_ = "";
96 
97  double ego_lane_s_ = 0.0;
98 };
99 
100 } // namespace prediction
101 } // namespace apollo
Prediction obstacle.
Definition: obstacle.h:52
Definition: obstacles_container.h:39
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: obstacles_prioritizer.h:34
Obstacles container.
Use container manager to manage all containers.