read bag messages as numpy in python [closed]
I see how to subscribe to a message to get arrays as numpy arrays, but is there a way to read from a bag file and get numpy arrays?
This does not work:
import rosbag
bag = rosbag.Bag('bag.bag')
from rospy.numpy_msg import numpy_msg
msgs = bag.read_messages(topics=['blah'])
msg = numpy_msg(msgs.next())
TypeError: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
Why is this question closed? @tfoote. I have this problem, and would like a solution
for topic, msg_raw, t in bag.read_messages(raw=True):
Hey @afakih, your comment was somewhat hint for me. thnx