From 375e07e2b759f1c2b3a6a370d395ef9fbb0a29da Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:00:22 -0500 Subject: [PATCH] Attached Collision Object Transparency (#3093) (#3099) * Allows attached collision objects to be transparent * Allows for config/RViz driven changing of the attached collision object transparency --------- Co-authored-by: Sebastian Jahr (cherry picked from commit 1944811f3dcd53d1ddf11ee92511a4bfe575fdeb) Co-authored-by: Aiden <148049589+rr-aiden@users.noreply.github.com> --- .../planning_scene_rviz_plugin/src/planning_scene_display.cpp | 4 ++-- .../rviz_plugin_render_tools/src/planning_scene_render.cpp | 2 +- .../src/robot_state_visualization.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/moveit_ros/visualization/planning_scene_rviz_plugin/src/planning_scene_display.cpp b/moveit_ros/visualization/planning_scene_rviz_plugin/src/planning_scene_display.cpp index a9d6419730..f336213066 100644 --- a/moveit_ros/visualization/planning_scene_rviz_plugin/src/planning_scene_display.cpp +++ b/moveit_ros/visualization/planning_scene_rviz_plugin/src/planning_scene_display.cpp @@ -347,10 +347,10 @@ void PlanningSceneDisplay::changedSceneName() void PlanningSceneDisplay::renderPlanningScene() { QColor color = scene_color_property_->getColor(); - Ogre::ColourValue env_color(color.redF(), color.greenF(), color.blueF()); + Ogre::ColourValue env_color(color.redF(), color.greenF(), color.blueF(), scene_alpha_property_->getFloat()); if (attached_body_color_property_) color = attached_body_color_property_->getColor(); - Ogre::ColourValue attached_color(color.redF(), color.greenF(), color.blueF()); + Ogre::ColourValue attached_color(color.redF(), color.greenF(), color.blueF(), robot_alpha_property_->getFloat()); try { diff --git a/moveit_ros/visualization/rviz_plugin_render_tools/src/planning_scene_render.cpp b/moveit_ros/visualization/rviz_plugin_render_tools/src/planning_scene_render.cpp index e9bb41b4e2..9d2f396c0b 100644 --- a/moveit_ros/visualization/rviz_plugin_render_tools/src/planning_scene_render.cpp +++ b/moveit_ros/visualization/rviz_plugin_render_tools/src/planning_scene_render.cpp @@ -91,7 +91,7 @@ void PlanningSceneRender::renderPlanningScene(const planning_scene::PlanningScen color.r = default_attached_color.r; color.g = default_attached_color.g; color.b = default_attached_color.b; - color.a = 1.0f; + color.a = default_attached_color.a; planning_scene::ObjectColorMap color_map; scene->getKnownObjectColors(color_map); scene_robot_->update(moveit::core::RobotStateConstPtr(rs), color, color_map); 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 95cc5ca8d7..88bfa66be8 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 @@ -137,7 +137,7 @@ void RobotStateVisualization::updateHelper(const moveit::core::RobotStateConstPt RCLCPP_ERROR_STREAM(LOGGER, "Link " << attached_body->getAttachedLinkName() << " not found in rviz::Robot"); continue; } - Ogre::ColourValue rcolor(color.r, color.g, color.b); + Ogre::ColourValue rcolor(color.r, color.g, color.b, color.a); const EigenSTL::vector_Isometry3d& ab_t = attached_body->getShapePosesInLinkFrame(); const std::vector& ab_shapes = attached_body->getShapes(); for (std::size_t j = 0; j < ab_shapes.size(); ++j)