I was using the Python version of the Rosbag Code API:
http://www.ros.org/wiki/rosbag/Code%20API#py_api
and I could not get the topics to print from my bag I recored on our robot.
After looking around, I realized the example for recording a bag has:
bag.write('chatter', str);
and the example for reading has:
bag.read_messages(topics=['chatter', 'numbers']):
I tried reading in my message as: bag.read_messages(topics=['odom']): but it
did not work until I used bag.read_messages(topics=['/odom']):
When NOT using the slash, I received a stop iterator:
>>> g.next()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
StopIteration
So it appears the Rosbag Code API does not handle the topic names like the
other ROS tools regarding the first '/'.
Is this an intentional design decision or just some checks that were left
out?
Thanks,
- Chad