0
$\begingroup$

Rosanswers logo

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

<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 element, as suggested. The model also loads if it is included in a world description file. Just the spawn_model does not work.


Originally posted by r0nald on ROS Answers with karma: 268 on 2013-01-12

Post score: 1


Original comments

Comment by 130s on 2013-01-15:
Starting since Sep 2012, all gazebo related questions should be asked on new gazebo specific QA community. Thank you for your cooperation!

See also this thread.

Comment by 130s on 2013-01-15:
I keep, however, the thread open since the discussion has already been going on.

Comment by r0nald on 2013-01-27:
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?

Comment by 130s on 2013-01-27:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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 , however there are no origins defined in sdf, and gazebo defines 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


Originally posted by PeterMilani with karma: 1493 on 2013-01-12

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by r0nald on 2013-01-12:
Link to the model file was included in the first post also : http://pastebin.com/Q0nLVDLa There is no tag used anywhere.

Comment by PeterMilani on 2013-01-13:
well what version of gazebo is installed?

Comment by r0nald on 2013-01-13:
It is Gazebo-1.2.5 that come with Groovy.

Comment by davinci on 2013-01-15:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.