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

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
1

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

Question Tools

1 follower

Stats

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

Seen: 231 times

Last updated: Jun 03 '15