<gazebo version="1.0">
  <world name="world_1">
    <scene>
      <ambient rgba="0.5 0.5 0.5 1.0"/>
      <background rgba="0.5 0.5 0.5 1.0">
        <sky material="Gazebo/CloudySky"/>
      </background>
      <shadows enabled="true" rgba="0.0 0.0 0.5 0.5" type="texture_gpu"/>
      <fog rgba="0.0 0.0 0.5 0.5" type="linear" start="2.0" end="10.0" density="0.5"/>
    </scene>

    <physics type="ode">
      <max_contacts>250</max_contacts>
      <ode>
        <solver type="quick" dt="0.001" iters="20" sor="1.3"/>
        <constraints cfm="0" erp="0.2" contact_max_correcting_vel="100.0" contact_surface_layer="0.0"/>
      </ode>
      <gravity xyz="0.0000 0 0"/>
    </physics>

    <model name="model_1" static="false">

      <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>

      <link name="link_1" self_collide="true" gravity="false" kinematic="false">

        <origin pose="-1.0 0.0 0.0 0.0 0.0 0.0"/>

        <inertial mass="10.0">
          <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>
          <damping linear="0.0" angular="0.0" />
          <inertia ixx="1.0" ixy="0.0" ixz="0.0"
                   iyy="1.0" iyz="0.0"
                   izz="1.0"/>
        </inertial>

        <visual cast_shadows="true" name="visual_box" laser_retro="100.0">
          <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>
          <geometry>
            <box size="0.05 0.05 0.05"/>
          </geometry>
          <material script="Gazebo/Red" normal_map="normal_map.png">
            <ambient rgba="0.03 0.5 0.5 1.0"/>
          </material>
        </visual>

        <collision name="collision_box" laser_retro="100.0">
          <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>
          <max_contacts>250</max_contacts>
          <geometry>
            <box size="0.05 0.05 0.05"/>
          </geometry>
          <surface>
            <friction>
              <ode mu="0.5" mu2="0.2" fdir1="1.0 0 0" slip1="0" slip2="0"/>
            </friction>
            <bounce restitution_coefficient="0" threshold="1000000.0"/>
            <contact>
              <ode soft_cfm="0" soft_erp="0.2" kp="1e15" kd="1e13" max_vel="100.0" min_depth="0.0001"/>
            </contact>
          </surface>
        </collision>

        <sensor name="sensor_ray" type="ray" always_on="true" update_rate="2.0">
          <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>
          <ray>
            <scan display="true">
              <horizontal samples="11" resolution="1.0" min_angle="-0.5236" max_angle="0.5236" />
              <vertical samples="3" resolution="1.0" min_angle="-0.5236" max_angle="0.5236" />
            </scan>
            <range min="0.05" max="30.0"/>
          </ray>
        </sensor>

      </link>

      <plugin name="plugin_1" filename="libray_test.so"/>

    </model>

    <model name="model_2" static="false">

      <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>

      <link name="link_1" self_collide="true" gravity="false" kinematic="false">

        <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>

        <inertial mass="10.0">
          <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>
          <damping linear="0.0" angular="0.0" />
          <inertia ixx="1.0" ixy="0.0" ixz="0.0"
                   iyy="1.0" iyz="0.0"
                   izz="1.0"/>
        </inertial>

        <visual cast_shadows="true" name="visual_mesh_stl" laser_retro="100.0">
          <origin pose="0.0 0.1 0.0 0.0 0.0 0.0"/>
          <geometry>
            <mesh filename="pr2/gripper_v0/l_finger_tip.stl" scale="1 1 1"/>
          </geometry>
          <material script="Gazebo/Red" normal_map="normal_map.png">
            <ambient rgba="0.03 0.5 0.5 1.0"/>
          </material>
        </visual>

        <collision name="collision_mesh_stl" laser_retro="100.0">
          <origin pose="0.0 0.1 0.0 0.0 0.0 0.0"/>
          <max_contacts>250</max_contacts>
          <geometry>
            <mesh filename="pr2/gripper_v0/l_finger_tip.stl" scale="1 1 1"/>
          </geometry>
          <surface>
            <friction>
              <ode mu="0.5" mu2="0.2" fdir1="1.0 0 0" slip1="0" slip2="0"/>
            </friction>
            <bounce restitution_coefficient="0" threshold="1000000.0"/>
            <contact>
              <ode soft_cfm="0" soft_erp="0.2" kp="1e15" kd="1e13" max_vel="100.0" min_depth="0.0001"/>
            </contact>
          </surface>
        </collision>

        <visual cast_shadows="true" name="visual_mesh_dae" laser_retro="100.0">
          <origin pose="0.0 -0.1 0.0 0.0 0.0 0.0"/>
          <geometry>
            <mesh filename="pr2/gripper_v0/l_finger_tip.dae" scale="1 1 1"/>
          </geometry>
        </visual>

        <collision name="collision_mesh_dae" laser_retro="100.0">
          <origin pose="0.0 -0.1 0.0 0.0 0.0 0.0"/>
          <max_contacts>250</max_contacts>
          <geometry>
            <mesh filename="pr2/gripper_v0/l_finger_tip.dae" scale="1 1 1"/>
          </geometry>
          <surface>
            <friction>
              <ode mu="0.5" mu2="0.2" fdir1="1.0 0 0" slip1="0" slip2="0"/>
            </friction>
            <bounce restitution_coefficient="0" threshold="1000000.0"/>
            <contact>
              <ode soft_cfm="0" soft_erp="0.2" kp="1e15" kd="1e13" max_vel="100.0" min_depth="0.0001"/>
            </contact>
          </surface>
        </collision>

      </link>

    </model>

    <model name="model_3" static="false">

      <origin pose="0.2 0.0 0.0 0.0 0.0 0.0"/>

      <link name="link_1" self_collide="true" gravity="true" kinematic="false">
        <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>
        <inertial mass="10.0">
          <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>
          <damping linear="0.0" angular="0.0" />
          <inertia ixx="1.0" ixy="0.0" ixz="0.0"
                   iyy="1.0" iyz="0.0"
                   izz="1.0"/>
        </inertial>

        <visual cast_shadows="true" name="visual_box" laser_retro="100.0">
          <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>
          <geometry>
            <box size="0.1 30.0 30.0"/>
          </geometry>
          <material script="Gazebo/Green" normal_map="normal_map.png">
            <ambient rgba="0.03 0.5 0.5 1.0"/>
          </material>
        </visual>

        <collision name="collision_box" laser_retro="100.0">
          <origin pose="0.0 0.0 0.0 0.0 0.0 0.0"/>
          <max_contacts>250</max_contacts>
          <geometry>
            <box size="0.1 30.0 30.0"/>
          </geometry>
          <surface>
            <friction>
              <ode mu="0.5" mu2="0.2" fdir1="1.0 0 0" slip1="0" slip2="0"/>
            </friction>
            <bounce restitution_coefficient="0" threshold="1000000.0"/>
            <contact>
              <ode soft_cfm="0" soft_erp="0.2" kp="1e15" kd="1e13" max_vel="100.0" min_depth="0.0001"/>
            </contact>
          </surface>
        </collision>

      </link>

    </model>

    <light type="point" name="light_1" cast_shadows="true">
      <origin pose="0.0 0.0 10.0 0.0 0.0 0.0"/>
      <diffuse rgba="0.5 0.5 0.5 0.5"/>
      <attenuation range="1000.0" constant="0.01" quadratic="0.0001"/>
      <direction xyz="0 0 -1"/>
      <spot inner_angle="1.57" outer_angle="1.57" falloff="1.0" />
    </light>

  </world>
</gazebo>
