Ask Your Question

time synchronization

asked 2018-04-09 07:16:47 -0500

khadija gravatar image

I write the following launch code in order to record synchronized data from 4 topics (color image, depth image, joy command, and IMU)

    <arg name="approx_sync" default="true"/>

<!-- Putting the time back to real time-->
       /use_sim_time : false

  <node pkg="rosbag" type="record" name="record_Test" output="screen" 
    args="record -o record_Test /camera/depth/image_raw /camera/rgb/image_raw /joy /mobile_base/sensors/imu_data_raw"/>
    <param name="approx_sync" type="bool" value="$(arg approx_sync)"/>


I use ApproximateTime Synchronizer but it does not work! still, I got a bag file with a different number of messages from each topic.

what I doing wrong?!

any help appriciated

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-04-09 07:32:26 -0500

gvdhoorn gravatar image

updated 2018-04-09 07:45:14 -0500

rosbag does not do any time syncronising as far as I know. The approx_sync parameter is not a parameter the record node accepts/uses.

Can you tell us where you found that parameter used in conjunction with the record node?


I just thought that I can use it with record .. so what is your advice, how can I get a syncronized data??

I think 'best practice' would still be to use message_filters/ApproximateTime Policy for this in a custom node.

It would be a nice addition to rosbag though to be able to do this. Perhaps 'someone' has already done this or written a custom record node that support this out-of-the-box?

edit flag offensive delete link more


I just thought that I can use it with record .. so what is your advice, how can I get a syncronized data??

khadija gravatar imagekhadija ( 2018-04-09 07:41:38 -0500 )edit

so how should I merge my launch file with that python code? could you help me?

khadija gravatar imagekhadija ( 2018-04-09 08:05:56 -0500 )edit

how should I merge my launch file with that python code?

You can't, that's not how this works.

I would suggest to see whether someone else has already done something like this, and if not, write a node that uses message_filters to do a synchronised recording.

gvdhoorn gravatar imagegvdhoorn ( 2018-04-09 08:16:39 -0500 )edit

But also note that you might not even need to do a synchronised recording: if you're just looking for a way to process synchronised pairs/triples/etc of messages, then perhaps just recording with rosbag and then using message_filters would work just as well.

gvdhoorn gravatar imagegvdhoorn ( 2018-04-09 08:17:53 -0500 )edit

do you mean that after I record my data then I can bring my bag file to that python code to do a time synchronizer ??

khadija gravatar imagekhadija ( 2018-04-09 08:25:29 -0500 )edit

You can record your bag, write the synchroniser node, then play the bag and have the node synchronise live, yes.

gvdhoorn gravatar imagegvdhoorn ( 2018-04-09 08:32:26 -0500 )edit

Thank you for your time. I will do a search on how can I do that, and if you find anyone did what I'm trying to do; please link it to me.

khadija gravatar imagekhadija ( 2018-04-09 08:39:18 -0500 )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



Asked: 2018-04-09 07:16:47 -0500

Seen: 348 times

Last updated: Apr 09 '18