<?xml version="1.0" ?>
<sdf version="1.9">
  <model name="zephyr">
    <link name="wing">
      <inertial>
        <pose>0 -0.12 0 0 0 0</pose>
        <mass>1.5</mass>
        <inertia>
          <ixx>0.083137104</ixx>
          <ixy>0</ixy>
          <iyy>0.387382402</iyy>
          <ixz>0</ixz>
          <iyz>0</iyz>
          <izz>0.469845106</izz>
        </inertia>
      </inertial>
      <visual name="visual">
        <geometry>
          <mesh>
            <uri>model://zephyr/meshes/wing.dae</uri>
            <submesh>
              <name>Wing</name>
              <center>true</center>
            </submesh>
          </mesh>
        </geometry>
      </visual>
      <collision name="body_collision">
        <geometry>
          <mesh>
            <uri>model://zephyr/meshes/wing.dae</uri>
            <submesh>
              <name>Wing</name>
              <center>true</center>
            </submesh>
          </mesh>
        </geometry>
      </collision>
      <collision name="right_rudder_collision">
        <pose>-0.76435 0.33918 0.002 -0.03 0 0</pose>
        <geometry>
          <box>
            <size>.005 0.12993 .12688</size>
          </box>
        </geometry>
      </collision>
      <collision name="left_rudder_collision">
        <pose>0.76435 0.33918 0.002 -0.03 0 0</pose>
        <geometry>
          <box>
            <size>.005 0.12993 .12688</size>
          </box>
        </geometry>
      </collision>

      <!-- save center of pressure locations for debugging -->
      <visual name="cp_wing">
        <pose>0 -0.1 0.0 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>0.03</radius>
          </sphere>
        </geometry>
        <material>
          <ambient>0 0 1</ambient>
          <diffuse>0 0 1</diffuse>
          <specular>0.1 0.1 0.1 1</specular>
        </material>
      </visual>
      <visual name="cp_flap_left">
        <pose>0.7 0.20 0 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>0.03</radius>
          </sphere>
        </geometry>
        <material>
          <ambient>1 0 0</ambient>
          <diffuse>1 0 0</diffuse>
          <specular>0.1 0.1 0.1 1</specular>
        </material>
      </visual>
      <visual name="cp_flap_right">
        <pose>-0.7 0.20 0 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>0.03</radius>
          </sphere>
        </geometry>
        <material>
          <ambient>0 1 0</ambient>
          <diffuse>0 1 0</diffuse>
          <specular>0.1 0.1 0.1 1</specular>
        </material>
      </visual>

    </link>
    <link name="propeller">
      <pose degrees="true">0 0.07 0.008 0 90 0</pose>
      <inertial>
        <mass>.05</mass>
        <inertia>
          <ixx>0.000367571</ixx>
          <ixy>0</ixy>
          <iyy>0.00036985</iyy>
          <ixz>0</ixz>
          <iyz>0</iyz>
          <izz>0.000003187</izz>
        </inertia>
      </inertial>
      <visual name="visual">
        <geometry>
          <mesh>
            <uri>model://zephyr/meshes/wing.dae</uri>
            <submesh>
              <name>Propeller</name>
              <center>true</center>
            </submesh>
          </mesh>
        </geometry>
      </visual>
      <collision name="blade1">
        <pose>0 0 0.074205 0 0  0.3</pose>
        <geometry>
          <box>
            <size>0.02561 0.00541 0.14841</size>
          </box>
        </geometry>
      </collision>
      <collision name="blade2">
        <pose>0 0 -0.074205 0 0  -0.3</pose>
        <geometry>
          <box>
            <size>0.02561 0.00541 0.14841</size>
          </box>
        </geometry>
      </collision>
    </link>
    <link name="flap_left">
      <pose>0.4530 .239 0.007 0 0 0</pose>
      <inertial>
        <pose>0 0 0 0 0 0.32445671</pose>
        <mass>.1</mass>
        <inertia>
          <ixx>0.000102319</ixx>
          <ixy>0</ixy>
          <iyy>0.00334417</iyy>
          <ixz>0</ixz>
          <iyz>0</iyz>
          <izz>0.003446072</izz>
        </inertia>
      </inertial>
      <visual name="visual">
        <geometry>
          <mesh>
            <uri>model://zephyr/meshes/wing.dae</uri>
            <submesh>
              <name>Flap_Left</name>
              <center>true</center>
            </submesh>
          </mesh>
        </geometry>
      </visual>
      <collision name="collision">
        <pose>-0.01 0.01 0 0 0 0.32445671</pose>
        <geometry>
          <box>
            <size>0.633463031 0.110694312 0.005</size>
          </box>
        </geometry>
      </collision>
    </link>
    <link name="flap_right">
      <pose>-0.4530 .239 0.007 0 0 0</pose>
      <inertial>
        <pose>0 0 0 0 0 -0.32445671</pose>
        <mass>.1</mass>
        <inertia>
          <ixx>0.000102319</ixx>
          <ixy>0</ixy>
          <iyy>0.00334417</iyy>
          <ixz>0</ixz>
          <iyz>0</iyz>
          <izz>0.003446072</izz>
        </inertia>
      </inertial>
      <visual name="visual">
        <geometry>
          <mesh>
            <uri>model://zephyr/meshes/wing.dae</uri>
            <submesh>
              <name>Flap_Right</name>
              <center>true</center>
            </submesh>
          </mesh>
        </geometry>
      </visual>
      <collision name="collision">
        <pose>0.01 0.01 0 0 0 -0.32445671</pose>
        <geometry>
          <box>
            <size>0.633463031 0.110694312 0.005</size>
          </box>
        </geometry>
      </collision>
    </link>
    <joint name="propeller_joint" type="revolute">
      <parent>wing</parent>
      <child>propeller</child>
      <axis>
        <xyz>0 -1 0</xyz>
        <dynamics>
          <damping>0.002</damping>
        </dynamics>
      </axis>
    </joint>
    <joint name="flap_left_joint" type="revolute">
      <parent>wing</parent>
      <child>flap_left</child>
      <pose>0 -0.04 0 0 0 0</pose>
      <axis>
        <xyz>1 0.330321014 0</xyz>
        <limit>
          <lower>-0.524</lower>
          <upper>0.524</upper>
        </limit>
        <dynamics>
          <damping>0.1</damping>
        </dynamics>
      </axis>
    </joint>
    <joint name="flap_right_joint" type="revolute">
      <parent>wing</parent>
      <child>flap_right</child>
      <pose>0 -0.04 0 0 0 0</pose>
      <axis>
        <xyz>1 -0.330321014 0</xyz>
        <limit>
          <lower>-0.524</lower>
          <upper>0.524</upper>
        </limit>
        <dynamics>
          <damping>0.1</damping>
        </dynamics>
      </axis>
    </joint>

    <!-- sensors -->
    <link name='imu_link'>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.15</mass>
        <inertia>
          <ixx>0.00002</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.00002</iyy>
          <iyz>0</iyz>
          <izz>0.00002</izz>
        </inertia>
      </inertial>
      <sensor name="imu_sensor" type="imu">
        <pose degrees="true">0 0 0 180 0 -90</pose>
        <always_on>1</always_on>
        <update_rate>1000.0</update_rate>
      </sensor>
    </link>
    <joint name='imu_joint' type='revolute'>
      <child>imu_link</child>
      <parent>wing</parent>
      <axis>
        <xyz>0 0 1</xyz>
        <limit>
          <lower>0</lower>
          <upper>0</upper>
          <effort>0</effort>
          <velocity>0</velocity>
        </limit>
        <dynamics>
          <damping>1.0</damping>
        </dynamics>
      </axis>
    </joint>
  </model>
</sdf>
