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

#include <pointcloud_preprocess_component.h>

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

Public 成员函数

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

详细描述

在文件 pointcloud_preprocess_component.h 第 36 行定义.

构造及析构函数说明

◆ PointCloudPreprocessComponent()

apollo::perception::lidar::PointCloudPreprocessComponent::PointCloudPreprocessComponent ( )
default

◆ ~PointCloudPreprocessComponent()

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

成员函数说明

◆ Init()

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

Init pointcloud preprocess component

返回
true
false

实现了 apollo::cyber::ComponentBase.

在文件 pointcloud_preprocess_component.cc 第 33 行定义.

33 {
34 PointCloudPreprocessComponentConfig comp_config;
35 if (!GetProtoConfig(&comp_config)) {
36 AERROR << "Get PointCloudPreprocessComponentConfig file failed";
37 return false;
38 }
39 AINFO << "PointCloud Preprocess Component Configs: "
40 << comp_config.DebugString();
41
42 output_channel_name_ = comp_config.output_channel_name();
43 sensor_name_ = comp_config.sensor_name();
44 // Use sensor_name as lidar to novatel child_frame_id. If not equal
45 // we can use `sensor_info_` to get child_frame_id
46 lidar2novatel_tf2_child_frame_id_ = comp_config.sensor_name();
47 lidar_query_tf_offset_ =
48 static_cast<float>(comp_config.lidar_query_tf_offset());
49
50 auto plugin_param = comp_config.plugin_param();
51 std::string cloud_preprocessor_name = plugin_param.name();
52 config_path_ = plugin_param.config_path();
53 config_file_ = plugin_param.config_file();
54 cloud_preprocessor_ = BasePointCloudPreprocessorRegisterer::GetInstanceByName(
55 cloud_preprocessor_name);
56 CHECK_NOTNULL(cloud_preprocessor_);
57 // writer
58 writer_ =
59 node_->CreateWriter<onboard::LidarFrameMessage>(output_channel_name_);
60
61 if (!InitAlgorithmPlugin()) {
62 AERROR << "Failed to init pointcloud preprocess component plugin.";
63 return false;
64 }
65
66 return true;
67}
bool GetProtoConfig(T *config) const
std::shared_ptr< Node > node_
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42

◆ Proc()

bool apollo::perception::lidar::PointCloudPreprocessComponent::Proc ( const std::shared_ptr< drivers::PointCloud > &  message)
override

Process of pointcloud preprocess

参数
messagePointcloud message from driver
返回
true
false

在文件 pointcloud_preprocess_component.cc 第 69 行定义.

70 {
72 AINFO << std::setprecision(16)
73 << "Enter pointcloud preprocess component, message timestamp: "
74 << message->measurement_time()
75 << " current timestamp: " << Clock::NowInSeconds();
76
77 auto out_message = std::make_shared<onboard::LidarFrameMessage>();
78
79 bool status = InternalProc(message, out_message);
80 if (status) {
81 writer_->Write(out_message);
82 AINFO << "Send pointcloud preprocess output message.";
83 }
84
85 return status;
86}
Set the behavior of the
Definition future.h:29
#define PERF_FUNCTION(...)
Definition profiler.h:54

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