How to make sure that two nodes (rosbag/record) start at the exact same time?
I have a setup consisting of two computers as described in my previous question. I want to synchronously record rosbags on those computers. Therefore I am using a launch file, that looks like this:
<launch>
<machine name="comp2" address="10.0.0.1" user="user" env-loader="/home/user/catkin_ws/devel/remote_env_load.bash" default="false" />
<node pkg="rosbag" type="record" name="record_kinect" machine="comp2" respawn="false" output="screen" args="--duration=5 -O /home/user/test.bag /topic3 /topic4" />
<node pkg="rosbag" type="record" name="record_atis" respawn="false" output="screen" args="--duration=5 -O /home/user/test.bag /topic1 /topic2" />
</launch>
Later on I'm planning to use the python script that is referenced here to merge those two rosbags. However, it would be a great advantage and simplify my work, if there was a way to make sure, that rosbag starts recording at the exact same time on both machines. Is there a way, to tell a node in a launchfile to wait for another node or something like that?
Could you perhaps better explain why you want to start things "at the exact same time"? How does that make merging easier?