[ros-users] Rosbag Code API and Topic Names

Chad Rockey chadrockey at gmail.com
Fri Dec 3 05:31:50 UTC 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20101203/5c1d043d/attachment-0002.html>


More information about the ros-users mailing list