Gazebo 2 and SDF V1.5 - Using Populations
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">
<include>
<static>true</static>
<uri>model://meshes/bush.dae</uri>
</include>
</model>
<pose>0 0 0 0 0 0</pose>
<box>
<size>10 10 0</size>
</box>
<model_count>10</model_count>
<distribution>
<type>random</type>
</distribution>
</population>
</world>
</sdf>
However, this version doesn't seem to work with Gazebo anymore. When I try simulating the world, I get this error:
Error [Converter.cc:127] Unable to convert from SDF version 1.5 to 1.4
Error [parser.cc:697] XML Element[population], child of element[world] not defined in SDF. Ignoring.[world]
Error [parser.cc:688] Error reading element <world>
Error [parser.cc:348] 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 [parser_urdf.cc:2608] Unable to call parseURDF on robot model
Error [parser.cc:273] 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! :-)
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.
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.