Skip to content

Commit

Permalink
Attached Collision Object Transparency (#3093) (#3099)
Browse files Browse the repository at this point in the history
* Allows attached collision objects to be transparent

* Allows for config/RViz driven changing of the attached collision object transparency

---------

Co-authored-by: Sebastian Jahr <[email protected]>
(cherry picked from commit 1944811)

Co-authored-by: Aiden <[email protected]>
  • Loading branch information
mergify[bot] and rr-aiden authored Nov 15, 2024
1 parent 91a5822 commit 375e07e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<shapes::ShapeConstPtr>& ab_shapes = attached_body->getShapes();
for (std::size_t j = 0; j < ab_shapes.size(); ++j)
Expand Down

0 comments on commit 375e07e

Please sign in to comment.