<?xml version="1.0"?>
<sdf version="1.9">
  <model name="gimbal_small_3d">
    <pose>0 0 0.18 0 0 0</pose>
    <link name="base_link">
      <inertial>
        <mass>0.2</mass>
        <inertia>
          <ixx>0.0001</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.0001</iyy>
          <iyz>0</iyz>
          <izz>0.0001</izz>
        </inertia>
      </inertial>
      <visual name="base_visual">
        <geometry>
          <mesh>
            <uri>model://gimbal_small_3d/meshes/base_plate.dae</uri>
          </mesh>
        </geometry>
        <material>
          <ambient>0.1 0.1 0.1</ambient>
          <diffuse>0.1 0.1 0.1</diffuse>
          <specular>0.01 0.01 0.01 1.0</specular>
        </material>
      </visual>
      <collision name="base_collision">
        <pose>0.01 0.075 -0.025 0 0 0</pose>
        <geometry>
          <box>
            <size>0.1 0.05 0.15</size>
          </box>
        </geometry>
      </collision>
    </link>

    <link name="yaw_link">
      <inertial>
        <mass>0.01</mass>
        <inertia>
          <ixx>0.00001</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.00001</iyy>
          <iyz>0</iyz>
          <izz>0.00001</izz>
        </inertia>
      </inertial>
      <visual name="yaw_visual">
        <geometry>
          <mesh>
            <uri>model://gimbal_small_3d/meshes/yaw_arm.dae</uri>
          </mesh>
        </geometry>
        <material>
          <ambient>0.1 0.1 0.1</ambient>
          <diffuse>0.1 0.1 0.1</diffuse>
          <specular>0.01 0.01 0.01 1.0</specular>
        </material>
      </visual>
      <collision name="yaw_collision">
        <geometry>
          <mesh>
            <uri>model://gimbal_small_3d/meshes/yaw_arm.dae</uri>
          </mesh>
        </geometry>
      </collision>
    </link>
    <joint name="yaw_joint" type="revolute">
      <parent>base_link</parent>
      <child>yaw_link</child>
      <axis>
        <xyz>0 1 0</xyz>
        <dynamics>
          <damping>0.01</damping>
        </dynamics>
        <limit>
          <lower>-3.1415926</lower>
          <upper>3.1415926</upper>
        </limit>
      </axis>
      <pose>0.0105 0.065 -0.002 0 0 0</pose>
    </joint>

    <link name="roll_link">
      <inertial>
        <mass>0.01</mass>
        <inertia>
          <ixx>0.00001</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.00001</iyy>
          <iyz>0</iyz>
          <izz>0.00001</izz>
        </inertia>
      </inertial>
      <visual name="roll_visual">
        <geometry>
          <mesh>
            <uri>model://gimbal_small_3d/meshes/roll_arm.dae</uri>
          </mesh>
        </geometry>
        <material>
          <ambient>0.1 0.1 0.1</ambient>
          <diffuse>0.1 0.1 0.1</diffuse>
          <specular>0.01 0.01 0.01 1.0</specular>
        </material>
      </visual>
      <collision name="roll_collision">
        <geometry>
          <mesh>
            <uri>model://gimbal_small_3d/meshes/roll_arm.dae</uri>
          </mesh>
        </geometry>
      </collision>
    </link>
    <joint name="roll_joint" type="revolute">
      <parent>yaw_link</parent>
      <child>roll_link</child>
      <axis>
        <xyz>0 0 1</xyz>
        <dynamics>
          <damping>0.01</damping>
        </dynamics>
        <limit>
          <lower>-3.1415926</lower>
          <upper>3.1415926</upper>
        </limit>
      </axis>
      <pose>0.0099 0.002 -0.05 0 0 0</pose>
    </joint>

    <link name="pitch_link">
      <inertial>
        <mass>0.01</mass>
        <inertia>
          <ixx>0.00001</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.00001</iyy>
          <iyz>0</iyz>
          <izz>0.00001</izz>
        </inertia>
      </inertial>
      <visual name="pitch_visual">
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <mesh>
            <uri>model://gimbal_small_3d/meshes/camera_enclosure.dae</uri>
          </mesh>
        </geometry>
        <material>
          <ambient>0.4 0.4 0.4</ambient>
          <diffuse>0.4 0.4 0.4</diffuse>
          <specular>0.1 0.1 0.1 1.0</specular>
        </material>
      </visual>
      <collision name="pitch_collision">
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <mesh>
            <uri>model://gimbal_small_3d/meshes/camera_enclosure.dae</uri>
          </mesh>
        </geometry>
      </collision>
      <visual name="camera_visual">
        <pose>0 0 0.02 0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.025</radius>
            <length>0.050</length>
          </cylinder>
        </geometry>
        <material>
          <ambient>0.4 0.4 0.4</ambient>
          <diffuse>0.4 0.4 0.4</diffuse>
          <specular>0.1 0.1 0.1 1.0</specular>
        </material>
      </visual>
      <collision name="camera_collision">
        <pose>0 0 0.02 0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.025</radius>
            <length>0.050</length>
          </cylinder>
        </geometry>
      </collision>
      <sensor name="camera" type="camera">
        <pose>0 0 0 -1.57 -1.57 0</pose>
        <camera>
          <horizontal_fov>2.0</horizontal_fov>
          <image>
            <width>640</width>
            <height>480</height>
          </image>
          <clip>
            <near>0.05</near>
            <far>15000</far>
          </clip>
        </camera>
        <always_on>1</always_on>
        <update_rate>10</update_rate>
        <visualize>1</visualize>

        <plugin filename="CameraZoomPlugin"
            name="CameraZoomPlugin">
          <max_zoom>125.0</max_zoom>
          <slew_rate>0.42514285714</slew_rate>
        </plugin>
        
        <plugin name="GstCameraPlugin"
            filename="GstCameraPlugin">
          <udp_host>127.0.0.1</udp_host>
          <udp_port>5600</udp_port>
          <use_basic_pipeline>true</use_basic_pipeline>
          <use_cuda>false</use_cuda>
        </plugin>

      </sensor>
    </link>
    <joint name="pitch_joint" type="revolute">
      <parent>roll_link</parent>
      <child>pitch_link</child>
      <axis>
        <xyz>1 0 0</xyz>
        <dynamics>
          <damping>0.01</damping>
        </dynamics>
        <limit>
          <lower>-3.1415926</lower>
          <upper>3.1415926</upper>
        </limit>
      </axis>
      <pose>0.045 0.0021 0.0199 0 0 0</pose>
    </joint>
  </model>
</sdf>
