0
$\begingroup$

i have trouble running a world with Gazebo (Version 11.10.2)...

When i run the world with the command:gazebo test.world i receive the error:

Error Code 13 Msg: Directory doesn't exist[/home/henrik/gazebo_models/box.sdf]

in my test.world file i tried to import the simple model box.sdf. The file is correctly added to the default file path /home/henrik/gazebo_models/ which i have checked with the command echo $GAZEBO_MODEL_PATH. When i delete the box.sdf file from the folder i receive the error

Error Code 12 Msg: Unable to find uri[model://box.sdf]

So i'm sure that the path for the file are correctly declared in my code... Here is my code for the test.world file (default world with an include-tag):

<world name='default'>
 <light name='sun' type='directional'>
   <cast_shadows>1</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>
   <spot>
     <inner_angle>0</inner_angle>
     <outer_angle>0</outer_angle>
     <falloff>0</falloff>
   </spot>
 </light>
 <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>100</mu>
             <mu2>50</mu2>
           </ode>
           <torsional>
             <ode/>
           </torsional>
         </friction>
         <contact>
           <ode/>
         </contact>
         <bounce/>
       </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>
         <script>
           <uri>file://media/materials/scripts/gazebo.material</uri>
           <name>Gazebo/Grey</name>
         </script>
       </material>
     </visual>
     <self_collide>0</self_collide>
     <enable_wind>0</enable_wind>
     <kinematic>0</kinematic>
   </link>
 </model>
 <gravity>0 0 -9.8</gravity>
 <magnetic_field>6e-06 2.3e-05 -4.2e-05</magnetic_field>
 <atmosphere type='adiabatic'/>
 <physics 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>
 <audio>
   <device>default</device>
 </audio>
 <wind/>
 <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>
 <state world_name='default'>
   <sim_time>67 88000000</sim_time>
   <real_time>33 922535300</real_time>
   <wall_time>1707378083 703017874</wall_time>
   <iterations>33744</iterations>
   <model name='ground_plane'>
     <pose>0 0 0 0 -0 0</pose>
     <scale>1 1 1</scale>
     <link name='link'>
       <pose>0 0 0 0 -0 0</pose>
       <velocity>0 0 0 0 -0 0</velocity>
       <acceleration>0 0 0 0 -0 0</acceleration>
       <wrench>0 0 0 0 -0 0</wrench>
     </link>
   </model>
   <model name='unit_box'>
     <pose>-0.843152 -0.012954 0.5 0 -0 0</pose>
     <scale>1 1 1</scale>
     <link name='link'>
       <pose>-0.843152 -0.012954 0.5 0 -0 0</pose>
       <velocity>0 0 0 0 -0 0</velocity>
       <acceleration>-0.004709 -9.78112 9.78158 0.712677 -0.009414 -4.3e-05</acceleration>
       <wrench>-0.004709 -9.78112 9.78158 0 -0 0</wrench>
     </link>
   </model>
   <light name='sun'>
     <pose>0 0 10 0 -0 0</pose>
   </light>
 </state>
 <gui fullscreen='0'>
   <camera name='user_camera'>
     <pose>5 -5 2 0 0.275643 2.35619</pose>
     <view_controller>orbit</view_controller>
     <projection_type>perspective</projection_type>
   </camera>
 </gui>
 <include>
   <uri>model://box.sdf</uri>
   <name>aaa</name>
 </include>    
</world>
</sdf>

 enter<sdf version='1.7'>
<world name='default'>
 <light name='sun' type='directional'>
   <cast_shadows>1</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>
   <spot>
     <inner_angle>0</inner_angle>
     <outer_angle>0</outer_angle>
     <falloff>0</falloff>
   </spot>
 </light>
 <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>100</mu>
             <mu2>50</mu2>
           </ode>
           <torsional>
             <ode/>
           </torsional>
         </friction>
         <contact>
           <ode/>
         </contact>
         <bounce/>
       </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>
         <script>
           <uri>file://media/materials/scripts/gazebo.material</uri>
           <name>Gazebo/Grey</name>
         </script>
       </material>
     </visual>
     <self_collide>0</self_collide>
     <enable_wind>0</enable_wind>
     <kinematic>0</kinematic>
   </link>
 </model>
 <gravity>0 0 -9.8</gravity>
 <magnetic_field>6e-06 2.3e-05 -4.2e-05</magnetic_field>
 <atmosphere type='adiabatic'/>
 <physics 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>
 <audio>
   <device>default</device>
 </audio>
 <wind/>
 <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>
 <state world_name='default'>
   <sim_time>67 88000000</sim_time>
   <real_time>33 922535300</real_time>
   <wall_time>1707378083 703017874</wall_time>
   <iterations>33744</iterations>
   <model name='ground_plane'>
     <pose>0 0 0 0 -0 0</pose>
     <scale>1 1 1</scale>
     <link name='link'>
       <pose>0 0 0 0 -0 0</pose>
       <velocity>0 0 0 0 -0 0</velocity>
       <acceleration>0 0 0 0 -0 0</acceleration>
       <wrench>0 0 0 0 -0 0</wrench>
     </link>
   </model>
   <model name='unit_box'>
     <pose>-0.843152 -0.012954 0.5 0 -0 0</pose>
     <scale>1 1 1</scale>
     <link name='link'>
       <pose>-0.843152 -0.012954 0.5 0 -0 0</pose>
       <velocity>0 0 0 0 -0 0</velocity>
       <acceleration>-0.004709 -9.78112 9.78158 0.712677 -0.009414 -4.3e-05</acceleration>
       <wrench>-0.004709 -9.78112 9.78158 0 -0 0</wrench>
     </link>
   </model>
   <light name='sun'>
     <pose>0 0 10 0 -0 0</pose>
   </light>
 </state>
 <gui fullscreen='0'>
   <camera name='user_camera'>
     <pose>5 -5 2 0 0.275643 2.35619</pose>
     <view_controller>orbit</view_controller>
     <projection_type>perspective</projection_type>
   </camera>
 </gui>
 <include>
   <uri>model://box.sdf</uri>
   <name>aaa</name>
 </include>    
</world>
</sdf>

And here is the code for the box.sdf-file (from https://classic.gazebosim.org/tutorials?tut=build_model&cat=build_robot):

<sdf version="1.4">
  <model name="my_model">
    <pose>0 0 0.5 0 0 0</pose>
    <static>true</static>
    <link name="link">
      <inertial>
        <mass>1.0</mass>
        <inertia> <!-- inertias are tricky to compute -->
          <!-- http://gazebosim.org/tutorials?tut=inertia&cat=build_robot -->
          <ixx>0.083</ixx>       <!-- for a box: ixx = 0.083 * mass * (y*y + z*z) -->
          <ixy>0.0</ixy>         <!-- for a box: ixy = 0 -->
          <ixz>0.0</ixz>         <!-- for a box: ixz = 0 -->
          <iyy>0.083</iyy>       <!-- for a box: iyy = 0.083 * mass * (x*x + z*z) -->
          <iyz>0.0</iyz>         <!-- for a box: iyz = 0 -->
          <izz>0.083</izz>       <!-- for a box: izz = 0.083 * mass * (x*x + y*y) -->
        </inertia>
      </inertial>
      <collision name="collision">
        <geometry>
          <box>
            <size>1 1 1</size>
          </box>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <box>
            <size>1 1 1</size>
          </box>
        </geometry>
      </visual>
    </link>
  </model>
</sdf>```
$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.