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

Determining number of subscribers to a TransformBroadcaster

asked 2012-03-18 04:26:42 -0600

Kevin gravatar image

updated 2012-03-18 19:37:48 -0600

tfoote gravatar image

How do I determine the number of subscribers to my TransformBroadcaster?

Usually when you do a Publisher, you can call Publisher::getNumSubscribers() to determine if you want to publish that message. The nice thing about it is, if there is no one subscribed, you don't have to go through the effort of building and publishing the message.

Looking at the code, the underlying publisher used by TransformBroadcaster is private and there appears to be no way to access it. Plus it appears to never check number of subscribers before building and publishing the transform. Am I missing something? Is there another way to do this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-03-18 19:37:28 -0600

tfoote gravatar image

That's not a use case which was designed into the TransformBroadcaster. And no one has complained about CPU usage of TransformBroadcaster.

A patch which makes this behavior happen would be appreciated.

edit flag offensive delete link more

Comments

Is this still the case with groovy, or has such a patch been written?

thebyohazard gravatar image thebyohazard  ( 2013-07-26 06:10:42 -0600 )edit

Question Tools

Stats

Asked: 2012-03-18 04:26:42 -0600

Seen: 476 times

Last updated: Mar 18 '12