Skip to content

Commit

Permalink
ignore tiny backjumps in loop detection
Browse files Browse the repository at this point in the history
For some reason rospy's now() can produce negative
increments by 0.01-0.05 seconds on our hardware.

This needs to be investigated, but this is a temporary fix
  • Loading branch information
v4hn committed Sep 11, 2013
1 parent 84dde32 commit 36dbe5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tf/src/tf/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def run(self):

def transformlistener_callback(self, data):
ros_dt = (rospy.Time.now() - self.last_update_ros_time).to_sec()
if ros_dt < 0.0:
if ros_dt < -0.5:
rospy.logwarn("Saw a negative time change of %f seconds, clearing the tf buffer." % ros_dt)
self.tl.clear()
self.last_update_ros_time = rospy.Time.now()
Expand Down

0 comments on commit 36dbe5c

Please sign in to comment.