Apollo 11.0
自动驾驶开放平台
apollo::perception::trafficlight::TrafficLightRecognComponent类 参考

#include <traffic_light_recognition_component.h>

类 apollo::perception::trafficlight::TrafficLightRecognComponent 继承关系图:
apollo::perception::trafficlight::TrafficLightRecognComponent 的协作图:

Public 成员函数

 TrafficLightRecognComponent ()=default
 Construct a new traffic light recogn component object.
 
 ~TrafficLightRecognComponent ()=default
 Destroy the traffic light recogn component object.
 
bool Init () override
 Initialize configuration files, algorithm plug-ins.
 
bool Proc (const std::shared_ptr< TrafficDetectMessage > &message) override
 Trigger the recognition process based on the traffic detect message.
 
- Public 成员函数 继承自 apollo::cyber::Component< TrafficDetectMessage >
 Component ()
 
 ~Component () override
 
bool Initialize (const ComponentConfig &config) override
 init the component by protobuf object.
 
bool Process (const std::shared_ptr< TrafficDetectMessage > &msg0, const std::shared_ptr< NullType > &msg1, const std::shared_ptr< NullType > &msg2, const std::shared_ptr< NullType > &msg3)
 
- Public 成员函数 继承自 apollo::cyber::ComponentBase
virtual ~ComponentBase ()
 
virtual bool Initialize (const TimerComponentConfig &config)
 
virtual void Shutdown ()
 
template<typename T >
bool GetProtoConfig (T *config) const
 

额外继承的成员函数

- Public 类型 继承自 apollo::cyber::ComponentBase
template<typename M >
using Reader = cyber::Reader< M >
 
- Protected 成员函数 继承自 apollo::cyber::ComponentBase
virtual void Clear ()
 
const std::string & ConfigFilePath () const
 
void LoadConfigFiles (const ComponentConfig &config)
 
void LoadConfigFiles (const TimerComponentConfig &config)
 
- Protected 属性 继承自 apollo::cyber::ComponentBase
std::atomic< bool > is_shutdown_ = {false}
 
std::shared_ptr< Node > node_ = nullptr
 
std::string config_file_path_ = ""
 
std::vector< std::shared_ptr< ReaderBase > > readers_
 

详细描述

在文件 traffic_light_recognition_component.h 第 33 行定义.

构造及析构函数说明

◆ TrafficLightRecognComponent()

apollo::perception::trafficlight::TrafficLightRecognComponent::TrafficLightRecognComponent ( )
default

Construct a new traffic light recogn component object.

◆ ~TrafficLightRecognComponent()

apollo::perception::trafficlight::TrafficLightRecognComponent::~TrafficLightRecognComponent ( )
default

Destroy the traffic light recogn component object.

成员函数说明

◆ Init()

bool apollo::perception::trafficlight::TrafficLightRecognComponent::Init ( )
overridevirtual

Initialize configuration files, algorithm plug-ins.

返回
true
false

实现了 apollo::cyber::ComponentBase.

在文件 traffic_light_recognition_component.cc 第 28 行定义.

28 {
29 // init component config
30 if (InitConfig() != cyber::SUCC) {
31 AERROR << "TrafficLightRecognComponent InitConfig failed.";
32 return false;
33 }
34 // init algorithm plugin
35 if (InitAlgorithmPlugin() != cyber::SUCC) {
36 AERROR << "TrafficLightRecognComponent InitAlgorithmPlugin failed.";
37 return false;
38 }
39 AINFO << "Successfully init traffic light recognition component.";
40 return true;
41}
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42

◆ Proc()

bool apollo::perception::trafficlight::TrafficLightRecognComponent::Proc ( const std::shared_ptr< TrafficDetectMessage > &  message)
override

Trigger the recognition process based on the traffic detect message.

参数
message
返回
true
false

在文件 traffic_light_recognition_component.cc 第 43 行定义.

43 {
45 auto time_imags = std::to_string(message->timestamp_);
46 AINFO << "Enter recognition component, message timestamp: " << time_imags;
47
48 bool status = InternalProc(message);
49 if (status) {
50 writer_->Write(message);
51 AINFO << "Send trafficlight recognition output message.";
52 }
53 return status;
54}
Definition future.h:29
#define PERF_FUNCTION(...)
Definition profiler.h:54

该类的文档由以下文件生成: