Texture does not work properly
I am trying to put a texture defined in PNG file to a custom made model in defined by OBJ file.
I have this folder structure with the model
model_name
├── materials
│ ├── scripts
│ │ └── model_name.material
│ └── textures
│ └── floor0.png
├── meshes
│ └── model_name.obj
├── model.config
└── model.sdf
this is the image floor0.png
This is the model.sdf file content
<?xml version="1.0" ?>
<sdf version="1.6">
<model name="model_name">
<static>true</static>
<link name="link">
<pose>0 0 0 0 0 0</pose>
<collision name="collision">
<geometry>
<mesh>
<uri>model://model_name/meshes/model_name.obj</uri>
</mesh>
</geometry>
<surface>
<friction>
<ode>
<mu>1</mu>
<mu2>1</mu2>
<fdir1>0 0 0</fdir1>
<slip1>0</slip1>
<slip2>0</slip2>
</ode>
</friction>
</surface>
</collision>
<visual name="visual">
<geometry>
<mesh>
<uri>model:/model_name/meshes/model_name.obj</uri>
</mesh>
</geometry>
<material>
<script>
<uri>model://model_name/materials/scripts</uri>
<uri>model://model_name/materials/textures</uri>
<name>Floor0</name>
</script>
</material>
</visual>
</link>
</model>
</sdf>
this is the model_name.material file content
material Floor0
{
technique
{
pass
{
texture_unit
{
texture ../textures/floor0.png
scale 1.0 1.0
}
}
}
And this is the resulting view in Gazebo when I launch spawn this model
It is only one color (the color in the bottom left corner of the PNG file). Couriously if I change the scale in the material file, the color might change to orange (the color in the middle of the PNG file) but the color stays homogeneous.
What is happening and how do I make the Gazebo render the texture correctly?