ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Can I play and record rosbags at the same time?

asked 2021-03-22 09:41:14 -0500

Kansai gravatar image

updated 2021-03-22 09:42:53 -0500

I have a quite general question that I would like to know before starting any implementation.

Say I have a rosbag file (recorded previously), can I play this bag and at the same time record another bag file? Is this possible?

I was thinking writing a launch file with several nodes. one node being

 <node name="rosbag" type="play"  pkg="rosbag" args="$(find  bag)/bags/First1.bag" >   </node>

and in the same launch file

<node name="rosbag" type="record"  pkg="rosbag" args="topicIwanttorecord" >   </node>

(Not really sure if that is how I should write the nodes but you get the idea

Why I would need to do this? well because I would play the first bag, the run another program that takes some of the topics published by that bag, operate with them and publish another topic, which is the topic I want to record in the second bag

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-03-22 13:57:30 -0500

msmcconnell gravatar image

Yes you can do this, so long as the nodes have different names and are writing/reading to different files. In the snippets you shared the nodes have the same name, so be sure to change that.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-03-22 09:41:14 -0500

Seen: 415 times

Last updated: Mar 22 '21