<?xml version="1.0" ?>
<sdf version="1.6">
  <world name="quadcopter">
    <physics name="fast" type="ignored">
      <real_time_factor>0</real_time_factor>
    </physics>

    <plugin
      filename="ignition-gazebo-physics-system"
      name="ignition::gazebo::systems::Physics">
    </plugin>
    <plugin
      filename="ignition-gazebo-scene-broadcaster-system"
      name="ignition::gazebo::systems::SceneBroadcaster">
    </plugin>

    <model name="ground_plane">
      <static>true</static>
      <link name="link">
        <collision name="collision">
          <geometry>
            <plane>
              <normal>0 0 1</normal>
              <size>100 100</size>
            </plane>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <plane>
              <normal>0 0 1</normal>
              <size>100 100</size>
            </plane>
          </geometry>
          <material>
            <ambient>0.8 0.8 0.8 1</ambient>
            <diffuse>0.8 0.8 0.8 1</diffuse>
            <specular>0.8 0.8 0.8 1</specular>
          </material>
        </visual>
      </link>
    </model>
    <model name="X3">
      <pose>0 0 0.053302 0 0 0</pose>
      <link name="base_link">
        <inertial>
          <mass>1.5</mass>
          <inertia>
            <ixx>0.0347563</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.07</iyy>
            <iyz>0</iyz>
            <izz>0.0977</izz>
          </inertia>
        </inertial>
        <collision name="base_link_inertia_collision">
          <geometry>
            <box>
              <size>0.30 0.42 0.11</size>
            </box>
          </geometry>
        </collision>
        <visual name="base_link_inertia_visual">
          <geometry>
            <box>
              <size>0.15 0.21 0.11</size>
            </box>
          </geometry>
        </visual>
      </link>
      <link name="rotor_0">
        <pose frame="">0.13 -0.22 0.023 0 -0 0</pose>
        <inertial>
          <mass>0.005</mass>
          <inertia>
            <ixx>9.75e-07</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>4.17041e-05</iyy>
            <iyz>0</iyz>
            <izz>4.26041e-05</izz>
          </inertia>
        </inertial>
        <collision name="rotor_0_collision">
          <geometry>
            <cylinder>
              <length>0.005</length>
              <radius>0.1</radius>
            </cylinder>
          </geometry>
        </collision>
        <visual name="rotor_0_visual">
          <pose>0 0 0 1.57 0 0 0</pose>
          <geometry>
            <cylinder>
              <length>0.2</length>
              <radius>0.01</radius>
            </cylinder>
          </geometry>
          <material>
            <diffuse>0 0 1 1</diffuse>
          </material>
        </visual>
      </link>
      <joint name="rotor_0_joint" type="revolute">
        <child>rotor_0</child>
        <parent>base_link</parent>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <lower>-1e+16</lower>
            <upper>1e+16</upper>
          </limit>
        </axis>
      </joint>
      <link name="rotor_1">
        <pose>-0.13 0.2 0.023 0 -0 0</pose>
        <inertial>
          <mass>0.005</mass>
          <inertia>
            <ixx>9.75e-07</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>4.17041e-05</iyy>
            <iyz>0</iyz>
            <izz>4.26041e-05</izz>
          </inertia>
        </inertial>
        <collision name="rotor_1_collision">
          <geometry>
            <cylinder>
              <length>0.005</length>
              <radius>0.1</radius>
            </cylinder>
          </geometry>
        </collision>
        <visual name="rotor_1_visual">
          <pose>0 0 0 1.57 0 0 0</pose>
          <geometry>
            <cylinder>
              <length>0.2</length>
              <radius>0.01</radius>
            </cylinder>
          </geometry>
          <material>
            <diffuse>1 0 0 1</diffuse>
          </material>
        </visual>
      </link>
      <joint name="rotor_1_joint" type="revolute">
        <child>rotor_1</child>
        <parent>base_link</parent>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <lower>-1e+16</lower>
            <upper>1e+16</upper>
          </limit>
        </axis>
      </joint>
      <link name="rotor_2">
        <pose>0.13 0.22 0.023 0 -0 0</pose>
        <inertial>
          <mass>0.005</mass>
          <inertia>
            <ixx>9.75e-07</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>4.17041e-05</iyy>
            <iyz>0</iyz>
            <izz>4.26041e-05</izz>
          </inertia>
        </inertial>
        <collision name="rotor_2_collision">
          <geometry>
            <cylinder>
              <length>0.005</length>
              <radius>0.1</radius>
            </cylinder>
          </geometry>
        </collision>
        <visual name="rotor_2_visual">
          <pose>0 0 0 1.57 0 0 0</pose>
          <geometry>
            <cylinder>
              <length>0.2</length>
              <radius>0.01</radius>
            </cylinder>
          </geometry>
          <material>
            <diffuse>0 0 1 1</diffuse>
          </material>
        </visual>
      </link>
      <joint name="rotor_2_joint" type="revolute">
        <child>rotor_2</child>
        <parent>base_link</parent>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <lower>-1e+16</lower>
            <upper>1e+16</upper>
          </limit>
        </axis>
      </joint>
      <link name="rotor_3">
        <pose>-0.13 -0.2 0.023 0 -0 0</pose>
        <inertial>
          <mass>0.005</mass>
          <inertia>
            <ixx>9.75e-07</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>4.17041e-05</iyy>
            <iyz>0</iyz>
            <izz>4.26041e-05</izz>
          </inertia>
        </inertial>
        <collision name="rotor_3_collision">
          <geometry>
            <cylinder>
              <length>0.005</length>
              <radius>0.1</radius>
            </cylinder>
          </geometry>
        </collision>
        <visual name="rotor_3_visual">
          <pose>0 0 0 1.57 0 0 0</pose>
          <geometry>
            <cylinder>
              <length>0.2</length>
              <radius>0.01</radius>
            </cylinder>
          </geometry>
          <material>
            <diffuse>1 0 0 1</diffuse>
          </material>
        </visual>
      </link>
      <joint name="rotor_3_joint" type="revolute">
        <child>rotor_3</child>
        <parent>base_link</parent>
        <axis>
          <xyz>0 0 1</xyz>
          <limit>
            <lower>-1e+16</lower>
            <upper>1e+16</upper>
          </limit>
        </axis>
      </joint>
      <plugin
        filename="ignition-gazebo-multicopter-motor-model-system"
        name="ignition::gazebo::systems::MulticopterMotorModel">
        <robotNamespace>X3</robotNamespace>
        <jointName>rotor_0_joint</jointName>
        <linkName>rotor_0</linkName>
        <turningDirection>ccw</turningDirection>
        <timeConstantUp>0.0125</timeConstantUp>
        <timeConstantDown>0.025</timeConstantDown>
        <maxRotVelocity>8000.0</maxRotVelocity>
        <motorConstant>8.54858e-06</motorConstant>
        <momentConstant>0.016</momentConstant>
        <commandSubTopic>gazebo/command/motor_speed</commandSubTopic>
        <motorNumber>0</motorNumber>
        <rotorDragCoefficient>8.06428e-05</rotorDragCoefficient>
        <rollingMomentCoefficient>1e-06</rollingMomentCoefficient>
        <motorSpeedPubTopic>motor_speed/0</motorSpeedPubTopic>
        <rotorVelocitySlowdownSim>1</rotorVelocitySlowdownSim>
        <motorType>velocity</motorType>
      </plugin>
      <plugin
        filename="ignition-gazebo-multicopter-motor-model-system"
        name="ignition::gazebo::systems::MulticopterMotorModel">
        <robotNamespace>X3</robotNamespace>
        <jointName>rotor_1_joint</jointName>
        <linkName>rotor_1</linkName>
        <turningDirection>ccw</turningDirection>
        <timeConstantUp>0.0125</timeConstantUp>
        <timeConstantDown>0.025</timeConstantDown>
        <maxRotVelocity>8000.0</maxRotVelocity>
        <motorConstant>8.54858e-06</motorConstant>
        <momentConstant>0.016</momentConstant>
        <commandSubTopic>gazebo/command/motor_speed</commandSubTopic>
        <motorNumber>1</motorNumber>
        <rotorDragCoefficient>8.06428e-05</rotorDragCoefficient>
        <rollingMomentCoefficient>1e-06</rollingMomentCoefficient>
        <motorSpeedPubTopic>motor_speed/1</motorSpeedPubTopic>
        <rotorVelocitySlowdownSim>1</rotorVelocitySlowdownSim>
        <motorType>velocity</motorType>
      </plugin>
      <plugin
        filename="ignition-gazebo-multicopter-motor-model-system"
        name="ignition::gazebo::systems::MulticopterMotorModel">
        <robotNamespace>X3</robotNamespace>
        <jointName>rotor_2_joint</jointName>
        <linkName>rotor_2</linkName>
        <turningDirection>cw</turningDirection>
        <timeConstantUp>0.0125</timeConstantUp>
        <timeConstantDown>0.025</timeConstantDown>
        <maxRotVelocity>8000.0</maxRotVelocity>
        <motorConstant>8.54858e-06</motorConstant>
        <momentConstant>0.016</momentConstant>
        <commandSubTopic>gazebo/command/motor_speed</commandSubTopic>
        <motorNumber>2</motorNumber>
        <rotorDragCoefficient>8.06428e-05</rotorDragCoefficient>
        <rollingMomentCoefficient>1e-06</rollingMomentCoefficient>
        <motorSpeedPubTopic>motor_speed/2</motorSpeedPubTopic>
        <rotorVelocitySlowdownSim>1</rotorVelocitySlowdownSim>
        <motorType>velocity</motorType>
      </plugin>
      <plugin
        filename="ignition-gazebo-multicopter-motor-model-system"
        name="ignition::gazebo::systems::MulticopterMotorModel">
        <robotNamespace>X3</robotNamespace>
        <jointName>rotor_3_joint</jointName>
        <linkName>rotor_3</linkName>
        <turningDirection>cw</turningDirection>
        <timeConstantUp>0.0125</timeConstantUp>
        <timeConstantDown>0.025</timeConstantDown>
        <maxRotVelocity>8000.0</maxRotVelocity>
        <motorConstant>8.54858e-06</motorConstant>
        <momentConstant>0.016</momentConstant>
        <commandSubTopic>gazebo/command/motor_speed</commandSubTopic>
        <motorNumber>3</motorNumber>
        <rotorDragCoefficient>8.06428e-05</rotorDragCoefficient>
        <rollingMomentCoefficient>1e-06</rollingMomentCoefficient>
        <motorSpeedPubTopic>motor_speed/3</motorSpeedPubTopic>
        <rotorVelocitySlowdownSim>1</rotorVelocitySlowdownSim>
        <motorType>velocity</motorType>
      </plugin>
    </model>
  </world>
</sdf>
