Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using multiple visual-tags in URDF, but the material-tag of the first one is used for both #1293

Open
M-Schroeder opened this issue Nov 8, 2024 · 1 comment

Comments

@M-Schroeder
Copy link

I am creating an urdf and want to show 2 meshes for one link. One of them should be transparent and the other one not. My idea was to put both meshes inside their own visual tag and one of them has a material-tag, that defines the transparency. To test it, I modified the following section of this xacro:

    <!-- Base link -->
    <link name="base_link">

        <visual>
            <origin xyz="0 0 0.2" rpy="0 0 0" />
            <geometry>
                <mesh filename="package://agilex_scout_mini_description/meshes/wheel.dae" />
            </geometry>
            <material name="half_transparent">
                <color rgba="0 0 0 0.5"/>
            </material>
        </visual>

        <visual>
            <origin
                    xyz="0 0 0"
                    rpy="1.5707 0 -1.5707" />
            <geometry>
                <mesh filename="package://scout_description/meshes/scout_mini_base_link.dae" />
            </geometry>
        </visual>

        <collision>
            <origin xyz="0 0 0" rpy="1.5707 0 -1.5707" />
          <geometry>
            <mesh filename="package://scout_description/meshes/scout_mini_base_link.dae" />
          </geometry>
        </collision>
    </link>

Not only the first mesh (here wheel.dae) is transparent, but both. If I switch the order, none of them is transparent. Even if I explicitly define a material with <color rgba="0 0 0 1"/> for the second mesh, it stays transparent.

It was tested with ROS2 humble.

@ANogin
Copy link

ANogin commented Nov 20, 2024

I am seeing the same or similar issue with Rviz 12.4.8 (ROS 2 Iron). Specifically, I have a URDF with multiple visual tags for a single link tags, and when the robot is visualized by a MoveIt2's moveit_rviz_plugin/MotionPlanning with Scene Robot: {Show Robot Collision: false, Show Robot Visual: true} settings, and all meshes for each given link are shown based on the material for the 1st visual, ignoring the material for all subsequent visuals for that link.

P.S. As far as I can tell, an Rviz1 patch for this was created about 10 years ago in ros-visualization/rviz#812 and then a few years later was merged - for Kinetic in ros-visualization/rviz#1079 and for Indigo in ros-visualization/rviz#1080, and as far as I can tell, these changes are all in there in Rviz2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants