Apollo 11.0
自动驾驶开放平台
predictor_manager.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 <map>
25#include <memory>
26
29#include "modules/prediction/proto/prediction_conf.pb.h"
30
35namespace apollo {
36namespace prediction {
37
39 public:
44
48 virtual ~PredictorManager() = default;
49
54 void Init(const PredictionConf& config);
55
61
67 void Run(const apollo::perception::PerceptionObstacles& perception_obstacles,
68 const ADCTrajectoryContainer* adc_trajectory_container,
69 ObstaclesContainer* obstacles_container);
70
78 void PredictObstacle(const ADCTrajectoryContainer* adc_trajectory_container,
79 Obstacle* obstacle,
80 ObstaclesContainer* obstacles_container,
81 PredictionObstacle* const prediction_obstacle);
82
88
89 private:
94 void RegisterPredictor(const ObstacleConf::PredictorType& type);
95
101 std::unique_ptr<Predictor> CreatePredictor(
102 const ObstacleConf::PredictorType& type);
103
107 void RegisterPredictors();
108
109 void PredictObstacles(
110 const apollo::perception::PerceptionObstacles& perception_obstacles,
111 const ADCTrajectoryContainer* adc_trajectory_container,
112 ObstaclesContainer* obstacles_container);
113
114 void PredictObstaclesInParallel(
115 const apollo::perception::PerceptionObstacles& perception_obstacles,
116 const ADCTrajectoryContainer* adc_trajectory_container,
117 ObstaclesContainer* obstacles_container);
118
119 void InitVehiclePredictors(const ObstacleConf& conf);
120
121 void InitCyclistPredictors(const ObstacleConf& conf);
122
123 void InitDefaultPredictors(const ObstacleConf& conf);
124
125 void RunVehiclePredictor(
126 const ADCTrajectoryContainer* adc_trajectory_container,
127 Obstacle* obstacle, ObstaclesContainer* obstacles_container);
128
129 void RunPedestrianPredictor(
130 const ADCTrajectoryContainer* adc_trajectory_container,
131 Obstacle* obstacle, ObstaclesContainer* obstacles_container);
132
133 void RunCyclistPredictor(
134 const ADCTrajectoryContainer* adc_trajectory_container,
135 Obstacle* obstacle, ObstaclesContainer* obstacles_container);
136
137 void RunDefaultPredictor(
138 const ADCTrajectoryContainer* adc_trajectory_container,
139 Obstacle* obstacle, ObstaclesContainer* obstacles_container);
140
141 void RunEmptyPredictor(const ADCTrajectoryContainer* adc_trajectory_container,
142 Obstacle* obstacle,
143 ObstaclesContainer* obstacles_container);
144
145 private:
146 std::map<ObstacleConf::PredictorType, std::unique_ptr<Predictor>> predictors_;
147
148 ObstacleConf::PredictorType vehicle_on_lane_predictor_ =
150
151 ObstacleConf::PredictorType vehicle_off_lane_predictor_ =
153
154 ObstacleConf::PredictorType vehicle_in_junction_predictor_ =
156
157 ObstacleConf::PredictorType cyclist_on_lane_predictor_ =
159
160 ObstacleConf::PredictorType cyclist_off_lane_predictor_ =
162
163 ObstacleConf::PredictorType pedestrian_predictor_ =
165
166 ObstacleConf::PredictorType default_on_lane_predictor_ =
168
169 ObstacleConf::PredictorType default_off_lane_predictor_ =
171
172 ObstacleConf::PredictorType vehicle_on_lane_caution_predictor_ =
174
175 ObstacleConf::PredictorType vehicle_in_junction_caution_predictor_ =
177
178 ObstacleConf::PredictorType vehicle_default_caution_predictor_ =
180
181 ObstacleConf::PredictorType vehicle_interactive_predictor_ =
183
184 PredictionObstacles prediction_obstacles_;
185};
186
187} // namespace prediction
188} // namespace apollo
Prediction obstacle.
Definition obstacle.h:52
Predictor * GetPredictor(const ObstacleConf::PredictorType &type)
Get predictor
void Run(const apollo::perception::PerceptionObstacles &perception_obstacles, const ADCTrajectoryContainer *adc_trajectory_container, ObstaclesContainer *obstacles_container)
Execute the predictor generation
virtual ~PredictorManager()=default
Destructor
void Init(const PredictionConf &config)
Initializer
const PredictionObstacles & prediction_obstacles()
Get prediction obstacles
void PredictObstacle(const ADCTrajectoryContainer *adc_trajectory_container, Obstacle *obstacle, ObstaclesContainer *obstacles_container, PredictionObstacle *const prediction_obstacle)
Predict a single obstacle
class register implement
Definition arena_queue.h:37
Obstacles container
Define the predictor base class