ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Gazebo SDF model loading in Groovy

asked 2013-01-12 06:03:52 -0500

r0nald gravatar image

updated 2013-01-14 10:03:36 -0500

I have a correct Gazebo 1.2 (model), slightly modified from the (Gazebo tutorial). If that model with it's manifest.xml is in ~/.gazebo/models, then Gazebo of ROS can see and load this model.

Now I would like to load this model with the spawn_model script of ROS gazebo package.

I have tried this command:

rosrun gazebo spawn_model -gazebo -file /home/ronald/catkin_ws/src/gazebo_heightmap/Media/models/robot1/model.sdf -model myrobot

and tried with this launch file

<param name="robot_model" textfile="$(find gazebo_heightmap)/Media/models/robot1/model.sdf" />
<node name="spawn_robot1" pkg="gazebo" type="spawn_model" args="-gazebo -param robot_model -model myrobot" respawn="false" output="screen" />

In both cases, Gazebo node gives error messages

Error [] XML Element[origin], child of element[model] not defined in SDF. Ignoring.[model]
Error [] Error reading element <model>
Error [] Unable to read element <gazebo>
Error:   Could not find the 'robot' element in the xml file
     at line 61 in /tmp/buildd/ros-groovy-urdfdom-0.2.6-1precise-20121225-1343/urdf_parser/src/model.cpp
Error [] Unable to call parseURDF on robot model
Warning [] Gazebo SDF has no <gazebo> element in file[urdf string]
Error [] parse as old urdf model file failed.
Error [] Unable to read sdf string

To me it seems that the model description files must be different to load it with spawn_model, but how?

Update: The model does not contain <origin> element, as suggested. The model also loads if it is included in a world description file. Just the spawn_model does not work.

edit retag flag offensive close merge delete


Starting since Sep 2012, allgazebo related questions should be asked on new gazebo specific QA community. Thank you for your cooperation!

See also this thread.

130s gravatar image 130s  ( 2013-01-15 10:44:08 -0500 )edit

I keep, however, the thread open since the discussion has already been going on.

130s gravatar image 130s  ( 2013-01-15 10:44:25 -0500 )edit

But Gazebo can load this model easily, it seems just the spawn_model node that can't load the model. Isn't this node part of ROS?

r0nald gravatar image r0nald  ( 2013-01-27 22:33:16 -0500 )edit

Personally I agree with you. But the developers of Gazebo want all Qs to move to the new QA site. Please see the link I cited.

130s gravatar image 130s  ( 2013-01-27 22:59:26 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-01-12 12:09:48 -0500

It appears that the problem is not with your launch code but with your description file in the sdf format. The first line of the error messages says that you have used an element called <origin>, however there are no origins defined in sdf, and gazebo defines <pose> instead.

I didn't see any origin in the tutorial page you referenced however, were you to post the sdf file, that may help.



edit flag offensive delete link more


Link to the model file was included in the first post also : There is no <origin> tag used anywhere.

r0nald gravatar image r0nald  ( 2013-01-12 22:30:14 -0500 )edit

well what version of gazebo is installed?

PeterMilani gravatar image PeterMilani  ( 2013-01-13 12:04:55 -0500 )edit

It is Gazebo-1.2.5 that come with Groovy.

r0nald gravatar image r0nald  ( 2013-01-13 21:43:56 -0500 )edit

You're also mixing ' and " this could also lead to problems perhaps? I see the tutorial mixes them also but I think it caused problems in my simulation.

davinci gravatar image davinci  ( 2013-01-15 03:41:46 -0500 )edit

Question Tools


Asked: 2013-01-12 06:03:52 -0500

Seen: 4,878 times

Last updated: Jan 14 '13