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

Material urdf

asked 2014-09-11 04:24:34 -0500

arennuit gravatar image

Hello,

I have a urdf which does not display its material correctly, here is the code:

<link name="chassis" >
  <visual>
    <geometry>
      <box size="${sheet_sx} ${sheet_sy} ${sheet_sz}" />
    </geometry>
    <origin xyz="0.0 0.0 ${(chassis_sz + sheet_sz) / 2.0}" rpy="0.0 0.0 0.0" />
    <material name="myColor">
      <color rgba="0.0 0.0 1.0 1.0"/>
    </material>
  </visual>
  <collision>
    <geometry>
      <box size="${chassis_sx} ${chassis_sy} ${chassis_sz}" />
    </geometry>
    <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
  </collision>
  <xacro:box_inertia sizeX="${chassis_sx}" sizeY="${chassis_sy}" sizeZ="${chassis_sz}" mass="${mb_mass - sheet_mass - 4 * wheel_mass}">
    <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
  </xacro:box_inertia>
</link>

The box should be blue and it is actually white in gazebo (it is red in RViz for some reason I do not know).

I tried many different ways to define the material (in a separate file, at the beginning of the file...) nothing seems to work.

I am using precise with hydro.

Any idea?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-09-12 03:04:58 -0500

arennuit gravatar image

updated 2014-09-12 03:06:40 -0500

I found what is going on: you actually need to specify the same material twice, for urdf on the one side and for sdf on the other side (redundant material specification for ros/urdf on the one hand and gazebo/sdf on the other hand because these are not compatible). Check document Using a URDF in Gazebo for more details.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-09-11 04:24:34 -0500

Seen: 1,467 times

Last updated: Sep 12 '14