Gazebo | Ignition | Community
Ask Your Question
4

Error loading SDF in Gazebo 1.3.1

asked 2013-01-15 19:57:12 -0500

Ben B gravatar image

updated 2013-02-01 22:50:41 -0500

I'm trying to load a simple SDF in Gazebo and I'm getting an error.

I'm running Gazebo 1.3.1.

The SDF is copied straight from a tutorial. The code is:

<?xml version='1.0'?>
<sdf version='1.3'>
  <model name="my_robot">
     <static>true</static>
       <link name='chassis'>
        <pose>0 0 .1 0 0 0</pose>

        <collision name='collision'>
          <geometry>
            <box>
              <size>.4 .2 .1</size>
            </box>
          </geometry>
        </collision>

        <visual name='visual'>
          <geometry>
            <box>
              <size>.4 .2 .1</size>
            </box>
          </geometry>
        </visual>
      </link>
  </model>
</sdf>

I tried to launch it using:

gzfactory spawn -f model3.sdf

The error I'm getting is this:

Error [SDF.cc:984] Unable to find value for key[origin]
Error [SDF.cc:738] Missing element description for [origin]
Segmentation fault (core dumped)

Someone else posted about this error here. It was said to be fixed in the bug report, but I don't think it was.

Is there a fix for this? Is there a better way to spawn an SDF?

Verdict: Probably a bug. Filed here . Workaround: Follow the directions given in the answer below or equivalently in the Gazebo Handbook.

edit retag flag offensive close merge delete

Comments

I have same problem. Any solution?

Daehyung Park gravatar imageDaehyung Park ( 2013-01-21 12:41:14 -0500 )edit

Perhaps upvoting the question will get it more attention from the admins. (And a solution is given below by Andrei).

Ben B gravatar imageBen B ( 2013-01-21 15:22:34 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
3

answered 2013-01-17 02:28:22 -0500

AndreiHaidu gravatar image

I had the same problem :).

The workaround I used, I copied all my models into ~/.gazebo/models folder. Then you can either spawn them from gazebo. Or by adding these lines to the .world file:

<world>
...
    <include>
        <uri>model://my_robot</uri>
        <pose>0.3 0.5 0.9 0 0 0</pose>
    </include>
</world>

It is weird they still haven't fixed this bug. It is not very portable having the models in that folder.

edit flag offensive delete link more

Comments

Works! Thanks for the answer. Perhaps upvoting the question will get this bug more attention from the admins.

Ben B gravatar imageBen B ( 2013-01-21 15:22:59 -0500 )edit
1

answered 2013-02-05 14:40:41 -0500

hsu gravatar image
edit flag offensive delete link more
0

answered 2013-01-16 04:26:11 -0500

AndreiHaidu gravatar image

Hi, Are you sure you are using Gazebo 1.3? Because the sdf file you have is for version 1.3. Here are the tutorials for different versions also.

edit flag offensive delete link more

Comments

Thanks for the note. I've found a computer in my group's lab that can run 1.3.1. Now I'm getting a whole different error. I updated the question to reflect this.

Ben B gravatar imageBen B ( 2013-01-16 18:40:32 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2013-01-15 19:57:12 -0500

Seen: 1,035 times

Last updated: Feb 05 '13