# Questions regarding ROS time synchronization

Hi all,

MY question is related to here. We have a remote PC, local PC and a jetson running at the same time. I was told that ROS time synchronization is important in this situation. My question is what would be the potential advantages of time synchronization? Could you make one counter example of what could happen if I don't perform time synchronization?

edit retag close merge delete

Sort by » oldest newest most voted

Could you make one counter example of what could happen if I don't perform time synchronization?

It becomes impossible to correlate any messages with Headers, as comparing their stamps becomes meaningless.

And by extension: matching messages to TF frames also becomes impossible, as again, comparing stamps from systems with unsynchronised clocks is impossible.

(and these are just two examples)

Edit:

Thank you gvdoorn. The weird thing is that currently the entire system is not "time synchronized". But still they can read sensor values from remote PC and jetson, send all the values to local PC which then calculates the control inputs and sends back to the remote PC and jetson.

You could just be lucky and have a configuration that works without synchronisation, or the clocks are close enough for your current use-case.

If you're not actually "using" time, not having synchronised clocks would obviously not be a problem. One example of a system not using time would be one where no Stamped messages are used, or where TF is not used, or if TF is used, only the latest available transforms are being used (ie: ros::Time(0) instead of using the stamp to look up a transform). If you have a relatively simple control loop which only uses "latest" data, not having synchronised the clocks would most likely not lead to any problems.

I wonder what would be the negative effects of current setup? Is the system overall loop rate going to be quicker if I perform "time synchronization"?

This is not about performance (or at least not that part which is measured in "loop rate"): it's about consistency and coherency.

I would strongly recommend you invest 30 minutes in setting up proper time sync between all involved hosts, as it will save you headaches in the (near) future.

more

Note: this is not a "ROS thing".

Unsynchronised clocks in a distributed system where you want to be able to correlate data coming from different participants/hosts based on timestamps (fi to establish a happened-before relationship) would become much more difficult (if not completely impossible).

( 2020-01-08 01:36:41 -0500 )edit

Thank you gvdoorn. The weird thing is that currently the entire system is not "time synchronized". But still they can read sensor values from remote PC and jetson, send all the values to local PC which then calculates the control inputs and sends back to the remote PC and jetson. I wonder what would be the negative effects of current setup? Is the system overall loop rate going to be quicker if I perform "time synchronization"?

( 2020-01-08 01:41:07 -0500 )edit

Again, thank you so much for your help. Kind of wonder how did you know all of this. Really appreciate it.

( 2020-01-08 02:16:54 -0500 )edit