Gazebo | Ignition | Community
Ask Your Question
0

Not able to simulate my sdf file in ignition gazebo

asked 2021-02-09 21:41:53 -0500

Continuing the question from https://community.gazebosim.org/t/not...

I was trying to simulate an animal(file attached below) in ignition gazebo by adding it to the empty_world.sdf file as explained in the tutorial https://ignitionrobotics.org/docs/cit....

The error I am getting is given below

[Err] [Server.cc:181] Error Code 13 Msg: Directory doesn’t exist[goat.dae]
[GUI] [Err] [PathManager.cc:57] Service call timed out for [/gazebo/resource_paths/get]

The code I used

<?xml version="1.0" ?>
<sdf version="1.7">
    <world name="world_demo">
      <physics name="1ms" type="ignored">
           <max_step_size>0.001</max_step_size>
           <real_time_factor>1.0</real_time_factor>
      </physics>
      <plugin
          filename="libignition-gazebo-physics-system.so"
          name="ignition::gazebo::systems::Physics">
       </plugin>
       <plugin
          filename="libignition-gazebo-user-commands-system.so"
          name="ignition::gazebo::systems::UserCommands">
        </plugin>
        <plugin
          filename="libignition-gazebo-scene-broadcaster-system.so"
          name="ignition::gazebo::systems::SceneBroadcaster">
        </plugin>

         <gui fullscreen="0">

           <!-- 3D scene -->
         <plugin filename="GzScene3D" name="3D View">
          <ignition-gui>
              <title>3D View</title>
              <property type="bool" key="showTitleBar">false</property>
              <property type="string" key="state">docked</property>
          </ignition-gui>

          <engine>ogre2</engine>
          <scene>scene</scene>
          <ambient_light>1.0 1.0 1.0</ambient_light>
          <background_color>0.8 0.8 0.8</background_color>
          <camera_pose>-6 0 6 0 0.5 0</camera_pose>
        </plugin>

        <!-- World control -->
        <plugin filename="WorldControl" name="World control">
          <ignition-gui>
            <title>World control</title>
            <property type="bool" key="showTitleBar">false</property>
            <property type="bool" key="resizable">false</property>
            <property type="double" key="height">72</property>
            <property type="double" key="width">121</property>
            <property type="double" key="z">1</property>

            <property type="string" key="state">floating</property>
            <anchors target="3D View">
              <line own="left" target="left"/>
              <line own="bottom" target="bottom"/>
            </anchors>
          </ignition-gui>

          <play_pause>true</play_pause>
          <step>true</step>
          <start_paused>true</start_paused>
          <service>/world/world_demo/control</service>
          <stats_topic>/world_demo/world_demo/stats</stats_topic>

        </plugin>

        <!-- World statistics -->
        <plugin filename="WorldStats" name="World stats">
            <ignition-gui>
                <title>World stats</title>
                <property type="bool" key="showTitleBar">false</property>
                <property type="bool" key="resizable">false</property>
                <property type="double" key="height">110</property>
                <property type="double" key="width">290</property>
                <property type="double" key="z">1</property>

                <property type="string" key="state">floating</property>
                <anchors target="3D View">
                <line own="right" target="right"/>
                <line own="bottom" target="bottom"/>
                </anchors>
            </ignition-gui>

            <sim_time>true</sim_time>
            <real_time>true</real_time>
            <real_time_factor>true</real_time_factor>
            <iterations>true</iterations>
            <topic>/world/world_demo/stats</topic>

        </plugin>

        <!-- Entity tree -->
        <plugin filename="EntityTree" name="Entity tree">
        </plugin>
      </gui>

      <!--light-->
      <light type="directional" name="sun">
        <cast_shadows>true</cast_shadows>
        <pose>0 0 10 0 0 0</pose>
        <diffuse>0.8 0.8 0.8 1</diffuse>
        <specular>0.2 0.2 0.2 1</specular>
        <attenuation>
          <range>1000</range>
          <constant>0.9</constant>
          <linear>0.01</linear>
          <quadratic>0.001</quadratic>
        </attenuation>
        <direction>-0.5 0.1 -0.9</direction>
      </light>

      <include>
         <uri>
             model://goat.dae
         </uri>
      </include>
    </world>
</sdf>

ignition gazebo version I am using

Ignition Gazebo, version 4.2.0
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.

Note: I tried adding the file to my workspace ~/ign-gazebo/examples/worlds but it still didn ... (more)

edit retag flag offensive close merge delete

Comments

Maybe it should be in a separate folder? So model://goat/goat.dae

m.bahno gravatar imagem.bahno ( 2021-02-11 07:21:42 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2021-02-15 01:37:25 -0500

ahcorde gravatar image

Hello,

These lines in your sdf file are wrong:

  <include>
     <uri>
         model://goat.dae
     </uri>
  </include>

You can't add a mesh in that way. You should include a model with the visual and collisions, etc or create a package with the model. You can find here a tutorial about how to create your own model.

edit flag offensive delete link more
0

answered 2021-02-16 00:02:16 -0500

I have solved the problem. Can't give a detailed explanation for now. Please find the code below for reference. Simulation video and meshes can be found at [https://github.com/addy1997/temp]

Thanks to ahcorde, chapulina, and m.bahno

<?xml version="1.0" ?>
<sdf version="1.6">
    <world name ="Bull">
      <physics name="1ms" type="ignored">
      <max_step_size>0.001</max_step_size>
      <real_time_factor>1.0</real_time_factor>
      </physics>

      <plugin
          filename="libignition-gazebo-physics-system.so"
          name="ignition::gazebo::systems::Physics">
      </plugin>
      <plugin
          filename="libignition-gazebo-user-commands-system.so"
          name="ignition::gazebo::systems::UserCommands">
      </plugin>
      <plugin
          filename="libignition-gazebo-scene-broadcaster-system.so"
          name="ignition::gazebo::systems::SceneBroadcaster">
      </plugin>

      <light type="directional" name="sun">
        <cast_shadows>true</cast_shadows>
        <pose>0 0 10 0 0 0</pose>
        <diffuse>0.8 0.8 0.8 1</diffuse>
        <specular>0.2 0.2 0.2 1</specular>
        <attenuation>
          <range>1000</range>
          <constant>0.9</constant>
          <linear>0.01</linear>
          <quadratic>0.001</quadratic>
        </attenuation>
        <direction>-0.5 0.1 -0.9</direction>
      </light>

      <model name="ground_plane">
        <static>true</static>
        <link name="link">
          <collision name="collision">
            <geometry>
              <plane>
                <normal>0 0 1</normal>
              </plane>
            </geometry>
          </collision>
          <visual name="visual">
            <geometry>
              <plane>
                <normal>0 0 1</normal>
                <size>100 100</size>
              </plane>
            </geometry>
            <material>
              <ambient>0.8 0.8 0.8 1</ambient>
              <diffuse>0.8 0.8 0.8 1</diffuse>
              <specular>0.8 0.8 0.8 1</specular>
            </material>
          </visual>
        </link>
      </model>

      <model name="Bull">
        <pose>0 0 0.5 0 0 0</pose>
        <static>true</static>
        <link name="link">
          <visual name="visual">
            <geometry>
              <mesh>
                <uri>meshes/model.obj</uri>
              </mesh>
            </geometry>
          </visual>
          <collision name="collision">
            <geometry>
              <mesh>
                <uri>meshes/model.obj</uri>
              </mesh>
            </geometry>
          </collision>
        </link>
      </model>
    </world>
</sdf>
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2021-02-09 21:41:53 -0500

Seen: 54 times

Last updated: Feb 16