Apollo 10.0
自动驾驶开放平台
apollo::third_party_perception::ThirdPartyPerceptionComponent类 参考final

#include <third_party_perception_component.h>

类 apollo::third_party_perception::ThirdPartyPerceptionComponent 继承关系图:
apollo::third_party_perception::ThirdPartyPerceptionComponent 的协作图:

Public 成员函数

 ThirdPartyPerceptionComponent ()=default
 
 ~ThirdPartyPerceptionComponent ()=default
 
bool Init () override
 
bool Proc () override
 The Proc logic of the component, which called by the CyberRT frame.
 
- Public 成员函数 继承自 apollo::cyber::TimerComponent
 TimerComponent ()
 
 ~TimerComponent () override
 
bool Initialize (const TimerComponentConfig &config) override
 init the component by protobuf object.
 
void Clear () override
 
bool Process ()
 
uint32_t GetInterval () const
 
- Public 成员函数 继承自 apollo::cyber::ComponentBase
virtual ~ComponentBase ()
 
virtual bool Initialize (const ComponentConfig &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
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< Nodenode_ = nullptr
 
std::string config_file_path_ = ""
 
std::vector< std::shared_ptr< ReaderBase > > readers_
 

详细描述

在文件 third_party_perception_component.h33 行定义.

构造及析构函数说明

◆ ThirdPartyPerceptionComponent()

apollo::third_party_perception::ThirdPartyPerceptionComponent::ThirdPartyPerceptionComponent ( )
default

◆ ~ThirdPartyPerceptionComponent()

apollo::third_party_perception::ThirdPartyPerceptionComponent::~ThirdPartyPerceptionComponent ( )
default

成员函数说明

◆ Init()

bool apollo::third_party_perception::ThirdPartyPerceptionComponent::Init ( )
overridevirtual

实现了 apollo::cyber::ComponentBase.

在文件 third_party_perception_component.cc27 行定义.

27 {
29 third_party_perception_param;
30 if (!GetProtoConfig(&third_party_perception_param)) {
31 AINFO << "load third party perception param failed";
32 return false;
33 }
34
36 third_party_perception_param.device_type();
37
39 perception_ = std::make_shared<ThirdPartyPerceptionSmartereye>(node_.get());
40 } else if (device_type == ThirdPartyPerceptionDeviceType::MOBILEYE) {
41 perception_ = std::make_shared<ThirdPartyPerceptionMobileye>(node_.get());
42 } else {
43 perception_ = std::make_shared<ThirdPartyPerception>(node_.get());
44 }
45
46 if (!perception_->Init().ok()) {
47 return false;
48 }
49
50 writer_ = node_->CreateWriter<apollo::perception::PerceptionObstacles>(
51 FLAGS_perception_obstacle_topic);
52
53 return perception_->Start().ok();
54}
bool GetProtoConfig(T *config) const
std::shared_ptr< Node > node_
#define AINFO
Definition log.h:42

◆ Proc()

bool apollo::third_party_perception::ThirdPartyPerceptionComponent::Proc ( )
overridevirtual

The Proc logic of the component, which called by the CyberRT frame.

返回
returns true if successful, otherwise returns false

实现了 apollo::cyber::TimerComponent.

在文件 third_party_perception_component.cc56 行定义.

56 {
57 auto response = std::make_shared<apollo::perception::PerceptionObstacles>();
58 if (!perception_->Process(response.get())) {
59 return false;
60 }
61 writer_->Write(response);
62 return true;
63}

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