0
$\begingroup$

Rosanswers logo

I am experiencing a string of time synchronization errors that I am struggling with.

I have two different computers, each of which is streaming data from a different sensor. I have set the time update on each computer to look at a common time server (sudo ntpdate {ip.address}).

  • Computer A runs a Hokuyo, the roscore, a robot urdf, amcl, and a processing node (A_p) for the hokuyo data.
  • Computer B runs a Kinect, two processing nodes accessing the kinect (B_p), a node (C_p) fusing data from the kinect and the processing node (A_p), and another node fusing information from all of the nodes (A_p, B_p, and C_p) on computer A and B, and transforming their locations into map space (generated by amcl).

This configuration generates synchronization errors, even though everything uses ros::Time::now() to retrieve time. When fusing data in node B_p, I get time synchronization errors:


terminate called after throwing an instance of 'tf::ExtrapolationException what(): Lookup would require extrapolation into the past. Requested time 1362173375.685855810 but the earliest data is at time 1362173375.907669363, when looking up transform from frame [/robot_tf/back_laser] to frame [/robot_tf/base_link]


and when transforming data into /map space, I get transformation errors that I am assuming are also time synchronization errors:


terminate called after throwing an instance of 'tf::LookupException' what(): Frame id /robot_tf/base_link does not exist! Frames (6): Frame /robot_tf/camera2_depth_optical_frame exists with parent /robot_tf/camera2_depth_frame.


All of these processes work when on the same computer, but spread across 2 computers, they eventually fail... and eventually isn't very long. Can I get rid of these errors entirely? Barring that, how do I ignore these errors? Do I need to write my own exception handler, or is there something easy in ros already?

Thank you,


Originally posted by ebeowulf on ROS Answers with karma: 100 on 2013-03-01

Post score: 0

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

I'm not sure if this is what's producing the error, but:

When dealing with message data and tf, I avoid using ros:Time::now() whenever possible. Instead, use the timestamp of each message.


Originally posted by Ivan Dryanovski with karma: 4954 on 2013-03-01

This answer was ACCEPTED on the original site

Post score: 5

$\endgroup$
0
$\begingroup$

Rosanswers logo

I suggest you go through the tf Tutorials to know how to handle the exceptions correctly. In any distributed setup it is expected that you will need to make your code robust to exceptions.


Originally posted by tfoote with karma: 58457 on 2013-03-01

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

Also make sure that both machines are time synced to something. (e.g. using chrony, ntp, etc.) Otherwise you'll see laggy data in Rviz, and other fun stuff.


Originally posted by Gav with karma: 478 on 2013-03-01

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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