Gazebo | Ignition | Community
Ask Your Question

Create a Box Using Gazebo API

asked 2014-08-27 09:36:18 -0500

Eduardo Albuquerque gravatar image

How do I use Gazebo API to create a model? I want to implement a world plugin that creates a box with its size defined by a custom message, but I cant find any example of how to create a model using Gazebo API

Thanks for the help


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-08-27 10:52:31 -0500

nkoenig gravatar image

There is code in gazebo/gui/BoxMaker that you can use.

The BoxMaker class creates an SDF for a box, and sends the SDF string in a factory message on the ~/factory topic. You should also look at BoxMaker's parent class EntityMaker.

edit flag offensive delete link more


Thanks for your advice! That will be useful! That's a good starting point. Actually, I'm trying to implement a Remote Client for creating/modifying models (e.g. a robotic arm) dynamically. Can I use the API for add/modifying links and joints in a model that I created before. If I do, is there any sample code? If I can't, I'm thinking about modifying the model SDF description and reload it in the world every time the user modifies the model.

Eduardo Albuquerque gravatar imageEduardo Albuquerque ( 2014-08-27 12:41:01 -0500 )edit

Editing an existing model as you have described is not recommended. Try removing the current model, and add a new model.

nkoenig gravatar imagenkoenig ( 2014-08-28 11:53:41 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-08-27 09:36:18 -0500

Seen: 230 times

Last updated: Aug 27 '14