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

sync topics with different hz

asked 2020-03-24 15:55:19 -0600

arafatsadasd gravatar image

Hello All, I have three topics running at 20hz,21hz,100hz each. I want to record the synchronized data using Rosbag can you suggest a way to sync the data or record them at the same timestamps?

Please help, Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-24 17:29:39 -0600

nkhedekar gravatar image

I assume you want the output to be 3 topics with the messages being published at the same time and that you do not care about the exact timestamp of the message that you are getting.

For this, you can make a node that subscribes to each of the three topics and populates a buffer for each of them. It should have a timer that runs at the required rate and takes the top message from each buffer, rewrites the timestamp and writes it into a rosbag.

Alternatively, you could repeat the messages that are at a lower rate if you the final rate to be higher than 20 Hz (the lowest frequency)

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-03-24 15:55:19 -0600

Seen: 936 times

Last updated: Mar 24 '20