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

#include <lidar_segmentation_component.h>

类 apollo::perception::lidar::LidarSegmentationComponent 继承关系图:
apollo::perception::lidar::LidarSegmentationComponent 的协作图:

Public 成员函数

 LidarSegmentationComponent ()=default
 
virtual ~LidarSegmentationComponent ()=default
 
bool Init () override
 Init lidar segment component
 
bool Proc (const std::shared_ptr< onboard::LidarFrameMessage > &message) override
 Process of lidar segmentation
 
- Public 成员函数 继承自 apollo::cyber::Component< onboard::LidarFrameMessage >
 Component ()
 
 ~Component () override
 
bool Initialize (const ComponentConfig &config) override
 init the component by protobuf object.
 
bool Process (const std::shared_ptr< onboard::LidarFrameMessage > &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_
 

详细描述

在文件 lidar_segmentation_component.h 第 37 行定义.

构造及析构函数说明

◆ LidarSegmentationComponent()

apollo::perception::lidar::LidarSegmentationComponent::LidarSegmentationComponent ( )
default

◆ ~LidarSegmentationComponent()

virtual apollo::perception::lidar::LidarSegmentationComponent::~LidarSegmentationComponent ( )
virtualdefault

成员函数说明

◆ Init()

bool apollo::perception::lidar::LidarSegmentationComponent::Init ( )
overridevirtual

Init lidar segment component

返回
true
false

实现了 apollo::cyber::ComponentBase.

在文件 lidar_segmentation_component.cc 第 26 行定义.

26 {
27 // hook: Apollo License Verification: v_apollo_park
28 LidarSegmentationComponentConfig comp_config;
29 if (!GetProtoConfig(&comp_config)) {
30 AERROR << "Get LidarSegmentationComponentConfig file failed";
31 return false;
32 }
33 AINFO << "LidarSegmentation Component Configs: " << comp_config.DebugString();
34
35 output_channel_name_ = comp_config.output_channel_name();
36 writer_ = node_->CreateWriter<onboard::LidarFrameMessage>(output_channel_name_);
37
38 // segmentor init
39 auto plugin_param = comp_config.plugin_param();
40 std::string segmentor_name = plugin_param.name();
41 BaseLidarDetector* segmentor = BaseLidarDetectorRegisterer::GetInstanceByName(segmentor_name);
42 CHECK_NOTNULL(segmentor);
43 segmentor_.reset(segmentor);
44
45 LidarDetectorInitOptions segmentr_init_options;
46 segmentr_init_options.config_path = plugin_param.config_path();
47 segmentr_init_options.config_file = plugin_param.config_file();
48 ACHECK(segmentor_->Init(segmentr_init_options)) << "lidar segmentor init error";
49
50 // semantic builder init
51 SemanticBuilderInitOptions semantic_init_options;
52 ACHECK(semantic_builder_.Init(semantic_init_options));
53
54 AINFO << "LidarSegmentationComponent init successful.";
55 return true;
56}
bool GetProtoConfig(T *config) const
std::shared_ptr< Node > node_
bool Init(const SemanticBuilderInitOptions &options=SemanticBuilderInitOptions())
Init the Semantic Builder with initialization options
#define ACHECK(cond)
Definition log.h:80
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42

◆ Proc()

bool apollo::perception::lidar::LidarSegmentationComponent::Proc ( const std::shared_ptr< onboard::LidarFrameMessage > &  message)
override

Process of lidar segmentation

参数
messagelidar frame message
返回
true
false

在文件 lidar_segmentation_component.cc 第 58 行定义.

58 {
59 // internal proc
60 bool status = InternalProc(message);
61
62 if (status) {
63 writer_->Write(message);
64 AINFO << "Send lidar segmentation output message.";
65 }
66 return status;
67}

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