How to get the number of subscribers on a topic?
Hi everybody!
I want to know the list (or number) of subscribers on a topic programmatically. I know that I can use the rostopic list but I need that information in my node.
Thanks!
Edit: There is a method to find it: uint32_t ros::Publisher::getNumSubscribers()
const
But I need to know the number of subscribers on a topic from another node and I don't have the Publisher object, just the name of the topic