Apollo 10.0
自动驾驶开放平台
obstacles_container.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 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
22#pragma once
23
24#include <memory>
25#include <string>
26#include <vector>
27
33#include "modules/common_msgs/prediction_msgs/prediction_obstacle.pb.h"
35
36namespace apollo {
37namespace prediction {
38
40 public:
45
49 explicit ObstaclesContainer(const SubmoduleOutput& submodule_output);
50
54 virtual ~ObstaclesContainer() = default;
55
60 void Insert(const ::google::protobuf::Message& message) override;
61
68 const perception::PerceptionObstacle& perception_obstacle,
69 const double timestamp);
70
75 void InsertFeatureProto(const Feature& feature);
76
80 void BuildLaneGraph();
81
86
92 Obstacle* GetObstacle(const int id);
93
97 void Clear();
98
99 void CleanUp();
100
101 size_t NumOfObstacles() { return ptr_obstacles_.size(); }
102
104 const int id);
105
110 const std::vector<int>& curr_frame_movable_obstacle_ids();
111
116 const std::vector<int>& curr_frame_unmovable_obstacle_ids();
117
122 const std::vector<int>& curr_frame_considered_obstacle_ids();
123
124 /*
125 * @brief Set non-ignore obstacle IDs in the current frame
126 */
128
133 std::vector<int> curr_frame_obstacle_ids();
134
135 double timestamp() const;
136
138 const size_t history_size, const apollo::cyber::Time& frame_start_time);
139
143 const Scenario& curr_scenario() const;
144
150
151 private:
152 Obstacle* GetObstacleWithLRUUpdate(const int obstacle_id);
153
159 bool IsMovable(const perception::PerceptionObstacle& perception_obstacle);
160
161 private:
162 double timestamp_ = -1.0;
164 std::vector<int> curr_frame_movable_obstacle_ids_;
165 std::vector<int> curr_frame_unmovable_obstacle_ids_;
166 std::vector<int> curr_frame_considered_obstacle_ids_;
167 Scenario curr_scenario_;
168 std::unique_ptr<ObstacleClusters> clusters_;
169 JunctionAnalyzer junction_analyzer_;
170};
171
172} // namespace prediction
173} // namespace apollo
Cyber has builtin time type Time.
Definition time.h:31
Prediction obstacle.
Definition obstacle.h:52
SubmoduleOutput GetSubmoduleOutput(const size_t history_size, const apollo::cyber::Time &frame_start_time)
ObstacleClusters * GetClustersPtr() const
Get the raw pointer of clusters_
virtual ~ObstaclesContainer()=default
Destructor
const std::vector< int > & curr_frame_movable_obstacle_ids()
Get movable obstacle IDs in the current frame
void Insert(const ::google::protobuf::Message &message) override
Insert a data message into the container
const std::vector< int > & curr_frame_unmovable_obstacle_ids()
Get unmovable obstacle IDs in the current frame
const apollo::perception::PerceptionObstacle & GetPerceptionObstacle(const int id)
const std::vector< int > & curr_frame_considered_obstacle_ids()
Get non-ignore obstacle IDs in the current frame
const Scenario & curr_scenario() const
Get current scenario
void BuildLaneGraph()
Build lane graph for obstacles
Obstacle * GetObstacle(const int id)
Get obstacle pointer
std::vector< int > curr_frame_obstacle_ids()
Get current frame obstacle IDs in the current frame
void BuildJunctionFeature()
Build junction feature for obstacles
void InsertFeatureProto(const Feature &feature)
Insert a feature proto message into the container
void InsertPerceptionObstacle(const perception::PerceptionObstacle &perception_obstacle, const double timestamp)
Insert an perception obstacle
Define the data container base class
class register implement
Definition arena_queue.h:37
Obstacle
Output information of prediction container submodule