ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Gazebo 2 and SDF V1.5 - Using Populations

asked 2015-12-24 08:21:12 -0500

mp514 gravatar image

updated 2015-12-24 09:47:53 -0500

Hi there,

I currently have ROS Indigo running Gazebo 2.2.6 on my Ubuntu 14.04 LTE system without any issues.

My aim is to create a farm world in Gazebo. I've successfully loaded a single .dae grassland mesh in the simulator through a .world file using SDF V1.4. Now, I'm trying to follow this tutorial to add a randomly distributed population of .dae bush models to the world. Looking at this link, I noted that the 'population' tag was introduced in SDF V1.5. I've therefore changed my code to use this format:

<?xml version="1.0"?>
<sdf version="1.5">
  <world name="default">

    <... farmland model, world physics ...>

    <population name="bush_population">
      <model name="bush">
      <pose>0 0 0 0 0 0</pose>
        <size>10 10 0</size>

However, this version doesn't seem to work with Gazebo anymore. When I try simulating the world, I get this error:

Error [] Unable to convert from SDF version 1.5 to 1.4
Error [] XML Element[population], child of element[world] not defined in SDF. Ignoring.[world]
Error [] Error reading element <world>
Error [] Unable to read element <sdf>
Error:   Could not find the 'robot' element in the xml file
     at line 81 in /build/buildd/urdfdom-0.2.10+dfsg/urdf_parser/src/model.cpp
Error [] Unable to call parseURDF on robot model
Error [] parse as old deprecated model file failed.

followed by a crash. I suspect the problem has something to do with the libsdformat-dev package installed, but I'm not sure how to go about fixing this without causing dependency issues. I've tried both re-installing Gazebo 2 and migrating to Gazebo 4, but I'd prefer to stay with 2 as 4 seems to cause some other less obvious problems in my programs.

I would really appreciate if anyone has any clues on how to fix this! I'm quite new to Linux/Gazebo/ROS so input from someone with more experience would be very appreciated.

Many thanks in advance! :-)

edit retag flag offensive close merge delete


Maybe you can do this thing with latest gazebo, and save bushes as simple model, than import your simple model to your new world file which created via Gazebo 2.

Orhan gravatar image Orhan  ( 2016-02-10 06:35:20 -0500 )edit

I did this for creating walls from floor plan. Gazebo 2 doesn't have this feature, so I created with 6, saved as model, and imported. But I'm not sure about saving random created objects as model.

Orhan gravatar image Orhan  ( 2016-02-10 06:44:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-02-09 08:51:39 -0500

updated 2016-02-10 03:03:44 -0500


I had the same problem like yours. This is why I found your question, when I was searching the answer in ROS forum.

The link will lead you to my question.

In short words, the gazebo tutorial "population of models" were written for Gazebo 5+ , SDF 1.5, Jade distribution.

image description

So, there was the version mismatch ...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-12-24 08:21:12 -0500

Seen: 1,790 times

Last updated: Feb 10 '16