Interactive Marker Server: Update marker

asked 2019-10-29 13:46:26 -0500

atyshka gravatar image

Is there any way to update the markers in a c++ InteractiveMarkerServer? I see an updatePose method in the code API for InteractiveMarkerServer but nothing else. There are certain cases where it would be useful to update attributes of a marker such as its color, size, or description but I can't find a way to do this. I have seen it done though in packages such as moveit where indicators change color to indicate a change of state. A hacky solution would be removing the marker from the server, then re-adding it back with the desired changes, but this is not elegant. Can I trigger an update using something like topics or must I resort to the delete and re-add method?

edit retag flag offensive close merge delete


Trying to do so using the below after updating the marker color of a marker previously added to the interactive marker server - in the event callback. I am updating the correct memory location for the marker which was previously added to the server. I see the changes reflected on printing but the update is not visible in RVIZ.

int_marker.controls[0].markers[0].action = visualization_msgs::Marker::ADD; server->applyChanges();

shreyasj gravatar image shreyasj  ( 2023-04-13 11:52:58 -0500 )edit