Home | Tutorials | Wiki | Issues
Ask Your Question
0

Trying to understand adding custom shapes to model editor

asked 2019-05-14 09:26:26 -0500

emile gravatar image

Problem: I am trying to import a .dae custom shape I exported using Blender to the model editor in Gazebo and it's not loading my textures properly.

Context: To try to understand what's going on I tried with a model that imports texture properly. I have a construction cone model in ~/.gazebo/models/construction_cone This folder contains two subfolders : a meshes subfolder containing a .dae file and a materials/textures subfolder with a .png texture file. It also contains a model.sdf file and a model.config file If I import this model using its .dae file into the model editor by clicking Add under Custom Shapes and browsing to the meshes directory, the textures are applied fine after importing the object.

Here is what I don't understand: If I make an IDENTICAL COPY of the meshes and materials subfolders to a different location on my computer and repeat the same exact import process, I get no textures at all. I tried moving over the sdf and config filles, having cloned exacly my ~/.gazebo/models/construction_cones to some other location and the model explorer is not loading my textures. Where is the texture information located ? What tells gazebo where to find the texture? I tought the dae file would suffice, but it looks like it doesn't.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-05-15 20:21:12 -0500

emile gravatar image

updated 2019-05-15 20:21:54 -0500

I solved my problem by not using the Model Editor and using a text editor to write my model files instead. The model editor can be used to create a new SDF file that will define a model that can be imported in the world in Gazebo (outside of the model editor), but that generates a very lengthy SDF that I didn't fully understand.

The model editor appends a default blank gray material to any model by default, and this seems to overwrite whatever texture the DAE file is trying to map. I tried to delete the gazebo/grey texture in the GUI but I still had no textures.

What finally SOLVED my problem was to write my own simple SDF file where I didn't define any script for the texture/material.

edit flag offensive delete link more

Comments

Nice solution. If that is the answer to your question, please, click the check-mark button on the left of your answer to accept it as the right answer.

kumpakri gravatar imagekumpakri ( 2019-05-17 08:28:02 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-05-14 09:26:26 -0500

Seen: 119 times

Last updated: May 15