Home | Tutorials | Wiki | Issues
Ask Your Question
0

Creating custom models

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

trishantroy gravatar image

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

Hello,
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
0

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

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: http://gazebosim.org/tutorials?tut=mo...

For example, take a look at the mcity model in the car_demo repo: https://github.com/osrf/car_demo/tree...

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

Related question: https://answers.ros.org/question/2204...

edit flag offensive delete link more

Comments

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 -0600 )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 -0600 )edit

Is extruding SVG files enough for you? http://gazebosim.org/tutorials?tut=ex...

chapulina gravatar imagechapulina ( 2019-07-23 14:29:03 -0600 )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 -0600 )edit

You can try using the <heightmap> or <image>tags in the SDF specification http://sdformat.org/spec?ver=1.6&elem...

Check out this tutorial: https://github.com/AS4SR/general_info... and http://gazebosim.org/tutorials/?tut=dem

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 -0600 )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 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 103 times

Last updated: Jul 23