Ask Your Question
0

Set TF_CACHE_TIME with rospy

asked 2013-04-15 06:14:22 -0600

Miguel S. gravatar image

updated 2014-01-28 17:16:11 -0600

ngrennan gravatar image

Hello!

I'm using a robotic (and ROSified!) wheelchair. One of the tasks I have to do is to transform a point from /base_link to /odom. Unsurprisingly, I use TF :)

However, when running the code below in Python:

tfListener.canTransform("/odom", base_link_point, rospy.Time(0) )

the function returns False quite often. I also transform from /base_link to /map (a longer chain) in another node and that works reliably.

I think the issue might be that tfListener doesn't have a big enough TF_CACHE_TIME, so I'd like to try and increase it. However the TF python documentation doesn't indicate how to do this.

I've also checked the source code and there's a call to override the argument in Transformer_init() but it's not clear to me how to do so or what are the other arguments for.

Any ideas?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-04-15 18:15:10 -0600

tfoote gravatar image

Sorry we haven't provided that level of customization into tf. But the default timeout is 10 seconds, I would not expect you to be having this problem with that timeout.

Can you verify that you are keeping the tfListener is scope such that the cache can build up? The most common reason for that sort of call to fail is not that data is too old, but that you are querying it before data has arrived.

edit flag offensive delete link more

Comments

tfListener was in scope. The issue seemed to be that /odom was published by another machine (without internet) whose clock was 16sec behind. ntpdate seems to have fixed it :)

Miguel S. gravatar imageMiguel S. ( 2013-04-17 02:25:00 -0600 )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

1 follower

Stats

Asked: 2013-04-15 06:14:22 -0600

Seen: 75 times

Last updated: Apr 15 '13