Vectorized way to loop through a ROS bag file messages

895 Views Asked by At

Is there a vectorized way (similar to Numpy, Pandas) to loop through bag file messages and perform computation on it ? This is currently what I do:

import rosbag
bag=rosbag.Bag('bag_file_name.bag')
for topic,message,timestamp in bag.read_messages(topics=['/tf']):
    # Do something with message data

Refrence: http://docs.ros.org/en/diamondback/api/rosbag/html/python/rosbag.bag.Bag-class.html#read_messages

0

There are 0 best solutions below