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

#include <msg_exporter.h>

apollo::perception::msg::MsgExporter 的协作图:

Public 类型

typedef apollo::drivers::Image ImgMsg
 
typedef apollo::drivers::PointCloud PcMsg
 

Public 成员函数

 MsgExporter (std::shared_ptr< apollo::cyber::Node > node, const std::vector< std::string > channels, const std::vector< std::string > child_frame_ids)
 
 ~MsgExporter ()=default
 

详细描述

在文件 msg_exporter.h 第 38 行定义.

成员类型定义说明

◆ ImgMsg

◆ PcMsg

构造及析构函数说明

◆ MsgExporter()

apollo::perception::msg::MsgExporter::MsgExporter ( std::shared_ptr< apollo::cyber::Node >  node,
const std::vector< std::string >  channels,
const std::vector< std::string >  child_frame_ids 
)

在文件 msg_exporter.cc 第 36 行定义.

38 {
39 _cyber_node = node;
40 _channels = channels;
41 _child_frame_ids = child_frame_ids;
42 // _localization_method = "perception_localization_100hz";
43 _localization_method = "novatel";
44 auto create_folder = [](const std::string& folder) {
47 }
49 };
50 // bind channels
51 for (std::size_t i = 0; i < _channels.size(); ++i) {
52 const auto& channel = _channels[i];
53 const auto& child_frame_id = _child_frame_ids[i];
54 std::string folder = TransformChannelToFolder(channel);
55 if (IsLidar(channel)) {
56 _cyber_node->CreateReader<PcMsg>(
57 channel,
58 std::bind(&MsgExporter::PointCloudMessageHandler, this,
59 std::placeholders::_1, channel, child_frame_id, folder));
60 create_folder(folder);
61 std::cout << "Bind lidar channel: " << channel << std::endl;
62 } else if (IsCamera(channel)) {
63 _cyber_node->CreateReader<ImgMsg>(
64 channel,
65 std::bind(&MsgExporter::ImageMessageHandler, this,
66 std::placeholders::_1, channel, child_frame_id, folder));
67 create_folder(folder);
68 std::cout << "Bind camera channel: " << channel << std::endl;
69 } else {
70 std::cout << "Unknown channel type: " << channel << std::endl;
71 }
72 }
73}
apollo::drivers::PointCloud PcMsg
bool DeleteFile(const string &filename)
Definition file.cc:495
bool CreateDir(const string &dir)
Definition file.cc:538
bool DirectoryExists(const std::string &directory_path)
Check if the directory specified by directory_path exists and is indeed a directory.
Definition file.cc:207

◆ ~MsgExporter()

apollo::perception::msg::MsgExporter::~MsgExporter ( )
default

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