ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Time Sync between rosserial on Windows & RosMaster on linux

asked 2019-06-05 23:52:15 -0600

LucasGoei gravatar image

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?

edit retag flag offensive close merge delete


Have you seen the network setup page on the wiki? Also, do you really mean Windows XP?

jayess gravatar image jayess  ( 2019-06-06 01:36:17 -0600 )edit

Lol yes, WindowsXP, those industrial arm loves old sys and RAMs that less than 512MB. They get a little panic when facing big RAMS.

LucasGoei gravatar image LucasGoei  ( 2019-06-06 03:15:16 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-06-06 02:21:26 -0600

gvdhoorn gravatar image

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.

edit flag offensive delete link more


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.

gvdhoorn gravatar image gvdhoorn  ( 2019-06-06 02:22:03 -0600 )edit

Thanks gvdhorrn. I guess this somehow meets my assumption. I will find an NTP server and sync them.

LucasGoei gravatar image LucasGoei  ( 2019-06-06 03:16:48 -0600 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2019-06-06 03:30:01 -0600 )edit

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.

LucasGoei gravatar image LucasGoei  ( 2019-06-26 21:55:37 -0600 )edit

Question Tools

1 follower


Asked: 2019-06-05 23:52:15 -0600

Seen: 438 times

Last updated: Jun 06 '19