Apollo 11.0
自动驾驶开放平台
decision_data.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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 "modules/common_msgs/prediction_msgs/prediction_obstacle.pb.h"
23
24namespace apollo {
25namespace planning {
26
28 DESTINATION = 0,
29 CROSSWALK = 1,
30 TRAFFIC_LIGHT = 2,
31 CLEAR_ZONE = 3,
32 REROUTE = 4,
33 DECISION_JUMP = 5,
34 PRIORITY = 6
35};
36
38 template <typename T>
39 size_t operator()(T t) const {
40 return static_cast<size_t>(t);
41 }
42};
43
45 public:
46 DecisionData(const prediction::PredictionObstacles& prediction_obstacles,
47 const ReferenceLine& reference_line);
48 ~DecisionData() = default;
49
50 public:
51 Obstacle* GetObstacleById(const std::string& id);
52 std::vector<Obstacle*> GetObstacleByType(const VirtualObjectType& type);
53 std::unordered_set<std::string> GetObstacleIdByType(
54 const VirtualObjectType& type);
55 const std::vector<Obstacle*>& GetStaticObstacle() const;
56 const std::vector<Obstacle*>& GetDynamicObstacle() const;
57 const std::vector<Obstacle*>& GetVirtualObstacle() const;
58 const std::vector<Obstacle*>& GetPracticalObstacle() const;
59 const std::vector<Obstacle*>& GetAllObstacle() const;
60
61 public:
62 bool CreateVirtualObstacle(const ReferencePoint& point,
63 const VirtualObjectType& type,
64 std::string* const id);
65 bool CreateVirtualObstacle(const double point_s,
66 const VirtualObjectType& type,
67 std::string* const id);
68
69 private:
70 bool IsValidTrajectory(const prediction::Trajectory& trajectory);
71 bool IsValidTrajectoryPoint(const common::TrajectoryPoint& point);
72 bool CreateVirtualObstacle(const common::math::Box2d& obstacle_box,
73 const VirtualObjectType& type,
74 std::string* const id);
75
76 private:
77 std::vector<Obstacle*> static_obstacle_;
78 std::vector<Obstacle*> dynamic_obstacle_;
79 std::vector<Obstacle*> virtual_obstacle_;
80 std::vector<Obstacle*> practical_obstacle_;
81 std::vector<Obstacle*> all_obstacle_;
82
83 private:
84 const ReferenceLine& reference_line_;
85 std::list<std::unique_ptr<Obstacle>> obstacles_;
86 std::unordered_map<std::string, Obstacle*> obstacle_map_;
87 std::unordered_map<VirtualObjectType, std::unordered_set<std::string>,
89 virtual_obstacle_id_map_;
90 std::mutex mutex_;
91 std::mutex transaction_mutex_;
92};
93
94} // namespace planning
95} // namespace apollo
The class of Box2d.
Rectangular (undirected) bounding box in 2-D.
Definition box2d.h:52
Obstacle * GetObstacleById(const std::string &id)
const std::vector< Obstacle * > & GetStaticObstacle() const
const std::vector< Obstacle * > & GetDynamicObstacle() const
const std::vector< Obstacle * > & GetPracticalObstacle() const
bool CreateVirtualObstacle(const ReferencePoint &point, const VirtualObjectType &type, std::string *const id)
const std::vector< Obstacle * > & GetVirtualObstacle() const
std::unordered_set< std::string > GetObstacleIdByType(const VirtualObjectType &type)
std::vector< Obstacle * > GetObstacleByType(const VirtualObjectType &type)
const std::vector< Obstacle * > & GetAllObstacle() const
This is the class that associates an Obstacle with its path properties.
Definition obstacle.h:62
Planning module main class.
class register implement
Definition arena_queue.h:37