<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <physics type="ode">
      <gravity>0.000000 0.000000 0</gravity>
      <ode>
        <solver>
          <type>quick</type>
          <iters>1000</iters>
          <precon_iters>0</precon_iters>
          <sor>1.000000</sor>
        </solver>
        <constraints>
          <cfm>0.000000</cfm>
          <erp>0.200000</erp>
          <contact_max_correcting_vel>100.000000</contact_max_correcting_vel>
          <contact_surface_layer>0.01000</contact_surface_layer>
        </constraints>
      </ode>
      <bullet>
        <solver>
          <type>sequential_impulse</type>
          <iters>1000</iters>
          <sor>1.000000</sor>
        </solver>
        <constraints>
          <cfm>0.000000</cfm>
          <erp>0.200000</erp>
          <split_impulse>true</split_impulse>
          <split_impulse_penetration_threshold>-0.01</split_impulse_penetration_threshold>
          <contact_surface_layer>0.00000</contact_surface_layer>
        </constraints>
      </bullet>
      <real_time_update_rate>0.000000</real_time_update_rate>
      <max_step_size>0.001</max_step_size>
    </physics>
    <!--
    <include>
      <uri>model://ground_plane</uri>
    </include>
    -->
    <include>
      <uri>model://sun</uri>
    </include>

    <model name="model_1">
      <pose>0 0 1 0 0 0</pose>
      <link name="link_1">
        <pose>0 0 0 0 0 0</pose>
        <inertial>
          <pose>0.5 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>0.001</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
          <material>
            <script>Gazebo/Grey</script>
          </material>
        </visual>
      </link>
      <link name="link_2">
        <pose>1 0 0 0 0 0</pose>
        <inertial>
          <pose>0.5 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>0.001</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
          <material>
            <script>Gazebo/Grey</script>
          </material>
        </visual>
      </link>
      <joint name="joint_01" type="revolute">
        <parent>world</parent>
        <child>link_1</child>
        <axis>
          <xyz>1 1 0</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>
      <joint name="joint_12" type="revolute">
        <parent>link_1</parent>
        <child>link_2</child>
        <axis>
          <xyz>1 -1 0</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>
      <link name="link_3">
        <pose>2 0 0 0 0 1.570796</pose>
        <inertial>
          <pose>0.5 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>0.001</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
          <material>
            <script>Gazebo/Grey</script>
          </material>
        </visual>
      </link>
      <joint name="joint_23" type="revolute">
        <parent>link_2</parent>
        <child>link_3</child>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>
      <link name="link_4">
        <pose>2 1 0 0 0 3.14159</pose>
        <inertial>
          <pose>0.5 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>0.001</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
          <material>
            <script>Gazebo/Grey</script>
          </material>
        </visual>
      </link>
      <joint name="joint_34" type="revolute">
        <parent>link_3</parent>
        <child>link_4</child>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>
      <link name="link_5">
        <pose>1 1 0 0 0 4.712389</pose>
        <inertial>
          <pose>0.5 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>0.001</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
          <material>
            <script>Gazebo/Grey</script>
          </material>
        </visual>
      </link>
      <joint name="joint_45" type="revolute">
        <parent>link_4</parent>
        <child>link_5</child>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>
      <joint name="joint_52" type="revolute">
        <parent>link_5</parent>
        <child>link_2</child>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>

      <!-- branch from link_2 -->
      <link name="link_2a">
        <pose>2 0 0 0 0 0</pose>
        <inertial>
          <pose>0.5 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>0.001</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
          <material>
            <script>Gazebo/Grey</script>
          </material>
        </visual>
      </link>
      <joint name="joint_22a" type="revolute">
        <parent>link_2</parent>
        <child>link_2a</child>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>
      <link name="link_2b">
        <pose>3 0 0 0 0 0</pose>
        <inertial>
          <pose>0.5 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>0.001</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
          <material>
            <script>Gazebo/Grey</script>
          </material>
        </visual>
      </link>
      <joint name="joint_2a2b" type="revolute">
        <parent>link_2a</parent>
        <child>link_2b</child>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>

      <!-- another loop from link_2b -->
      <link name="link_3a">
        <pose>4 0 0 0 0 1.570796</pose>
        <inertial>
          <pose>0.5 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>0.001</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
          <material>
            <script>Gazebo/Grey</script>
          </material>
        </visual>
      </link>
      <joint name="joint_2b3a" type="revolute">
        <parent>link_2b</parent>
        <child>link_3a</child>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>
      <link name="link_4a">
        <pose>4 1 0 0 0 3.14159</pose>
        <inertial>
          <pose>0.5 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>0.001</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
          <material>
            <script>Gazebo/Grey</script>
          </material>
        </visual>
      </link>
      <joint name="joint_3a4a" type="revolute">
        <parent>link_3a</parent>
        <child>link_4a</child>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>
      <link name="link_5a">
        <pose>3 1 0 0 0 4.712389</pose>
        <inertial>
          <pose>0.5 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>0.001</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <pose>0.5 0 0 0 0 0</pose>
          <geometry>
            <box>
              <size>1. .1 .1</size>
            </box>
          </geometry>
          <material>
            <script>Gazebo/Grey</script>
          </material>
        </visual>
      </link>
      <joint name="joint_4a5a" type="revolute">
        <parent>link_4a</parent>
        <child>link_5a</child>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>
      <joint name="joint_5a2b" type="revolute">
        <parent>link_5a</parent>
        <child>link_2b</child>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <upper>0.7071</upper>
            <lower>-0.7071</lower>
          </limit>
          <use_parent_model_frame>true</use_parent_model_frame>
        </axis>
      </joint>

    </model>
  </world>
</sdf>
