Texture model from URDF

asked 2022-09-01 13:09:54 -0500

MarqRazz gravatar image

Gazebo Version: Fortress

ROS Version: Humble

I am working on testing out an extrinsic camera calibration library and I would like to use Gazebo as my ground truth but I need to attach a calibration grid to the end of my robot arm and I'm struggling to get it to render properly in simulation.

In my URDF I have the following (see below) and you can see that I have tried several different methods (they are commented out) but the only way I have been able to change the material of this link is with the <material name=""> <color rgba="1.0 0 0 1" /> </material> tag which is not super useful because its a single color (I need to map an image to the surface).

Inside the <gazebo reference= block I have tried with and without the <visual name="visual"> blocks and when I don't include them I get the following message when I start the simulation. [ign gazebo-4] Warning [parser_urdf.cc:1184] Attribute value string not set

If anyone has suggestions or tips on how I can get this working I would really appreciate your help!

<link name="cal_grid_link">
    <origin xyz="0 0 0" rpy="0 0 0" />
    <mass value="0.1" />
    <inertia ixx="0.00021268" ixy="5.21E-06" ixz="2.91E-06" iyy="0.00106371" iyz="1.1E-07" izz="0.00108465" />
  <collision name="collision">
      <box size="0.1 0.2 0.01"/>
  <visual name="visual">
      <box size="0.1 0.2 0.01"/>
    <!-- <material name="green"> Does NOT work!!!
      <ambient>1 1 1 1</ambient>
      <diffuse>0 1 0 1</diffuse>
      <specular>0 0 0.3 1</specular>
  </material>       -->
  <material name="">
    <color rgba="1.0 0 0 1" />
<gazebo reference="cal_grid_link">
  <!-- <visual name="visual">   Does NOT work!!!
  </visual> -->
  <!-- <visual>  Does NOT work!!!
    <material name="cal_pattern">      
      <diffuse>1 1 1 1</diffuse>
      <specular>0.4 0.4 0.4 1</specular>
  </visual> -->
<joint name="cal_grid_joint" type="fixed">
  <origin xyz="0.3 0.3 0.3" rpy="0 0 0" />
  <parent link="${prefix}upper_wrist_link" />
  <child link="cal_grid_link" />
edit retag flag offensive close merge delete


I've run out of ideas here, if there are any Gazebo experts out there I could really use your help!

I tried to embed the texture into the mesh with Blender and it works in Rviz but not in Ignition Gazebo.

image description

MarqRazz gravatar imageMarqRazz ( 2022-09-06 13:29:37 -0500 )edit