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

Revision history [back]

click to hide/show revision 1
initial version

Here was the issue.

For my implementation, NodeA receives a message from the past, then analyzes the data and broadcasts to /tf, with the timestamp of the original message.

I also have NodeB publishing a different transform to /tf at a much higher rate.

I want to compare the two broadcasts, so another node waits until something from NodeA is broadcast to /tf.

listener.waitForTransform('frame1','frame2',rospy.Time(),rospy.Duration(.1))
listener.lookupTransform('frame1','frame2',rospy.Time())
time_stamp=listener.getLatestCommonTime('frame1','frame2') # This does return the sim time

Then checks the /tf from NodeB at that time

listener.waitForTransform('frame3','frame4',time_stamp,rospy.Duration(100.0)) 
listener.lookupTransform('frame3','frame4',time_stamp)

I expected that, even if the transform time from NodeA was earlier than the first transform from NodeB, waitForTransform would find the nearest transform after that, which is why I ramped up the timeout to 100.

Since NodeB runs at a high rate, I wouldn't care if waitForTransform retuned the next transform that it published. But an exception is thrown regardless.

I tried to start the bag at different times, to make sure one node didn't take longer to start, but the same problem would exist at arbitrary points in the bag.

Not the most satisfying explanation (hopefully not too confusing), but the end result is that I can move on.

Thanks for the help, and I would still be very interested if anybody could provide a link regarding rosbag time approximation