Skip to content

Time synchronization

Yoshua Nava edited this page Jan 18, 2018 · 1 revision

ridgeback_yumi is an heterogenuous combination of robots (YuMi and Ridgeback), as well as components that may run their own ROS nodes (a remote PC for control, Jetson TX1, or Intel NUC). Therefore, time synchronization is an important factor to consider in order to prevent any time inconsistencies in the sensor messages traveling around the network.

Our tools of choice for doing this are chrony and ntpdate. First, you should install it by running:

sudo apt-get install chrony ntpdate

Then, it is recommended that you disable automatic time update, so that time is not changed by surprise during execution. In order to do so, run the following command:

timedatectl set-ntp false

Automatic synchronization

You should configure chrony to query the remote PC time (192.168.125.50), and slowly get the time in-sync. In order to do that, just open the file /etc/chrony/chrony.conf, comment the existing lines that start by "server", and add this one:

server 192.168.125.50 minpoll 0 maxpoll 5 maxdelay .05

Finally, you should make sure that the timezones between the remote PC and the Ridgeback/NUC/Jetson are consistent. This can be done by running the command date in each host. If they're not the same, you can change them using the command timedatectl, as follows:

sudo timedatectl set-timezone CET     ## This command changes timezone to Central European Time

Manual synchronization

If you want to force a time update (without stopping the chrony and ntpd daemons), run:

sudo ntpdate -s <time_reference_host>

Diagnostics

If you want to query the current time offset of a host, run:

sudo ntpdate -q <time_reference_host>