When using multiple servers which have different names within the same node, disabling and re-enabling the visualisation of the markers in rviz does not work correctly.
The cause of this is likely the update_full topic being used to know when there are markers available. Because this is a latched topic generated by the server, it only retains the last published message on the topic. Each server with a different server_id publishes to the same topic, which means that it's only possible for the process function to get the init message for a single one of the servers.
First, start rviz and add an interactive marker visualiser on the topic /test/interactive. Then, run this node. You will see a couple of markers appear, like this:
The messages are as expected:
Then, uncheck the box to display the markers, and re-check it. You will now only be able to see the arrow marker, since that is the last one which was published on update_full. The status indicates that the circle client is still waiting for an initialisation message.
When using multiple servers which have different names within the same node, disabling and re-enabling the visualisation of the markers in rviz does not work correctly.
The cause of this is likely the
update_full
topic being used to know when there are markers available. Because this is a latched topic generated by the server, it only retains the last published message on the topic. Each server with a differentserver_id
publishes to the same topic, which means that it's only possible for theprocess
function to get the init message for a single one of the servers.https://github.com/ros-visualization/interactive_markers/blob/36740b17068a42f44dc564d29b6b25c21c3a01a0/src/single_client.cpp#L66
https://github.com/ros-visualization/interactive_markers/blob/36740b17068a42f44dc564d29b6b25c21c3a01a0/src/interactive_marker_client.cpp#L151-L166
Use the code below to reproduce.
First, start rviz and add an interactive marker visualiser on the topic
/test/interactive
. Then, run this node. You will see a couple of markers appear, like this:The messages are as expected:
Then, uncheck the box to display the markers, and re-check it. You will now only be able to see the arrow marker, since that is the last one which was published on
update_full
. The status indicates that the circle client is still waiting for an initialisation message.