ros-visualization / visualization_tutorials

Tutorials related to using and extending RViz and interactive_markers.
263 stars 263 forks source link

Check number of subscribers before publishing marker #21

Closed VictorLamoine closed 9 years ago

VictorLamoine commented 9 years ago

This checks whether a node has subscribed to the marker topic. The marker is not published until someone subscribes.

Related answers.ros.org topic.

wjwwood commented 9 years ago

Hi! Thanks for the pull request.

wjwwood commented 9 years ago

In a program that will be running longer, but only wants to publish this once at the beginning, the better option would be to use a latched publisher and just publish once at the beginning of the program. The latching option is not a solution here because the program terminates so quickly.

It may be worth update the tutorial with notes like this one, but if you don't have time to touch the wiki tutorial too, I can look at it later.

VictorLamoine commented 9 years ago

I updated the pull request. I didn't know about the latch option of the publishers thanks for the information.

I can update the tutorial and let you know when I'm done so you can proof-read.

wjwwood commented 9 years ago

If you address the comment above I think this is ready to merge. I would appreciate it if you could update the tutorial as well and I'll review it for you.

Thanks for your help!

VictorLamoine commented 9 years ago

Pull request updated and wiki modified; the wiki notification has been sent to IsaacSaito (@130s)

130s commented 9 years ago

I guess the wiki commit in question is http://wiki.ros.org/action/diff/rviz/Tutorials/Markers%3A%20Basic%20Shapes?action=diff&rev1=24&rev2=25

wjwwood commented 9 years ago

Looks good to me. Thanks for the help.