美文网首页
matlab下,rosbag文件读取

matlab下,rosbag文件读取

作者: 循梦渡 | 来源:发表于2019-10-12 15:57 被阅读0次

matlab下,rosbag文件读取:


filepath=fullfile('F:','Leon Files','MH_01_easy.bag')  

bag=rosbag(filepath) 

其中filepath也不用这么麻烦的写,直接filepath = 'D:/123/123.bag' 就行


在工作区中找到bag,在Avaliable Topics中找到想要的话题 x;


最后运行这两条来提取指定的消息

geometry_message=select(bag,'MessageType','geometry_msgs/PointStamped')  

data=readMessages(geometry_message)  

完毕


另外,readMessages存在一些一直错误可能会导致read失败

加上一句即可,like that:

laserdata=readMessages(geometry_message,'DataFormat', 'struct') ;

相关文章

网友评论

      本文标题:matlab下,rosbag文件读取

      本文链接:https://www.haomeiwen.com/subject/ikgqmctx.html