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

.urdf file to .world file

asked 2015-08-20 03:33:08 -0500

ahmed charef gravatar image

updated 2015-08-24 02:52:07 -0500

gvdhoorn gravatar image

I need to import my model .URDF file to .WORLD file

for empy.world :

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <!-- A ground plane -->
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <include>
      <uri>model://*mymodel*</uri>
    </include>
  </world>
</sdf>

and for the model.config:

<?xml version="1.0"?>
<model>
  <name>test robot</name>
  <version>1.0</version>
  <urdf version='1.4'>model.urdf</urdf>
  <description>
     tuto
  </description>
</model>
edit retag flag offensive close merge delete

Comments

1

Your question is poorly written. It is not clear what you want, and that is why you got a downvote (probably). Please elaborate it further.

Javier V. Gómez gravatar image Javier V. Gómez  ( 2015-08-24 05:33:19 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2015-08-24 10:25:07 -0500

silth gravatar image

updated 2015-08-24 10:27:03 -0500

Hi ahmed charef! I think that you're trying to link your URDF robot model to a world and launch it in gazebo.

If is that case it's explain in gazebo tutorials link, but i'm going to try to explain to you.

In the model.config file

 <?xml version="1.0"?>
  <model>
    <name>MYROBOT</name>
    <version>1.0</version>
    <sdf>urdf/MYROBOT.urdf</sdf> <--- **Here you must specify where is your urdu file** -->
    <author>
      <name>My name</name>
      <email>name@email.address</email>
    </author>
    <description>
      A description of the model
    </description>
  </model>

And then, in the world file you must include it as the rest of things in the world

<?xml version="1.0"?> 
<sdf version="1.4">
  <world name="default">
    <!-- Ground Plane -->
    <include>
        <uri>model://ground_plane</uri>
    </include>
    <include>
        <uri>model://sun</uri>
    </include>
    <!-- Your URDF file -->
    <include>
        <uri>model://MYROBOT</uri>  <!-- The name that you write in the model.config -->
    </include>
  </world>
</sdf>

I hope this can help you.

edit flag offensive delete link more

Comments

Thank you ! i have tried that,but it doesn't work for me

ahmed charef gravatar image ahmed charef  ( 2015-08-25 03:31:57 -0500 )edit

could you post your .launch file?

silth gravatar image silth  ( 2015-08-25 03:51:57 -0500 )edit

Thank you! This helped. I need a clarification. I know I am new to ROS/Gazebo but why am I unable to find this direction or solution myself by going through the tutes/documentation of gazebo/ROS? Am i being dumb at reading the documentation or is it because the tutes/documentati are just bad?

Anurag VV gravatar image Anurag VV  ( 2017-07-25 23:22:08 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-08-20 03:33:08 -0500

Seen: 2,623 times

Last updated: Aug 24 '15