【发布时间】:2020-06-02 13:21:57
【问题描述】:
我正在编写一个程序直接从rosbag读取数据,而不是在ros2中播放。示例代码 sn-p 如下。该代码的目的是检查 ros2 主题并仅获取该主题中的消息。我无法从包中获取数据。打印时,控制台正在打印十六进制值。
auto read_only_storage = factory.open_read_only(bag_file_path, storage_id);
while(read_only_storage->has_next())
{
auto msg = read_only_storage->read_next();
if(msg->topic_name == topic)
{
cout << msg->serialized_data<<endl;
}
}
在这方面的任何帮助都将是可观的。
【问题讨论】: