During the simultaneous operation of the two machines, the TF transformation of ROS requires that the clocks of the two machines be kept in accordance with one another.
1. Query time
First, look at the difference between the two machine clocks with the following command. On this computer, view the machine time of the remote master:
Ntpdate-q other_computer_ip
For example
192.168. 0.23
Or you can query the time of the machine by entering the date command directly at the terminal:
Date
2, Installation Chrony
Execute the following command:
sudo Install Chrony
3. Configuration
Then edit the configuration file:
sudo gedit/etc/chrony/chrony.conf
To synchronize the time of the machine to master, Add the following command to sudo gedit/etc/chrony/chrony.conf:
0 5 Maxdelay. #c1为master所在的计算机ip或者域名
If there is a big difference, such as a few minutes, sync time, execute the following command:
/etc/init.d/chrony stopntpdate other_computer_ip/etc/init.d/chrony start
other_computer_ip represents the IP of the remote master machine, such as 192.168.0.23, which is:
Resources:
1. Http://wiki.ros.org/ROS/NetworkSetup
Two machines clock synchronization in Ros