<sdf version="1.5">
  <world name="default">
    <physics type="ode">
      <gravity>0.000000 0.000000 -9.810000</gravity>
      <ode>
        <solver>
          <type>world</type>
          <iters>250</iters>
          <precon_iters>0</precon_iters>
          <sor>1.400000</sor>
        </solver>
        <constraints>
          <cfm>0.000000</cfm>
          <erp>0.200000</erp>
          <contact_max_correcting_vel>0.000000</contact_max_correcting_vel>
          <contact_surface_layer>0.00000</contact_surface_layer>
        </constraints>
      </ode>
      <real_time_update_rate>1000.000000</real_time_update_rate>
      <max_step_size>0.001000</max_step_size>
    </physics>
    <model name="ground_plane">
    <static>true</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>
          </friction>
        </surface>
      </collision>
      <visual name="visual">
        <cast_shadows>false</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>
    </link>
  </model>
 <model name="double_pendulum_with_base">
    <link name="base">
      <inertial>
        <mass>100</mass>
      </inertial>
      <visual name="vis_plate_on_ground">
        <pose>0 0 0.01  0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.8</radius>
            <length>0.02</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <visual name="vis_pole">
        <pose>-0.275 0 1.1  0 0 0</pose>
        <geometry>
          <box><size>0.2 0.2 2.2</size></box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <collision name="col_plate_on_ground">
        <pose>0 0 0.01  0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.8</radius>
            <length>0.02</length>
          </cylinder>
        </geometry>
      </collision>
      <collision name="col_pole">
        <pose>-0.275 0 1.1  0 0 0</pose>
        <geometry>
          <box><size>0.2 0.2 2.2</size></box>
        </geometry>
      </collision>
    </link>
    <!-- upper link, length 1, IC -90 degrees -->
    <link name="upper_link">
      <pose>0 0 2.1  -1.5708 0 0</pose>
      <self_collide>0</self_collide>
      <inertial>
        <pose>0 0 0.5  0 0 0</pose>
      </inertial>
      <visual name="vis_upper_joint">
        <pose>-0.05 0 0  0 1.5708 0</pose>
        <geometry>
          <cylinder>
            <radius>0.1</radius>
            <length>0.3</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <visual name="vis_lower_joint">
        <pose>0 0 1.0  0 1.5708 0</pose>
        <geometry>
          <cylinder>
            <radius>0.1</radius>
            <length>0.2</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <visual name="vis_cylinder">
        <pose>0 0 0.5  0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.1</radius>
            <length>0.9</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <collision name="col_upper_joint">
        <pose>-0.05 0 0  0 1.5708 0</pose>
        <geometry>
          <cylinder>
            <radius>0.1</radius>
            <length>0.3</length>
          </cylinder>
        </geometry>
      </collision>
      <collision name="col_lower_joint">
        <pose>0 0 1.0  0 1.5708 0</pose>
        <geometry>
          <cylinder>
            <radius>0.1</radius>
            <length>0.2</length>
          </cylinder>
        </geometry>
      </collision>
      <collision name="col_cylinder">
        <pose>0 0 0.5  0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.1</radius>
            <length>0.9</length>
          </cylinder>
        </geometry>
      </collision>
    </link>
    <!-- lower link, length 1, IC ~-120 degrees more -->
    <link name="lower_link">
      <pose>0.25 1.0 2.1  -2 0 0</pose>
      <self_collide>0</self_collide>
      <inertial>
        <pose>0 0 0.5  0 0 0</pose>
      </inertial>
      <visual name="vis_lower_joint">
        <pose>0 0 0  0 1.5708 0</pose>
        <geometry>
          <cylinder>
            <radius>0.08</radius>
            <length>0.3</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <visual name="vis_cylinder">
        <pose>0 0 0.5  0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.1</radius>
            <length>0.9</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <collision name="col_lower_joint">
        <pose>0 0 0  0 1.5708 0</pose>
        <geometry>
          <cylinder>
            <radius>0.08</radius>
            <length>0.3</length>
          </cylinder>
        </geometry>
      </collision>
      <collision name="col_cylinder">
        <pose>0 0 0.5  0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.1</radius>
            <length>0.9</length>
          </cylinder>
        </geometry>
      </collision>
    </link>
    <!-- pin joint for upper link, at origin of upper link -->
    <joint name="upper_joint" type="revolute">
      <parent>base</parent>
      <child>upper_link</child>
      <axis>
        <xyz>1.0 0 0</xyz>
      </axis>
    </joint>
    <!-- pin joint for lower link, at origin of child link -->
    <joint name="lower_joint" type="revolute">
      <parent>upper_link</parent>
      <child>lower_link</child>
      <axis>
        <xyz>1.0 0 0</xyz>
      </axis>
    </joint>
  </model>  
    <model name="sphere">
      <pose>0 1.5 4.5 0 0 0</pose>
      <allow_auto_disable>false</allow_auto_disable>
      <link name="link">
        <inertial>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0.3</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
          <mass>1.0</mass>
        </inertial>
        <velocity_decay>
          <linear>0.0</linear>
          <angular>0.0</angular>
        </velocity_decay>
        <collision name="collision">
          <geometry>
            <sphere>
              <radius>0.5</radius>
            </sphere>
          </geometry>
          <surface>
            <friction>
              <ode>
                <mu>0.5</mu>
                <mu2>1</mu2>
              </ode>
            </friction>
            <contact>
              <ode>
                <max_vel>0</max_vel>
                <min_depth>0</min_depth>
              </ode>
            </contact>
          </surface>
        </collision>
        <visual name="visual">
          <geometry>
            <sphere>
              <radius>0.5</radius>
            </sphere>
          </geometry>
          <material>
            <script>Gazebo/WoodPallet</script>
          </material>
        </visual>
      </link>
    </model>
    <light type="directional" name="sun">
      <pose>0 0 10 0 0 0</pose>
      <diffuse>8 .8 .8 1</diffuse>
      <specular>.1 .1 .1 1</specular>
      <attenuation>
        <range>10</range>
        <linear>0.01</linear>
        <constant>0.8</constant>
        <quadratic>0.0</quadratic>
      </attenuation>
      <direction>0 .5 -.5</direction>
      <cast_shadows>true</cast_shadows>
    </light>
  </world>
</sdf>
