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

Gazebo SDF model loading in Groovy

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

r0nald gravatar image

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

I have a correct Gazebo 1.2 http://pastebin.com/Q0nLVDLa (model), slightly modified from the http://gazebosim.org/wiki/Tutorials/1.2/build_robot/mobile_base (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

<launch>
<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" />
</launch>

In both cases, Gazebo node gives error messages

Error [parser.cc:675] XML Element[origin], child of element[model] not defined in SDF. Ignoring.[model]
Error [parser.cc:666] Error reading element <model>
Error [parser.cc:366] 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 [parser_urdf.cc:1659] Unable to call parseURDF on robot model
Warning [parser.cc:374] Gazebo SDF has no <gazebo> element in file[urdf string]
Error [parser.cc:318] parse as old urdf model file failed.
Error [World.cc:1190] 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

Comments

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

1 Answer

Sort by ยป oldest newest most voted
0

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

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.

cheers

Peter

edit flag offensive delete link more

Comments

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

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

well what version of gazebo is installed?

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

It is Gazebo-1.2.5 that come with Groovy.

r0nald gravatar image r0nald  ( 2013-01-13 21:43:56 -0600 )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 -0600 )edit

Question Tools

Stats

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

Seen: 5,022 times

Last updated: Jan 14 '13