Currently I am writing a visualization node that publishes marker topics depending on the parameters given in its launch file. After launching rviz I can then manually add the markers to the display and it works fine.
However for practicability: Is there a way for the node to add these markers to the rviz display itself? I know that one can specify a config file with the displays for rviz. But then the user would have to edit both the launch and config file each time.
Originally posted by odelay on ROS Answers with karma: 103 on 2016-11-14
Post score: 1
Original comments
Comment by gvdhoorn on 2016-11-14:
I don't quite understand what you're asking: typically, you setup RViz to display markers published to a certain topic, save the config and every user using that config will see all markers published to that topic. Are you using a 1-topic-per-marker approach? That will not scale.
Comment by odelay on 2016-11-14:
Yes I use different topics in order to display the data of separate sensors. That way I can selectively disable and enable the respective markers. Also I can specify the displayed sensors in the launch file. Though I then have to manually add the markers in rviz.
Comment by gvdhoorn on 2016-11-15:
With that approach I don't think there is currently support to change (at least) the RViz side programmatically. It could be done with a custom plugin (in the end, RViz is 'just' a Qt application), but that might be some effort.
Comment by gvdhoorn on 2016-11-15:
Would keeping the Marker displays in RViz enabled, but not publishing to the topics achieve what you're after?
Is there a way for the node to add these markers to the rviz display itself?
This is a bit ambiguous: nodes only publish Marker msgs. The RViz display(s) render them.
Comment by ghkraju on 2016-11-15:
As @gvdhoorn mentioned, Your requirement will be fulfilled by creating a custom rViz Qt Application where you can add all your Publishing Marker nodes to Display (even this you need to specify the published topics in your code the same as you do in Config file or rViz app)