Ask Your Question
2

Take certain parts of multipe rosbags and merge these to one rosbag

asked 2014-01-27 01:09:48 -0600

jringel77 gravatar image

Is it possible to take different parts from a rosbag (multiple rosbags) and put them all together at the end to one final rosbag?

So for example: take from 1.bag: 30s - 55s take from 2.bag: 75s - 90s take from 3.bag: 40s - 60s

merge these 3 parts to final.bag

all of these bags have the same topic

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2014-02-11 00:28:32 -0600

demmeln gravatar image

updated 2014-02-11 09:13:12 -0600

I believe you will have to write your own tool. It should be quite easy with the rosbag python api. I have small scripts for time filtering and merging and of bag files and they are all quite straight forward.

Edit: Here are the scripts. The time filtering is actually just a hacky invocation of a rosbag filter, but the merge script is gerneral purpose and you can even select only wanted topics with wildcards.

https://gist.github.com/NikolausDemme...

edit flag offensive delete link more

Comments

Thanks!!!!

alex.filgueira gravatar imagealex.filgueira ( 2014-02-11 00:31:51 -0600 )edit

hey Demmeln could you explain how to properly use rosbag_filter_subsequence.sh? This tool seems to be exactly what I need, but I can't seem to get time filtering to work and ended up with a 2.7 gb bag file spanning multiple days

davelkan gravatar imagedavelkan ( 2015-07-09 14:49:42 -0600 )edit

It is not a general purpose tool, but just an example of how you might want to use "rosbag filter". You will have to adapt it to your use case.

demmeln gravatar imagedemmeln ( 2015-07-19 17:02:02 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-01-27 01:09:48 -0600

Seen: 1,843 times

Last updated: Feb 11 '14