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

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)

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

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

  <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)"/>

</launch>

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
1

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?


Edit:

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

Comments

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

khadija gravatar image khadija  ( 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 image khadija  ( 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 image gvdhoorn  ( 2018-04-09 08:16:39 -0500 )edit
4

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 image gvdhoorn  ( 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 image khadija  ( 2018-04-09 08:25:29 -0500 )edit
1

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

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

Question Tools

2 followers

Stats

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

Seen: 1,171 times

Last updated: Apr 09 '18