From 73c386f4356dcf5c108b00325796524bec189ffc Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 08:16:41 -0500 Subject: [PATCH] Use attached object colors as is in Rviz plugin (#3274) (#3278) (cherry picked from commit 870b23d8fd96ce4636c2f8ab6b96dacac860d2aa) Co-authored-by: Aleksey Nogin --- .../src/robot_state_visualization.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/moveit_ros/visualization/rviz_plugin_render_tools/src/robot_state_visualization.cpp b/moveit_ros/visualization/rviz_plugin_render_tools/src/robot_state_visualization.cpp index a539292100..fcf479d8e5 100644 --- a/moveit_ros/visualization/rviz_plugin_render_tools/src/robot_state_visualization.cpp +++ b/moveit_ros/visualization/rviz_plugin_render_tools/src/robot_state_visualization.cpp @@ -132,11 +132,9 @@ void RobotStateVisualization::updateHelper(const moveit::core::RobotStateConstPt { std::map::const_iterator it = color_map->find(attached_body->getName()); if (it != color_map->end()) - { // render attached bodies with a color that is a bit different - color.r = std::max(1.0f, it->second.r * 1.05f); - color.g = std::max(1.0f, it->second.g * 1.05f); - color.b = std::max(1.0f, it->second.b * 1.05f); - alpha = color.a = it->second.a; + { + color = it->second; + alpha = color.a; } } rviz_default_plugins::robot::RobotLink* link = robot_.getLink(attached_body->getAttachedLinkName());