Gazebo | Ignition | Community
Ask Your Question

gzfactory spawning issues

asked 2014-04-11 08:33:48 -0600

Carbon Based Lifeform gravatar image

updated 2014-04-11 11:00:33 -0600

Hello, whenever I try to spawn my robot model in the gazebo world from command line, typing

gzfactory spawn -f model.sdf -z 0.19

I get

Error [] Unable to call parseURDF on robot model
Error [] parse as old deprecated model file failed.
Error: SDF parsing the xml failed

At first, I thought that this was caused by the fact that I had in the same folder my model.sdf and my model.urdf, so I moved the urdf file into another folder and retried. Same result. If I load the robot.urdf model, it successfully spawns with the requested offset, just to collapse into the ground after a few instants (might be a problem of collision?). If I load my robot.sdf file with a world plugin, everything is fine again, except that I would like to spawn with a global z offset and that's why I'm using gzfactory. (Of course the error occurs even if don't specify the offset). What's happening?

EDIT: I'm working with Gazebo 2.2

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-04-14 07:44:42 -0600

updated 2014-04-14 07:47:16 -0600


I'm using gazebo 1.9 but for me the script works fine... can you try using gzfactory with one of the models from the model database

I tried:

gzfactory spawn -f ~/.gazebo/models/beer/model-1_4.sdf -y -5.0

and it works fine...(you have to download the beer before you can use it ;) )

it is also possible to set the position of your model with the world plugin. The method SetWorldPose should do the trick here...

another thing you could do is loading the model using a world file

  <?xml version="1.0" ?>   
  <sdf version="1.4">
      <world name="default">
      <!-- A global light source -->
      <!-- A ground plane -->
        <pose>-2.0 70.0 0 0 0 0</pose>


this way you can specify a position to... i hope this helps

edit flag offensive delete link more


Thank you, I solved my problem by avoiding the gzfactory command, and by just using the <pose> offset in the model.sdf file.

Carbon Based Lifeform gravatar imageCarbon Based Lifeform ( 2014-04-14 11:17:42 -0600 )edit
Login/Signup to Answer

Question Tools


Asked: 2014-04-11 08:33:48 -0600

Seen: 800 times

Last updated: Apr 14 '14