Ask Your Question

Prevent (via command line) a node from advertising topics

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

autonomy gravatar image

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

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 -0500

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 -0500

tbh 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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


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

Seen: 77 times

Last updated: Dec 14 '12