<?xml version="1.0" encoding="UTF-8" ?>
<sdf version='1.6'>
  <world name='default'>
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <model name='light_model'>
      <static>1</static>
      <pose>0 0 1 0 2.5 0</pose>
      <link name='handle'>
        <pose>0 0 0.075 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <cylinder>
              <radius>0.025</radius>
              <length>0.15</length>
            </cylinder>
          </geometry>
        </visual>
        <light name='button' type='point'>
          <pose>-0.025 0 0.05 0 0 0</pose>
          <attenuation>
            <range>0.20</range>
            <linear>0.10</linear>
          </attenuation>
          <diffuse>1 0.2 0.2 1</diffuse>
          <specular>1 1 1 1</specular>
        </light>
        <visual name='button'>
          <pose>-0.025 0 0.05 0 0 0</pose>
          <geometry>
            <box>
              <size>0.01 0.005 0.02</size>
            </box>
          </geometry>
          <material>
            <ambient>1 0.2 0.2 1</ambient>
            <diffuse>1 0.2 0.2 1</diffuse>
            <specular>1 1 1 1</specular>
            <emissive>1 0.2 0.2 1</emissive>
          </material>
        </visual>
      </link>
      <link name='head'>
        <pose>0 0 0.175 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>0.06 0.06 0.05</size>
            </box>
          </geometry>
        </visual>
      </link>
      <link name='light_source'>
        <pose>0 0 0.20 0 0 0</pose>
        <light name='lamp' type='spot'>
          <pose>0 0 0.0 0 3.14159 0</pose>
          <attenuation>
            <range>30</range>
            <linear>0.05</linear>
          </attenuation>
          <diffuse>0.5 1 1 1</diffuse>
          <specular>1 1 1 1</specular>
          <spot>
            <inner_angle>0.3</inner_angle>
            <outer_angle>0.35</outer_angle>
            <falloff>1</falloff>
          </spot>
          <direction>0 0 -1</direction>
        </light>
        <visual name='lamp'>
          <geometry>
            <sphere>
              <radius>0.025</radius>
            </sphere>
          </geometry>
          <transparency>0.4</transparency>
          <material>
            <ambient>0.5 1 1 1</ambient>
            <diffuse>0.5 1 1 1</diffuse>
            <specular>1 1 1 1</specular>
            <emissive>0.5 1 1 1</emissive>
          </material>
        </visual>
      </link>
      <joint name='joint1' type='fixed'>
        <parent>handle</parent>
        <child>head</child>
      </joint>
      <joint name='joint2' type='fixed'>
        <parent>head</parent>
        <child>light_source</child>
      </joint>
      <plugin name='light_control' filename='libLedPlugin.so'>
        <enable>true</enable>
        <light>
          <id>light_source/lamp</id>
          <duration>0.3</duration>
          <interval>0.4</interval>
          <enable>true</enable>
        </light>
        <light>
          <id>handle/button</id>
          <block>
            <duration>0.5</duration>
            <interval>0</interval>
            <color>1 1 0</color>
          </block>
          <block>
            <duration>0.5</duration>
            <interval>0</interval>
            <color>0 1 1</color>
          </block>
          <block>
            <duration>0.5</duration>
            <interval>0</interval>
            <color>1 0 1</color>
          </block>
          <enable>true</enable>
        </light>
      </plugin>
    </model>
    <gravity>0 0 -9.8</gravity>
  </world>
</sdf>
