ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28python%29
This tutorial breaks down a bit on how topics are shared between a publishing source and a receiving subscriber.
It's the same thing when trying to subscribe a topic from a bagfile. Only this time, your publisher is the bagfile being played. As long as you reference the correct topic you're trying to subscribe to, you will be able to extract it.
To play the bagfiles, you can use:
rosbag play filename.bag
This will playback the bag file and publish all the topics recorded within the file. If you only want specific topics to be published, you can use:
rosbag play filename.bag --topics /topic1 /topic2 /topicEtc