是否有一种矢量化的方式(类似于 Numpy、Pandas)来遍历包文件消息并对其执行计算?这就是我目前所做的:
import rosbag
bag=rosbag.Bag('bag_file_name.bag')
for topic,message,timestamp in bag.read_messages(topics=['/tf']):
# Do something with message data
参考:http : //docs.ros.org/en/diamondback/api/rosbag/html/python/rosbag.bag.Bag-class.html#read_messages