Ask Your Question
2

Why robot needs to set NTP?

asked 2012-03-28 00:50:41 -0500

sam gravatar image

In turtlebot tutorials NTP , why turtlebot robot needs to set Network Time Protocol?

  1. If I didn't set that protocol, what will happen? cause some errors?

  2. Every robot needs NTP?

Thank you~

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
5

answered 2012-03-28 02:26:16 -0500

Lorenz gravatar image

updated 2012-03-28 03:13:53 -0500

To have TF and all the other time based things properly, it is important to have all clocks synchronized. NTP is just a very simple way to achieve that. Another one that is used e.g. on the PR2 is chrony.

If you don't set up NTP everything will be working fine as long as you are executing it on the same PC. If you have a setup using several computers communicating over a network, make sure that times are synchronized.

Edit: Sensors, odometry, etc. publish data with a time-stamp that is generated from using system time which is set by NTP. The stamp is then used by TF to transform between coordinate frames. Example: You have a tilting laser sensor. The position of the tilt-joint and the laser scans are continuously published on topics, with a time stamp. If you now want to build up a 3D point cloud in your robot's base frame, you need to transform each laser point (using its time stamp) to the base frame, using the position of the joint at the time when the laser scan has been taken. If now the joint and the laser are connected to two different computers and the clocks are not synchronized, the resulting point cloud will be wrong.

edit flag offensive delete link more

Comments

What's the relation between with TF and NTP? And why synchronize is important when run 2 computers?

sam gravatar imagesam ( 2012-03-28 02:56:02 -0500 )edit

If you are a TF user you can lookup a transformation in a bounded time interval. This is useful for instance if you untrust older transformations due to movement of the frames. Therefore time synchronization is important. http://www.ros.org/wiki/tf/Theory.

Pablo Iñigo Blasco gravatar imagePablo Iñigo Blasco ( 2012-03-28 03:34:49 -0500 )edit

In any case IMHO TF should handle uncertainty for hidding or muffling little time synchronizations errors (or frames in movement, etc.). http://answers.ros.org/question/30498/tf-handling-frame-uncertainty

Pablo Iñigo Blasco gravatar imagePablo Iñigo Blasco ( 2012-03-28 03:36:47 -0500 )edit

Another useful alternative to NTP is PTPd (http://ptpd.sourceforge.net/). To me PTPd is easier to setup and use if some of your machines do not have an internet connection, since you can set one machine as master and all the other machines as slaves that will try to sync their time with the master.

Thomas D gravatar imageThomas D ( 2012-03-28 03:39:18 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-03-28 00:50:41 -0500

Seen: 817 times

Last updated: Mar 28 '12