Gazebo | Ignition | Community
Ask Your Question

Creating custom models

asked 2019-07-23 13:33:54 -0500

trishantroy gravatar image

updated 2019-07-23 14:36:47 -0500

I want to create world files (having some obstacles in it). As an example of the world/environment, please consider the attached image. Please note that some polygons in the image are not rectangles.
To create this environment, from what I understand, I can create sdf files of each of the polygons in the image and create a world where I will include these polygons.
Doubt: how to create the sdf files of the polygons which are not rectangles.
image description

Please do tell if the question is not clear. Thanks in advance.

Edit 1: I would appreciate if the solution is as less cumbersome as possible while implementing for a large number of images. Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-07-23 13:44:40 -0500

bhej gravatar image

You can create complex models and shapes using Blender or Sketchup and exporting the mesh as a .dae file. Then you would need to create a folder for the model in your models directory and include a model.config and model.sdf files. You can view the structure of these files here:

For example, take a look at the mcity model in the car_demo repo:

Once you create your model folder and files, you can just include them at their position in the world file.

Related question:

edit flag offensive delete link more


Thanks a lot for the answer and the relevant links. But, is there a way to do this without using software where I would have to manually create the object and import the mesh file? Is there a workaround for this? Basically, it would be easier if there is a way to generate mesh (for simple polygons) by just giving the vertices' coordinates through code?

trishantroy gravatar imagetrishantroy ( 2019-07-23 14:12:28 -0500 )edit

What about this?
One can use the existing nist_maze_wall_120 model as walls for making the 3D polygons.
Though this may be the solution for this specific problem. Definitely, the solution suggested by @bhej is for general situations. Still curious about other solutions.

trishantroy gravatar imagetrishantroy ( 2019-07-23 14:26:56 -0500 )edit

Is extruding SVG files enough for you?

chapulina gravatar imagechapulina ( 2019-07-23 14:29:03 -0500 )edit

Yes. This is a great feature. Though, I am looking for a solution which is less cumbersome to implement in case of a large number of images like these. Thanks a lot @chapulina

trishantroy gravatar imagetrishantroy ( 2019-07-23 14:34:55 -0500 )edit

You can try using the <heightmap> or <image>tags in the SDF specification

Check out this tutorial: and

If your image is black and white as the one you provided, then this solution may be ideal for your case.

bhej gravatar imagebhej ( 2019-07-23 14:51:16 -0500 )edit

Great solution! I checked the video in the Github link. I will implement and post the remarks. Thanks a lot!

trishantroy gravatar imagetrishantroy ( 2019-07-23 15:07:52 -0500 )edit

Question Tools

1 follower


Asked: 2019-07-23 13:33:54 -0500

Seen: 425 times

Last updated: Jul 23 '19