Gazebo | Ignition | Community
Ask Your Question
0

Can't change gravity in world-file

asked 2019-01-29 09:47:08 -0600

mwaandah gravatar image

I'm new to Gazebo and SDF-files in general. The file I'm using works, but when I try to specify gravity to it, I get an error.

I get the following error when trying to change the gravity using a SDF file.

Warning [parser.cc:750] XML Element[gravity], child of element[world] not defined in SDF. Ignoring[gravity]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.

My SDF-file looks like this;

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <gravity>0 0 -0.1</gravity>
    <scene>
        <origin_visual>0</origin_visual>
        <grid>0</grid>
    </scene>
    <physics type="ode">
      <max_step_size>0.003</max_step_size>

      <!-- Run as fast as possible -->
      <real_time_update_rate>0.0</real_time_update_rate>
      <ode>
        <constraints>
          <!-- Simulator.cpp -->
          <erp>0.1</erp>
          <cfm>10e-6</cfm>

          <!-- Making this smaller seems to decrease rather than increase stability. -->
          <contact_max_correcting_vel>100</contact_max_correcting_vel>
          <contact_surface_layer>1e-8</contact_surface_layer>
        </constraints>
        <solver>
          <type>quick</type>
        </solver>
      </ode>
    </physics>

    <!-- A global light source -->
    <include>
      <uri>model://sun</uri>
    </include>
    <include>
      <uri>model://tol_ground</uri>
    </include>

    <plugin name="tol-control" filename="libtolworldcontrol.so" />
  </world>
</sdf>

Any ideas why it says that SDF might not have this element defined?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-01-29 10:33:29 -0600

chapulina gravatar image

You may be using an earlier version of SDF, where <gravity> was under <physics>. From SDF 1.6 it is under <world>.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-01-29 09:47:08 -0600

Seen: 928 times

Last updated: Jan 29 '19