Ask Your Question
0

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

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?

edit retag flag offensive close merge delete

Comments

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
0

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

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

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

Seen: 22 times

Last updated: Feb 24