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

Revision history [back]

click to hide/show revision 1
initial version

The easiest method I can think of off the top of my head is to check the publisher's get_subscription_count() method before publishing, and skip publishing (or even preparing to publish) if the count is zero. You might also need to check get_intra_process_subscription_count() as well.