0
$\begingroup$

Rosanswers logo

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?


Originally posted by arennuit on ROS Answers with karma: 955 on 2014-09-11

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by arennuit with karma: 955 on 2014-09-12

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.