ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Material urdf

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

arennuit gravatar image


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

<link name="chassis" >
      <box size="${sheet_sx} ${sheet_sy} ${sheet_sz}" />
    <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"/>
      <box size="${chassis_sx} ${chassis_sy} ${chassis_sz}" />
    <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
  <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" />

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

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

arennuit gravatar image

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 1,297 times

Last updated: Sep 12 '14