ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

RVIZ Interactive Markers - color change runtime

asked 2014-05-29 02:07:35 -0600

thomasL gravatar image

Hi,

I was wondering if it was possible to change the color of an Interactive Markers during run time? I tried to change the color of the mesh embedded in the Interactive Markers but nothing occurs when I update the Server:

server.get()->applyChanges();

The architecture of my Interactive Markers is :

visualization_msgs::Marker robot_mesh;
visualization_msgs::InteractiveMarkerControl robot_control; //contain robot_mesh
visualization_msgs::InteractiveMarker robot_marker; //contain robot_control

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-04-11 21:35:18 -0600

A solution that worked for me was to just clear all interactive markers and reinsert them all with the new colors. Surprisingly, this works even while a marker is being dragged in rviz

edit flag offensive delete link more
0

answered 2019-04-08 15:06:16 -0600

In python its as easy as changing the markers color attribute.

marker = server.get("marker_name")
marker.controls[0].markers[0].color.r = 150
marker.controls[0].markers[0].color.g = 0
marker.controls[0].markers[0].color.b = 0
server.applyChanges()
edit flag offensive delete link more

Comments

It does change but not as you drag the marker for me. I need to hit reset or toggle transparency box to make the update happen

rostoast gravatar image rostoast  ( 2019-08-15 09:51:59 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2014-05-29 02:07:35 -0600

Seen: 1,307 times

Last updated: Apr 11 '16