ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Best practice: tf::Listener should be a global or local variable?

asked 2015-06-03 16:03:08 -0500

Stephane Caron gravatar image

Hi there,

I'm wondering: do tf::Listener or tf::Broadcaster variables take time to fire-up (e.g. because of topic subscription)?

It would be more convenient for me to declare a new tf::Listener whenever I need to lookup a tf (i.e. as a local variable), but I wonder if there are some performance issues in doing this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-06-03 19:17:24 -0500

tfoote gravatar image

It's best for the tf::Listener or tf::Broadcaster to be members of a persistent class. They both require continuous operation. Broadcasters need to be remain constructed for as long as you're broadcasting. And listeners need time to receive messages before they are useful.

edit flag offensive delete link more

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


Asked: 2015-06-03 16:03:08 -0500

Seen: 209 times

Last updated: Jun 03 '15