Skip to content

Commit

Permalink
Attached Collision Object Transparency (#3093)
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 <sebastian.jahr@picknik.ai>
(cherry picked from commit 1944811)
  • Loading branch information
rr-aiden authored and mergify[bot] committed Nov 15, 2024
1 parent a5de4e4 commit 66c0205
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 66c0205

Please sign in to comment.