<?xml version="1.0" ?>
<sdf version="1.6">
  <world name="test_world">
    <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>
            <ambient>0.9 0.9 0.9 1</ambient>
          </material>
        </visual>
      </link>
    </model>
    <model name="double_pendulum_with_base">
      <pose>1 0 0 0 0 0</pose>
      <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>
            <ambient>1 1 0 1</ambient>
          </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>
            <ambient>1 1 0 1</ambient>
          </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>
          <surface>
            <friction>
              <ode>
                <mu>1.1</mu>
              </ode>
            </friction>
          </surface>
        </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>
            <ambient>1 1 0 1</ambient>
          </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>
            <ambient>1 1 0 1</ambient>
          </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>
            <ambient>1 1 0 1</ambient>
          </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>
          <surface>
            <friction>
              <ode>
                <mu>0.1</mu>
              </ode>
            </friction>
          </surface>
        </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>
            <ambient>1 1 0 1</ambient>
          </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>
            <ambient>1 1 0 1</ambient>
          </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>
          <dynamics>
            <damping>3.0</damping>
          </dynamics>
        </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>
          <dynamics>
            <damping>3.0</damping>
          </dynamics>
        </axis>
      </joint>
    </model>

    <model name="free_body">
      <pose>0.0  10.0  10.0  0.0  0.0  0.0</pose>
      <link name="link">
        <pose>0.0  0.0  0.0  0.0  0.0  0.0</pose>
        <collision name="collision1">
          <geometry>
            <sphere>
              <radius>1.0</radius>
            </sphere>
          </geometry>
          <surface>
            <bounce>
              <restitution_coefficient>0.8</restitution_coefficient>
            </bounce>
          </surface>
        </collision>
      </link>
    </model>

    <model name="joint_limit_test">
      <pose>10 0 2 0  0 0</pose>
      <link name="base">
        <inertial>
          <mass>100</mass>
        </inertial>
        <visual name="visual">
          <pose>0 0 0 -1.57 0 0</pose>
          <geometry>
            <cylinder>
              <radius>0.1</radius>
              <length>0.2</length>
            </cylinder>
          </geometry>
        </visual>
      </link>
      <link name="bar">
        <pose>1 0 0 0 0 0</pose>
        <inertial>
          <mass>1</mass>
        </inertial>
        <visual name="visual">
          <geometry>
            <box>
              <size>0.1 0.1 0.1</size>
            </box>
        </geometry>
        </visual>
      </link>
      <joint name="j0" type="fixed">
        <parent>world</parent>
        <child>base</child>
      </joint>
      <joint name="j1" type="revolute">
        <pose>-1 0 0 0 0 0</pose>
        <parent>base</parent>
        <child>bar</child>
        <axis>
          <xyz>0 1 0</xyz>
          <limit>
            <lower>-0.5</lower>
            <upper>0.5</upper>
            <effort>100</effort>
          </limit>
        </axis>
      </joint>
    </model>

    <model name="simple_joint_test">
      <pose>10 10 2 0  0 0</pose>
      <link name="base">
        <inertial>
          <mass>100</mass>
        </inertial>
        <visual name="visual">
          <pose>0 0 0 -1.57 0 0</pose>
          <geometry>
            <cylinder>
              <radius>0.1</radius>
              <length>0.2</length>
            </cylinder>
          </geometry>
        </visual>
      </link>
      <link name="bar">
        <pose>0 0 -1 0 0 0</pose>
        <inertial>
          <mass>1</mass>
        </inertial>
        <visual name="visual">
          <geometry>
            <box>
              <size>0.1 0.1 0.1</size>
            </box>
        </geometry>
        </visual>
      </link>
      <joint name="j0" type="fixed">
        <parent>world</parent>
        <child>base</child>
      </joint>
      <joint name="j1" type="revolute">
        <pose>0 0 1 0 0 0</pose>
        <parent>base</parent>
        <child>bar</child>
        <axis>
          <xyz>0 1 0</xyz>
        </axis>
      </joint>
    </model>
    <model name="screw_joint_test">
      <link name="link0"/>
      <link name="link1"/>
      <joint name="j0" type="screw">
        <parent>link0</parent>
        <child>link1</child>
        <thread_pitch>2</thread_pitch>
      </joint>
    </model>
    <!-- Remove joint types as they get supported -->
    <model name="unsupported_joint_test">
      <link name="link0"/>
      <link name="link1"/>
      <joint name="j0" type="revolute2">
        <parent>link0</parent>
        <child>link1</child>
      </joint>
      <link name="link2"/>
      <link name="link3"/>
      <joint name="j1" type="gearbox">
        <parent>link2</parent>
        <child>link3</child>
      </joint>
      <link name="link4"/>
      <link name="link5"/>
      <joint name="j2" type="continuous">
        <parent>link4</parent>
        <child>link5</child>
      </joint>
    </model>
  </world>
</sdf>
