Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Create model during runtime

Hello,

is there a way to create a model during runtime? I've created a little GUI overlay plugin with a button and some other elements. If the button is pressed i want to create some cylinders in the scene that are connected by joints at specified positions with specified dimensions. The position and size of the cylinders are not known during startup of Gazebo, so i don't want to use SDF files as used in most tutorials.

I've tried to find tutorials or a way to create models during runtime, but couldn't find anything. Is there a way to solve my problem?

Maybe i could create a string, that looks like a SDF file, as in this tutorial: http://gazebosim.org/tutorials?tut=gui_overlay&cat=user_input But i hope there is a better way, because the creation of such a string that simulates a SDF file with a couple of calculated parameters, that need to be used, would be complex and not very convenient. Maybe there are some already existing methods of gazebo, like (pseudocode): "createCylinder(position, radius, length); addJoint(cylinder, jointType); ...."

Thank you very much, skmCry