0
$\begingroup$

Rosanswers logo

The problem is: how can I sync time between rosserial node on Windows xp and RosMaster on Linux.

A robot controlled by WinXP is communicating to ROSMaster on a ubuntu14.04. Everything was ok until I relized that there is always a 30+- seconds delay between the ros::time::now() output on two different machines. Based on the posts I have read before, ros nodes use local time to do ros::time::now(). I know I can estimate and offset this delay on master side. But I want to take the transmission delay into account.

So...Thanks for reading this. And is there an easy way to sync the timestamp from both message senders?


Originally posted by LucasGoei on ROS Answers with karma: 33 on 2019-06-05

Post score: 0


Original comments

Comment by jayess on 2019-06-06:
Have you seen the network setup page on the wiki? Also, do you really mean Windows XP?

Comment by LucasGoei on 2019-06-06:
Lol yes, WindowsXP, those industrial arm loves old sys and RAMs that less than 512MB. They get a little panic when facing big RAMS.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

And is there an easy way to sync the timestamp from both message senders?

Yes. Use a time synchronisation system that is cross-platform.

And two are mentioned on the page @jayess linked to (specifically this section): NTP and Chrony.

Chrony may not exist for Windows, but NTP clients certainly do.

I'd recommend to sync the clocks of both your Linux machine and your Windows PC to an external time reference using that.

Please note: due to clock drift inherent in the cheap clocks used in PCs, you'll have to periodically resync everything. Most NTP clients will allow you to setup some sort of schedule.


Edit: most Windows versions should already come with an NTP client ("use internet time"). You should just need to setup your Linux machine then.


Originally posted by gvdhoorn with karma: 86574 on 2019-06-06

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gvdhoorn on 2019-06-06:
Please note that time synchronisation is not a "ROS thing" and should therefore be done with tools that are ROS-agnostic.

Please also note that you wouldn't be syncing time between the "rosmaster on Linux" and "rosserial on Windows", but you'd be syncing the clocks of the two PCs involved.

Comment by LucasGoei on 2019-06-06:
Thanks gvdhorrn. I guess this somehow meets my assumption. I will find an NTP server and sync them.

Comment by gvdhoorn on 2019-06-06:\

I guess this somehow meets my assumption

I'm not sure what you mean by this. If something is unclear, tell us.

If not, please mark the question as answered by clicking the checkmark to the left of the answer.

Comment by LucasGoei on 2019-06-26:
Sorry, gvdhoom. I should be more clear. Thanks for your answer and that totally answered my question. And I did had an initial guess before I ask that question which is time is managed in system level and ROS is not on top of this.

$\endgroup$

Your Answer

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