ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

Color issue with URDF and multiple visual tags

asked 2014-04-18 04:36:43 -0500

Tom Moore gravatar image

updated 2016-10-24 08:35:06 -0500

ngrennan gravatar image

I am trying to build a URDF model that comprises different components with different colors. However, I don't necessarily want every component to be its own link; I'm just aiming for a higher level of visual fidelity. I saw here that it's possible to have multiple <visual> tags within a given <link>:

http://answers.ros.org/question/10913...

...and indeed, this works. However, subsequent <visual> tags appear to have their <material> tags ignored, and instead get painted the color of the first <visual> tag. In other words, if I do this:

  <link name="link1">
    <visual>
      <geometry>
        <cylinder length="4" radius="1"/>
      </geometry>
      <material name="black_metal">
        <color rgba="0.1 0.1 0.1 1"/>
      </material>
    </visual>
    <visual>
      <geometry>
        <cylinder length="2" radius="5"/>
      </geometry>
      <material name="gold">
        <color rgba="1 0.549 0 1"/>
      </material>
    </visual>
  </link>

...then BOTH my cylinders end up getting colored as the "black_metal" material. Is this a bug, or am I simply using URDF in a manner which was not intended?

EDIT: I'm using Hydro.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-09-14 11:04:56 -0500

Kei Okada gravatar image

I think this is current limitation of rviz, I created patches at https://github.com/ros-visualization/... , but not seems good. Need someone to rewrite better one.

edit flag offensive delete link more

Comments

Cool, thanks for doing that! I'll check it out. If your PR gets accepted and merged, I'll select this as the answer.

Tom Moore gravatar image Tom Moore  ( 2014-09-15 09:01:57 -0500 )edit
0

answered 2018-03-12 21:15:11 -0500

Tim Craig gravatar image

I discovered this behavior today in Kinetic. Only the first visual element uses the specified material color and the following elements are colored black by RViz. Since the OP was using black material, this wouldn't have been noticed.

edit flag offensive delete link more

Comments

From https://github.com/ros-visualization/... , if you use rviz >= 1.12.5 include the patch for this. If you still have problem, I would suggest to post a new issue to github.

Kei Okada gravatar image Kei Okada  ( 2018-03-12 23:11:10 -0500 )edit

I'm using RViz 1.12.15.

Tim Craig gravatar image Tim Craig  ( 2018-03-13 02:45:03 -0500 )edit

ok, please pust a issue to github and cc to @k-okada

Kei Okada gravatar image Kei Okada  ( 2018-03-13 08:28:28 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2014-04-18 04:36:43 -0500

Seen: 3,198 times

Last updated: Sep 14 '14