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

trouble using extern .world

asked 2018-02-22 06:32:36 -0500

StanSmooth gravatar image

updated 2018-02-27 10:07:10 -0500

Hi everyone,

I'm currently working with this great package (rrt_exploration) and i'm trying to use different map to simulate my environment on gazebo. I tested the map including in the package, and also some map from gazebo package (as willow garage).

Currently i'm trying to use these worlds on the package but it doesn't work.

My guess is that there is different type of .world : for instance here is the code of one of the working world :

<?xml version="1.0" ?>
<sdf version="1.4">
 <world name="default">
<include>
  <uri>model://ground_plane</uri>
</include>
<include>
  <uri>model://sun</uri>
</include>


<model name="floor">
   <pose>0 0 -0.110060  0 0 0</pose>
  <static>false</static>
  <link name="floorPlan">
    <visual name="visual">
      <geometry>
        <mesh><uri>file://largeMap.dae</uri></mesh>
      </geometry>
    </visual>


    <collision name="collision">
      <geometry>
        <mesh><uri>file://largeMap.dae</uri></mesh>
      </geometry>
    </collision>
  </link>
</model>
</world>
</sdf>

and here is (a part of) the .world i'm trying to use :

<sdf version='1.6'>
<world name='default'>
<scene>
  <shadows>0</shadows>
  <ambient>0.4 0.4 0.4 1</ambient>
  <background>0.7 0.7 0.7 1</background>
</scene>
<light name='sun' type='directional'>
  <cast_shadows>0</cast_shadows>
  <pose frame=''>0 0 5 0 -0 0</pose>
  <diffuse>0.8 0.8 0.8 1</diffuse>
  <specular>0.1 0.1 0.1 1</specular>
  <attenuation>
    <range>1000</range>
    <constant>0.9</constant>
    <linear>0.01</linear>
    <quadratic>0.001</quadratic>
  </attenuation>
  <direction>-0.5 0.5 -1</direction>
</light>
<physics name='default_physics' default='0' type='ode'>
  <max_step_size>0.001</max_step_size>
  <real_time_factor>1</real_time_factor>
  <real_time_update_rate>1000</real_time_update_rate>
</physics>
<scene>
  <ambient>0.4 0.4 0.4 1</ambient>
  <background>0.7 0.7 0.7 1</background>
  <shadows>1</shadows>
</scene>
<spherical_coordinates>
  <surface_model>EARTH_WGS84</surface_model>
  <latitude_deg>0</latitude_deg>
  <longitude_deg>0</longitude_deg>
  <elevation>0</elevation>
  <heading_deg>0</heading_deg>
</spherical_coordinates>
<model name='ground_plane'>
  <static>1</static>
  <link name='link'>
    <collision name='collision'>
      <geometry>
        <plane>
          <normal>0 0 1</normal>
          <size>100 100</size>
        </plane>
      </geometry>
      <surface>
        <friction>
          <ode>
            <mu>1</mu>
            <mu2>1</mu2>
          </ode>
          <torsional>
            <ode/>
          </torsional>
        </friction>
        <bounce/>
        <contact>
          <ode/>
        </contact>
      </surface>
      <max_contacts>10</max_contacts>
    </collision>
    <visual name='visual'>
      <cast_shadows>0</cast_shadows>
      <geometry>
        <plane>
          <normal>0 0 1</normal>
          <size>100 100</size>
        </plane>
      </geometry>
      <material>

(not the complete code : it's about 38903 lines...

My question is : what's the difference between these two files .world, and how can i use the second one on my simulation ?

Thanks in advance !

EDIT : it seems to be a compatibility problem :

    Warning [parser.cc:340] Converting a deprecated source[/home/lklk/hugo_ws/src/rrt_exploration_tutorials/launch/includes/worlds/office_earthquake.world].
Warning [Converter.cc:59]   Version[1.6] to Version[1.4]
  Please use the gzsdf tool to update your SDF files.
    $ gzsdf convert [sdf_file]
Error [Converter.cc:127] Unable to convert from SDF version 1.6 to 1.4
Warning [parser.cc:478] XML Attribute[frame] in element[pose] not defined in SDF, ignoring.
Warning [parser.cc:478 ...
(more)
edit retag flag offensive close merge delete

Comments

The most obvious difference is that the first file seems to be SDF v1.4 and the second one v1.6. SDF is the format Gazebo uses to describe simulation environments. There is a great deal of bw-compatibility in SDF, but forward compatibility might not be possible. ..

gvdhoorn gravatar image gvdhoorn  ( 2018-02-23 04:01:20 -0500 )edit

.. you'll have to check whether the Gazebo version you're using is capable of loading v1.6 worlds.

You don't describe what "is not working", so this is the best we can do at the moment.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-23 04:02:26 -0500 )edit

yes sorry, i edited my previous post. As you said, it's due to compatibilities errors.

StanSmooth gravatar image StanSmooth  ( 2018-02-27 07:59:27 -0500 )edit

Any reason you cannot use Gazebo 7? That is installable on Ubuntu Trusty/ROS Indigo and would get you SDF 1.6 support.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-27 10:40:29 -0500 )edit

Yes, the package i want to use seems not to be compatible with gazebo 7

StanSmooth gravatar image StanSmooth  ( 2018-02-28 03:48:30 -0500 )edit

Then you seem to be forced to adapt the world file to a lower version of the format. That might mean that certain features will not be available / work.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-28 06:33:47 -0500 )edit

hello StanSmooth, gazebo simulation files in the "rrt_exploration_tutorials" package are for Gazebo 7. So it should work. I will try to use on te world files you are trying to launch and see what the problem is..

hasauino gravatar image hasauino  ( 2018-03-02 05:41:23 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-03-02 06:41:47 -0500

hasauino gravatar image

updated 2018-03-02 06:50:23 -0500

Hello StanSmooth, I'm not sure about the compatibly issue, I don't believe it's the problem. Because the Gazebo files in the rrt_exploration_tutorials package are for Gazebo 7. (I tested them on ROS indigo with Gazebo 2 and ROS kinect with Gazebo 7).

what's the difference between these two files

The first (short one) file only defines one model, which is named "floor", and it only defines some properties like "collision" and "visual". So it only has one model.

The second one, is the same except it has more models defined (I saw the complete file) and it also defines other things like lighting and so on.

how can i use the second one on my simulation ?

If you look at one of the .world files provided, for exmaple this one: "simple_env_1.world", you will see it needs certain files on your computer. For example, in Line 151:

<uri>model://book_orange/meshes/book_cover.dae</uri>

This file "book_cover.dae" should be on your computer.

Those files are provided, but you have to download them and put them in the right place.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2018-02-22 06:32:36 -0500

Seen: 391 times

Last updated: Mar 02 '18