0
$\begingroup$

Rosanswers logo

Hi,

I have recorded number of rosbags using --split option, say "file_0.bag", "file_1.bag", "file_2.bag" and so on to build a map. My question is: how to play them back one after the other. Using $ rosbag play file_0.bag file_1.bag file_2.bag plays all files at the same time. Whereas, I want to play one after another.

Thanks.


Originally posted by AsifA on ROS Answers with karma: 231 on 2014-08-18

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

If you load 3 sequential bag files recorded with --split they will playback according to the timestamps that they were received. So although they will actually be playing back simultaneously. At any given timestep data will only come from one of the bags.


Originally posted by tfoote with karma: 58457 on 2014-08-18

This answer was ACCEPTED on the original site

Post score: 7


Original comments

Comment by Murilo F. M. on 2014-08-18:
Thanks! I was (embarrassingly) oblivious of timestamps when I thought of the problem.

Comment by AsifA on 2014-08-19:
Thanks Tully. It works. :)

$\endgroup$
0
$\begingroup$

Rosanswers logo

UPDATE: Tully's answer is the correct way of doing it, also because (after thinking more about my suggestion) the command below would result in a lag between playing one bag and starting to play the next one (lag which, from my experience, varies according to the size of the bag).


AFAIK, rosbag does not implement such a feature.

However, you can easily take advantage of the Linux shell by running the following command:

$ rosbag play file_0.bag && rosbag play file_1.bag && rosbag play file_3.bag

The result will be a sequential execution of those 3 commands, provided the previous finished execution successfully. If you do not care about whether the previous command finished successfully, replace '&&' with ';'.

See this link for more info.


Originally posted by Murilo F. M. with karma: 806 on 2014-08-18

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by AsifA on 2014-08-18:
Thanks Murilo :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.