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

Urdf rgba displays strangely in rviz

asked 2020-03-18 21:57:46 -0500

Enmar gravatar image

I am doing the ROS urdf tutorials. Upon reaching the materials section I noticed that the alpha for rgba materials property is acting strange. For me if a=1.0 it is 50% transparent and if a=2.0 it is no longer transparent. This is bizarre to me as logically 0->1 should be the transparency range as with the rgb portion of rgba.

Below is the urdf I used and a screenshot of the display on rviz. Anyone have an explanation?

<?xml version="1.0"?>
<robot name="myfirst">

  <material name="blue">
    <color rgba="0 0 0.8 2"/>
  </material>

  <material name="white">
    <color rgba="1 1 1 1"/>
  </material>

  <link name="base_link">
    <visual>
      <geometry>
        <cylinder length="0.6" radius="0.2"/>
      </geometry>
      <material name="blue"/>
    </visual>
  </link>

  <link name ="right_leg">
    <visual>
      <geometry>
        <box size="0.6 0.1 0.2"/>
      </geometry>
      <origin rpy="0 1.57075 0" xyz="0 0 -0.3"/>
      <material name="white"/>
    </visual>
  </link>

  <joint name="base_to_right_leg" type="fixed">
    <parent link="base_link"/>
    <child link="right_leg"/>
    <origin xyz="0 -0.22 0.25"/>
  </joint>

  <link name ="left_leg">
    <visual>
      <geometry>
        <box size="0.6 0.1 0.2"/>
      </geometry>
      <origin rpy="0 1.57075 0" xyz="0 0 -0.3"/>
      <material name="white"/>
    </visual>
  </link>

  <joint name="base_to_left_leg" type="fixed">
    <parent link="base_link"/>
    <child link="left_leg"/>
    <origin xyz="0 0.22 0.25"/>
  </joint>

</robot>

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-20 14:59:18 -0500

Enmar gravatar image

It seems that for the tutorials the rviz has been configured to show half the transparency of the urdf file.

I took a look at the rviz config file in the urdf tutorials package (urdf_tutorials/rviz/urdf.rviz) and saw that on line 53 the Alpha for rviz/RobotModel has been set to 0.5 there. Changing this value to 1.0 restored regular behavior.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-03-18 21:57:46 -0500

Seen: 1,620 times

Last updated: Mar 20 '20