<?xml version="1.0" ?>
<sdf version="1.4">
  <world name="default">
    <physics type="ode">
      <gravity>0.0 0.0 -10.0</gravity>
      <ode>
        <solver>
          <type>quick</type>
          <iters>50</iters>
          <sor>0.8</sor>
        </solver>
        <constraints>
          <cfm>0.0</cfm>
          <erp>0.2</erp>
          <contact_max_correcting_vel>0.1</contact_max_correcting_vel>
          <contact_surface_layer>0.0</contact_surface_layer>
        </constraints>
      </ode>
      <real_time_update_rate>0</real_time_update_rate>
      <max_step_size>0.001</max_step_size>
    </physics>
    <include>
      <uri>model://sun</uri>
    </include>
    <include>
      <uri>model://ground_plane</uri>
    </include>

    <model name="wind_demo_model">
      <pose>0 0 0 0 0 0</pose>
      <static>false</static>
      <enable_wind>true</enable_wind>
      <self_collide>true</self_collide>
      <link name="roof">
        <kinematic>true</kinematic>
        <pose>0 0 1 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <box>
              <size>1 1 0.1</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode>
                <mu>0.1</mu>
                <mu2>0</mu2>
              </ode>
            </friction>
          </surface>
        </collision>
        <visual name="visual">
          <transparency>0.9</transparency>
          <geometry>
            <box>
              <size>2 2 0.1</size>
            </box>
          </geometry>
          <material>
            <ambient>0.2 0.2 0.2 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <link name="sphere_1">
        <pose>0 0 0.93 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
          <material>
            <ambient>1.0 0 0 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <joint name="sphere_1_joint" type="ball">
        <parent>roof</parent>
        <child>sphere_1</child>
      </joint>
      <link name="sphere_2">
        <pose>0 0 0.89 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
          <material>
            <ambient>1.0 0 0 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <joint name="sphere_2_joint" type="ball">
        <parent>sphere_1</parent>
        <child>sphere_2</child>
      </joint>
      <link name="sphere_3">
        <pose>0 0 0.85 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
          <material>
            <ambient>1.0 0 0 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <joint name="sphere_3_joint" type="ball">
        <parent>sphere_2</parent>
        <child>sphere_3</child>
      </joint>
      <link name="sphere_4">
        <pose>0 0 0.81 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
          <material>
            <ambient>1.0 0 0 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <joint name="sphere_4_joint" type="ball">
        <parent>sphere_3</parent>
        <child>sphere_4</child>
      </joint>
      <link name="sphere_5">
        <pose>0 0 0.77 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
          <material>
            <ambient>1.0 0 0 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <joint name="sphere_5_joint" type="ball">
        <parent>sphere_4</parent>
        <child>sphere_5</child>
      </joint>
      <link name="sphere_6">
        <pose>0 0 0.73 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
          <material>
            <ambient>1.0 0 0 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <joint name="sphere_6_joint" type="ball">
        <parent>sphere_5</parent>
        <child>sphere_6</child>
      </joint>
      <link name="sphere_7">
        <pose>0 0 0.69 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
          <material>
            <ambient>1.0 0 0 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <joint name="sphere_7_joint" type="ball">
        <parent>sphere_6</parent>
        <child>sphere_7</child>
      </joint>
      <link name="sphere_8">
        <pose>0 0 0.65 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
          <material>
            <ambient>1.0 0 0 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <joint name="sphere_8_joint" type="ball">
        <parent>sphere_7</parent>
        <child>sphere_8</child>
      </joint>
      <link name="sphere_9">
        <pose>0 0 0.61 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
          <material>
            <ambient>1.0 0 0 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <joint name="sphere_9_joint" type="ball">
        <parent>sphere_8</parent>
        <child>sphere_9</child>
      </joint>
      <link name="sphere_10">
        <pose>0 0 0.57 0 0 0</pose>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.02</radius>
            </sphere>
          </geometry>
          <material>
            <ambient>1.0 0 0 1.0</ambient>
            <diffuse>.421 0.225 0.0 1.0</diffuse>
          </material>
        </visual>
      </link>
      <joint name="sphere_10_joint" type="ball">
        <parent>sphere_9</parent>
        <child>sphere_10</child>
      </joint>
    </model>

    <wind>
      <linear_velocity>0 1 0</linear_velocity>
    </wind>

    <!-- Load the plugin for the wind -->
    <plugin name="wind" filename="libWindPlugin.so">
      <horizontal>
        <magnitude>
          <time_for_rise>10</time_for_rise>
          <sin>
            <amplitude_percent>0.05</amplitude_percent>
            <period>60</period>
          </sin>
          <noise type="gaussian">
           <mean>0</mean>
           <stddev>0.0002</stddev>
          </noise>
        </magnitude>
        <direction>
          <time_for_rise>30</time_for_rise>
          <sin>
            <amplitude>5</amplitude>
            <period>20</period>
          </sin>
          <noise type="gaussian">
           <mean>0</mean>
           <stddev>0.03</stddev>
          </noise>
        </direction>
      </horizontal>
      <vertical>
        <noise type="gaussian">
         <mean>0</mean>
         <stddev>0.03</stddev>
        </noise>
      </vertical>
    </plugin>

  </world>
</sdf>
