Apollo 11.0
自动驾驶开放平台
evaluator_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 <list>
25#include <map>
26#include <memory>
27#include <unordered_map>
28#include <vector>
29
30#include "cyber/common/macros.h"
33#include "modules/prediction/proto/prediction_conf.pb.h"
35
40namespace apollo {
41namespace prediction {
42
44 public:
49
53 virtual ~EvaluatorManager() = default;
54
59 void Init(const PredictionConf& config);
60
66
70 void Run(const ADCTrajectoryContainer* adc_trajectory_container,
71 ObstaclesContainer* obstacles_container);
72
73 void EvaluateObstacle(const ADCTrajectoryContainer* adc_trajectory_container,
74 Obstacle* obstacle,
75 ObstaclesContainer* obstacles_container,
76 std::vector<Obstacle*> dynamic_env);
77
78 void EvaluateObstacle(Obstacle* obstacle,
79 ObstaclesContainer* obstacles_container);
80
82 const ADCTrajectoryContainer* adc_trajectory_container,
83 ObstaclesContainer* obstacles_container);
84
85 private:
86 void BuildObstacleIdHistoryMap(ObstaclesContainer* obstacles_container,
87 size_t max_num_frame);
88
89 void DumpCurrentFrameEnv(ObstaclesContainer* obstacles_container);
90
95 void RegisterEvaluator(const ObstacleConf::EvaluatorType& type);
96
102 std::unique_ptr<Evaluator> CreateEvaluator(
103 const ObstacleConf::EvaluatorType& type);
104
108 void RegisterEvaluators();
109
110 private:
111 std::map<ObstacleConf::EvaluatorType, std::unique_ptr<Evaluator>> evaluators_;
112
113 ObstacleConf::EvaluatorType vehicle_on_lane_evaluator_ =
115
116 ObstacleConf::EvaluatorType vehicle_on_lane_caution_evaluator_ =
118
119 ObstacleConf::EvaluatorType vehicle_in_junction_evaluator_ =
121
122 ObstacleConf::EvaluatorType vehicle_in_junction_caution_evaluator_ =
124
125 ObstacleConf::EvaluatorType vehicle_default_caution_evaluator_ =
127
128 ObstacleConf::EvaluatorType cyclist_on_lane_evaluator_ =
130
131 ObstacleConf::EvaluatorType pedestrian_evaluator_ =
133
134 ObstacleConf::EvaluatorType vectornet_evaluator_ =
136
137 ObstacleConf::EvaluatorType default_on_lane_evaluator_ =
139
140 ObstacleConf::EvaluatorType interaction_evaluator_ =
142
143 ObstacleConf::EvaluatorType multi_agent_evaluator_ =
145
146 std::unordered_map<int, ObstacleHistory> obstacle_id_history_map_;
147
148 std::unique_ptr<SemanticMap> semantic_map_;
149};
150
151} // namespace prediction
152} // namespace apollo
virtual ~EvaluatorManager()=default
Destructor
Evaluator * GetEvaluator(const ObstacleConf::EvaluatorType &type)
Get evaluator
void EvaluateMultiObstacle(const ADCTrajectoryContainer *adc_trajectory_container, ObstaclesContainer *obstacles_container)
void EvaluateObstacle(const ADCTrajectoryContainer *adc_trajectory_container, Obstacle *obstacle, ObstaclesContainer *obstacles_container, std::vector< Obstacle * > dynamic_env)
void Run(const ADCTrajectoryContainer *adc_trajectory_container, ObstaclesContainer *obstacles_container)
Run evaluators
void Init(const PredictionConf &config)
Initializer
Prediction obstacle.
Definition obstacle.h:52
class register implement
Definition arena_queue.h:37
Define the data container base class