0
$\begingroup$

Rosanswers logo

Hi, we're having some issues regarding time synchronization between the robot and desktop computers.

I have read that chrony is the best NTP client to perform time synchronization, but I can't find much information about how is it impemented in ROS.

As far as I know, there's an initial time synchronization which can produce a big time change and, from then onwards, the time is synchronized in small steps.

How long does the initial sinchronization take? What happens if there's no network access to the NTP server when starting the robot? Is the initial synchronization delayed and it is done later? Or it is never performed?

Because running some tests, I've seen that making big changes in system time during execution can have a devastating effect on running software.


Originally posted by Victor Lopez on ROS Answers with karma: 651 on 2011-09-12

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Actually it is not implemented in ROS at all, but running at the system level so ROS/any program can be agnostic and just use system time.

The initial sync via NTP is usually very quick, but this is something you would trigger. What chrony actually does is slow a clock slightly to match times, so that there are no big changes is system time for the exact reason that you recognized.


Originally posted by dornhege with karma: 31395 on 2011-09-12

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by Victor Lopez on 2011-09-12:
Yes I agree, what I wanted to make sure is that the hard-sync was triggered by hand and it wouldn't be done as soon as the computer regained network access to the NTP server.

Comment by dornhege on 2011-09-12:
The only way out would be to include a permanent machine time offset, but that sound horrible to maintain.

Comment by dornhege on 2011-09-12:
I think you are facing a logical problem here. Assuming the robot out of Wifi-range is out of sync: You can either do the initial hard-sync with a time jump and its problems or not do that but slowly correct the time - being out of sync for some time.

Comment by Victor Lopez on 2011-09-12:
The ultimate goal is to have the same (or a very similar) system time on one or more robots, and the desktop computers that connect to them. There's a NTP server in the LAN, but there's a chance that the robot is started outside of Wifi range. I guess that we'll skip the initial sync in that case.

Comment by tfoote on 2011-09-12:
I usually sync manually with NTP before I start the chrony service the first time and then forget about it. Chrony is good in that it doesn't jump the time and does a clock skew to converge. However initially that can be problematic if the time is completely wrong for it will slowly correct it.

Comment by Lorenz on 2011-09-12:
I guess you want to synchronize your desktop on the robot's time and synchronize the robot on NTP time whenever possible. That means, it shouldn't really matter if the robot has access to NTP or not.

Comment by Victor Lopez on 2011-09-12:
Ok so the initial sync must be triggered, and is there some kind of policy defined of what should be done if the robot is started outside of NTP server range?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.