<?xml version="1.0" ?>
<!--
  Demonstration of wheel plowing effect with simple sphere models.
  Be sure to add the test/models folder to your GAZEBO_MODEL_PATH before
  running this world.

  This world contains a ground plane with gz:plowing_terrain defined,
  a control model sphere1 without plowing parameters, and several other
  spheres with gz:plowing_wheel parameters.
  The world gravity vector has a non-zero compoenent that points in the +X
  direction, which causes the spheres to roll, and the plowing effect
  causes the spheres to roll more slowly.

  Currently the plowing effect requires the body-fixed friction direction
  parameter fdir1 to be set, and the effect is limited to a single direction
  that is orthogonal to fdir1 and the contact normal. This behavior limitation
  is motivated by the needs of a wheel attached to a vehicle by a revolute
  joint, but it could be extended to support plowing in any direction
  (see https://github.com/osrf/gazebo/issues/3230 ).
-->
<sdf version="1.5">
  <world name="default">
    <!-- Gravity -->
    <gravity>1.5 0 -9.75</gravity>
    <!-- plowing effect ground plane -->
    <include>
      <uri>model://plowing_effect_ground_plane</uri>
    </include>
    <include>
      <uri>model://sun</uri>
    </include>

    <model name="sphere1">
      <pose>0 0 0.4 0 0 0</pose>
      <link name='base_link'>
        <inertial>
          <mass>5.0</mass>
          <inertia>
            <ixx>0.5333</ixx>
            <iyy>0.5333</iyy>
            <izz>0.5333</izz>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyz>0</iyz>
          </inertia>
        </inertial>
        <collision name='collision'>
          <geometry>
            <sphere>
              <radius>0.4</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name='visual'>
          <geometry>
            <sphere>
              <radius>0.4</radius>
            </sphere>
          </geometry>
          <material>
            <diffuse>1 0 0 1</diffuse>
            <ambient>1 0 0 1</ambient>
          </material>
        </visual>
      </link>
    </model>

    <model name= "sphere2" xmlns:gz="https://gazebosim.org/schema">
      <pose>0 1 0.4  0 0 0</pose>
      <link name="base_link">
        <inertial>
          <mass>5.0</mass>
          <inertia>
            <ixx>0.5333</ixx>
            <iyy>0.5333</iyy>
            <izz>0.5333</izz>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyz>0</iyz>
          </inertia>
        </inertial>
        <collision name="collision">
          <gz:plowing_wheel>
            <max_degrees>3.0</max_degrees>
            <deadband_velocity>0.2</deadband_velocity>
            <saturation_velocity>0.6</saturation_velocity>
          </gz:plowing_wheel>
          <geometry>
            <sphere>
              <radius>0.4</radius>
            </sphere>
          </geometry>
          <surface>
            <contact>
              <ode>
                <kp>40000</kp>
                <kd>16</kd>
                <max_vel>10</max_vel>
                <min_depth>0.005</min_depth>
              </ode>
            </contact>
            <friction>
              <ode>
                <fdir1>0 1 0</fdir1>
              </ode>
            </friction>
          </surface>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.4</radius>
            </sphere>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/White</name>
            </script>
          </material>
        </visual>
      </link>
    </model>

    <model name= "sphere3" xmlns:gz="https://gazebosim.org/schema">
      <pose>0 2 0.4  0 0 0</pose>
      <link name="base_link">
        <inertial>
          <mass>5.0</mass>
          <inertia>
            <ixx>0.5333</ixx>
            <iyy>0.5333</iyy>
            <izz>0.5333</izz>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyz>0</iyz>
          </inertia>
        </inertial>
        <collision name="collision">
          <gz:plowing_wheel>
            <max_degrees>6.0</max_degrees>
            <deadband_velocity>0.2</deadband_velocity>
            <saturation_velocity>0.6</saturation_velocity>
          </gz:plowing_wheel>
          <geometry>
            <sphere>
              <radius>0.4</radius>
            </sphere>
          </geometry>
          <surface>
            <contact>
              <ode>
                <kp>40000</kp>
                <kd>16</kd>
                <max_vel>10</max_vel>
                <min_depth>0.005</min_depth>
              </ode>
            </contact>
            <friction>
              <ode>
                <fdir1>0 1 0</fdir1>
              </ode>
            </friction>
          </surface>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.4</radius>
            </sphere>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Blue</name>
            </script>
          </material>
        </visual>
      </link>
    </model>

    <model name= "sphere4" xmlns:gz="https://gazebosim.org/schema">
      <pose>0 3 0.4  0 0 0</pose>
      <link name="base_link">
        <inertial>
          <mass>5.0</mass>
          <inertia>
            <ixx>0.5333</ixx>
            <iyy>0.5333</iyy>
            <izz>0.5333</izz>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyz>0</iyz>
          </inertia>
        </inertial>
        <collision name="collision">
          <gz:plowing_wheel>
            <max_degrees>8.0</max_degrees>
            <deadband_velocity>0.2</deadband_velocity>
            <saturation_velocity>0.6</saturation_velocity>
          </gz:plowing_wheel>
          <geometry>
            <sphere>
              <radius>0.4</radius>
            </sphere>
          </geometry>
          <surface>
            <contact>
              <ode>
                <kp>40000</kp>
                <kd>16</kd>
                <max_vel>10</max_vel>
                <min_depth>0.005</min_depth>
              </ode>
            </contact>
            <friction>
              <ode>
                <fdir1>0 1 0</fdir1>
              </ode>
            </friction>
          </surface>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.4</radius>
            </sphere>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Orange</name>
            </script>
          </material>
        </visual>
      </link>
    </model>
  </world>
</sdf>