Apollo 10.0
自动驾驶开放平台
prediction_component.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
21#pragma once
22
23#include <memory>
24#include <string>
25
26#include "cyber/time/time.h"
27
32#include "modules/common_msgs/storytelling_msgs/story.pb.h"
33
38namespace apollo {
39namespace prediction {
40
42 : public cyber::Component<perception::PerceptionObstacles> {
43 public:
48
53 std::string Name() const;
54
59 bool Init() override;
60
65 bool Proc(const std::shared_ptr<perception::PerceptionObstacles>&) override;
66
71 void OfflineProcessFeatureProtoFile(const std::string& features_proto_file);
72
73 private:
74 bool ContainerSubmoduleProcess(
75 const std::shared_ptr<perception::PerceptionObstacles>&);
76
77 bool PredictionEndToEndProc(
78 const std::shared_ptr<perception::PerceptionObstacles>&);
79
80 double component_start_time_ = 0.0;
81
82 double frame_start_time_ = 0.0;
83
84 std::shared_ptr<cyber::Reader<planning::ADCTrajectory>> planning_reader_;
85
86 std::shared_ptr<cyber::Reader<localization::LocalizationEstimate>>
87 localization_reader_;
88
89 std::shared_ptr<cyber::Reader<storytelling::Stories>> storytelling_reader_;
90
91 std::shared_ptr<cyber::Writer<PredictionObstacles>> prediction_writer_;
92
93 std::shared_ptr<cyber::Writer<SubmoduleOutput>> container_writer_;
94
95 std::shared_ptr<cyber::Writer<ADCTrajectoryContainer>> adc_container_writer_;
96
97 std::shared_ptr<cyber::Writer<perception::PerceptionObstacles>>
98 perception_obstacles_writer_;
99
100 std::shared_ptr<ContainerManager> container_manager_;
101
102 std::unique_ptr<EvaluatorManager> evaluator_manager_;
103
104 std::unique_ptr<PredictorManager> predictor_manager_;
105
106 std::unique_ptr<ScenarioManager> scenario_manager_;
107};
108
110
111} // namespace prediction
112} // namespace apollo
ADC trajectory container
bool Proc(const std::shared_ptr< perception::PerceptionObstacles > &) override
Data callback upon receiving a perception obstacle message.
void OfflineProcessFeatureProtoFile(const std::string &features_proto_file)
Load and process feature proto file.
bool Init() override
Initialize the node
std::string Name() const
Get name of the node
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:656
class register implement
Definition arena_queue.h:37
Output information of prediction container submodule