Notification when tf topic is subscribed to?
I'm working on camera based visual odometry node that publishes /tf transforms when fiducial tags are present within a camera image. As the image process is somewhat computationally heavy, I would only like to process images only when there is a subscriber that cares about the transforms from my node. The ImageTransport infrastructure provides a connectCallback mechanism for accomplishing this where client nodes subscribe to an image. However, I don't see there is a similar connect callback mechanism for the TransformBroadcaster which I'm using to send transforms. I presume this is because there is no way to tell when transforms a subscriber to /tf really cares about.
Is there a recommended way of accomplishing this? I presume I could create a service that clients can use to manually enable/disable image processing, but I was hoping for something a bit more automatic.