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

Prevent (via command line) a node from advertising topics

asked 2012-12-14 04:58:39 -0600

autonomy gravatar image

updated 2012-12-14 04:58:55 -0600

I am wondering if it is possible to prevent an existing node from advertising/publishing on a number of unnecessary topics.

In particular, p2os publishes on the following topics:


I only care about /pose and /sonar, is there any way to tell the node not to broadcast the other topics without rebuilding the node?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-12-14 05:09:32 -0600

dornhege gravatar image

No, not unless the node exposes parameters or something similar that allow to switch this.

The only thing you can do is redirect those topics to somewhere else, if they interfere with other publications on the same topic.

edit flag offensive delete link more

answered 2012-12-14 05:07:02 -0600

thebyohazard gravatar image

I don't know of a way to prevent a node from advertising, but it says here in the wiki that a publish() in roscpp doesn't actually do anything if nothing is subscribed.

edit flag offensive delete link more



There might still be an overhead to actually compute the message to be published. In that case it's the node's responsibility to prevent that (e.g. the openni_kinect driver doesn't compute pointclouds unless the topic is subscribed)

dornhege gravatar image dornhege  ( 2012-12-14 05:11:23 -0600 )edit

Question Tools


Asked: 2012-12-14 04:58:39 -0600

Seen: 138 times

Last updated: Dec 14 '12