Apollo 10.0
自动驾驶开放平台
traffic_light_detection_component.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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#pragma once
17
18#include <memory>
19#include <string>
20#include <vector>
21
26
27namespace apollo {
28namespace perception {
29namespace trafficlight {
30
32
34 : public cyber::Component<TrafficDetectMessage> {
35 public:
52 bool Init() override;
61 bool Proc(const std::shared_ptr<TrafficDetectMessage>& message) override;
62
63 private:
64 int InitConfig();
65 bool InitAlgorithmPlugin();
66 bool InternalProc(
67 const std::shared_ptr<TrafficDetectMessage const>& message);
68
69 private:
71 std::string tl_detector_name_;
72 int gpu_id_;
73 std::string config_path_;
74 std::string config_file_;
75
76 std::shared_ptr<trafficlight::BaseTrafficLightDetector> detector_;
77 std::shared_ptr<apollo::cyber::Writer<TrafficDetectMessage>> writer_;
78};
79
81
82} // namespace trafficlight
83} // namespace perception
84} // namespace apollo
bool Proc(const std::shared_ptr< TrafficDetectMessage > &message) override
Trigger the detection process based on the traffic detect message.
bool Init() override
Initialize configuration files, algorithm plug-ins.
TrafficLightDetectComponent()=default
Construct a new traffic light detect component object.
~TrafficLightDetectComponent()=default
Destroy the traffic light detect component object.
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:656
class register implement
Definition arena_queue.h:37