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?