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

#include <lidar_detection_component.h>

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

Public 成员函数

 LidarDetectionComponent ()=default
 Construct a new Lidar Detection Component object
 
virtual ~LidarDetectionComponent ()=default
 Destroy the Lidar Detection Component object
 
bool Init () override
 Init the Lidar Detection Component object
 
bool Proc (const std::shared_ptr< LidarFrameMessage > &message) override
 Detect foreground obejcts using lidar detction models
 
- Public 成员函数 继承自 apollo::cyber::Component< LidarFrameMessage >
 Component ()
 
 ~Component () override
 
bool Initialize (const ComponentConfig &config) override
 init the component by protobuf object.
 
bool Process (const std::shared_ptr< 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< Nodenode_ = nullptr
 
std::string config_file_path_ = ""
 
std::vector< std::shared_ptr< ReaderBase > > readers_
 

详细描述

在文件 lidar_detection_component.h35 行定义.

构造及析构函数说明

◆ LidarDetectionComponent()

apollo::perception::lidar::LidarDetectionComponent::LidarDetectionComponent ( )
default

Construct a new Lidar Detection Component object

◆ ~LidarDetectionComponent()

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

Destroy the Lidar Detection Component object

成员函数说明

◆ Init()

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

Init the Lidar Detection Component object

返回
true
false

实现了 apollo::cyber::ComponentBase.

在文件 lidar_detection_component.cc26 行定义.

26 {
27 LidarDetectionComponentConfig comp_config;
28 if (!GetProtoConfig(&comp_config)) {
29 AERROR << "Get LidarDetectionComponentConfig file failed";
30 return false;
31 }
32 AINFO << "Lidar Detection Component Configs: " << comp_config.DebugString();
33
34 sensor_name_ = comp_config.sensor_name();
35 // writer
36 output_channel_name_ = comp_config.output_channel_name();
37 writer_ =
38 node_->CreateWriter<onboard::LidarFrameMessage>(output_channel_name_);
39
40 use_object_builder_ = comp_config.use_object_builder();
41
42 // detector init
43 auto plugin_param = comp_config.plugin_param();
44 std::string detector_name = plugin_param.name();
45 BaseLidarDetector* detector =
46 BaseLidarDetectorRegisterer::GetInstanceByName(detector_name);
47 CHECK_NOTNULL(detector);
48 detector_.reset(detector);
49
50 LidarDetectorInitOptions detection_init_options;
51 detection_init_options.sensor_name = sensor_name_;
52 detection_init_options.config_path = plugin_param.config_path();
53 detection_init_options.config_file = plugin_param.config_file();
54 ACHECK(detector_->Init(detection_init_options))
55 << "lidar detector init error";
56
57 // TODO(zero): Fix paddle doesn't output log to file
58 FLAGS_logtostderr = 0;
59
60 // object builder init
61 if (use_object_builder_) {
62 ObjectBuilderInitOptions builder_init_options;
63 ACHECK(builder_.Init(builder_init_options));
64 }
65
66 AINFO << "Successfully init lidar detection component.";
67 return true;
68}
bool GetProtoConfig(T *config) const
std::shared_ptr< Node > node_
bool Init(const ObjectBuilderInitOptions &options=ObjectBuilderInitOptions())
Init the Object Builder object 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::LidarDetectionComponent::Proc ( const std::shared_ptr< LidarFrameMessage > &  message)
override

Detect foreground obejcts using lidar detction models

参数
messagelidar frame mssage
返回
true
false

在文件 lidar_detection_component.cc70 行定义.

71 {
73 // internal proc
74 bool status = InternalProc(message);
75 if (status) {
76 writer_->Write(message);
77 AINFO << "Send Lidar detection output message.";
78 }
79 return status;
80}
#define PERF_FUNCTION(...)
Definition profiler.h:54

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