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

How to make sure that two nodes (rosbag/record) start at the exact same time?

asked 2020-02-24 05:27:08 -0500

max11gen gravatar image

updated 2022-01-22 16:10:22 -0500

Evgeny gravatar image

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:

    <machine name="comp2" address="" 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" />

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?

edit retag flag offensive close merge delete


Could you perhaps better explain why you want to start things "at the exact same time"? How does that make merging easier?

gvdhoorn gravatar image gvdhoorn  ( 2020-02-24 10:14:50 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-02-24 07:41:43 -0500

流水疾翔 gravatar image

i don't know how to achieve it.but it sounds like a workflow problem,and use ros service to connect may did help. to make sure exact at the same time it seems difficult,because it is hard to correct clocktime,focus on key datas and solve it by some way such as the token algorithm

edit flag offensive delete link more

Question Tools



Asked: 2020-02-24 05:27:08 -0500

Seen: 262 times

Last updated: Feb 24 '20