0
$\begingroup$

Rosanswers logo

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?


Originally posted by Miguel S. on ROS Answers with karma: 1114 on 2013-04-15

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by tfoote with karma: 58457 on 2013-04-15

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Miguel S. on 2013-04-17:
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 :)

$\endgroup$

Your Answer

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