<commit_before><?xml version="1.0"?>

<robot name="mbzirc" xmlns:xacro="http://ros.org/wiki/xacro">
  <!-- Properties -->
  <xacro:property name="model_name" value="mbzirc" />
  <xacro:property name="namespace" value="" />
  <xacro:property name="rotor_velocity_slowdown_sim" value="10" />
  <xacro:property name="mesh_file" value="multirotor.dae" />
  <xacro:property name="mesh_scale" value=".001 .001 .001"/>
  <xacro:property name="mesh_scale_prop" value=".001 .001 .001"/>
  <xacro:property name="mass" value="5.850" /> <!-- [kg] -->
  <xacro:property name="body_width" value="0.8" /> <!-- [m] -->
  <xacro:property name="body_height" value="0.6" /> <!-- [m] -->
  <xacro:property name="mass_rotor" value="0.005" /> <!-- [kg] -->
  <xacro:property name="rotor_offset_top" value="0.0" /> <!-- [m] -->
  <xacro:property name="radius_rotor" value="0.19" /> <!-- [m] -->
  <xacro:property name="motor_constant" value="20.0e-06" /> <!-- [kg.m/s^2] -->
  <xacro:property name="moment_constant" value="0.12" /> <!-- [m] -->
  <xacro:property name="time_constant_up" value="0.0125" /> <!-- [s] -->
  <xacro:property name="time_constant_down" value="0.025" /> <!-- [s] -->
  <xacro:property name="max_rot_velocity" value="1100" /> <!-- [rad/s] -->
  <xacro:property name="sin30" value="0.5" />
  <xacro:property name="cos30" value="0.866025403784" />
  <xacro:property name="sqrt2" value="1.4142135623730951" />
  <xacro:property name="rotor_drag_coefficient" value="8.06428e-04" />
  <xacro:property name="rolling_moment_coefficient" value="0.000001" />
  <xacro:property name="color" value="$(arg visual_material)" />

  <!-- Property Blocks -->
  <xacro:property name="body_inertia">
    <inertia ixx="0.287" ixy="0.0" ixz="0.0" iyy="0.287" iyz="0.0" izz="0.468" /> <!-- [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] -->
  </xacro:property>

  <!-- inertia of a single rotor, assuming it is a cuboid. Height=3mm, width=15mm -->
  <xacro:property name="rotor_inertia">
    <inertia
    ixx="${1/12 * mass_rotor * (0.015 * 0.015 + 0.003 * 0.003) * rotor_velocity_slowdown_sim}"
    iyy="${1/12 * mass_rotor * (4 * radius_rotor * radius_rotor + 0.003 * 0.003) * rotor_velocity_slowdown_sim}"
    izz="${1/12 * mass_rotor * (4 * radius_rotor * radius_rotor + 0.015 * 0.015) * rotor_velocity_slowdown_sim}"
    ixy="0.0" ixz="0.0"  iyz="0.0" /> <!-- [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] -->
  </xacro:property>

  <!--Property cylinder_camera-->
  <xacro:property name="camera_cylinder">
    <box size="0.1 0.025 0.02"/>
  </xacro:property>

  <!-- Included URDF Files -->
  <xacro:include filename="$(find robots_description)/urdf/multirotor_base.xacro" />
  <xacro:include filename="$(find robots_description)/urdf/component_snippets.xacro" />

  <!-- Instantiate multirotor_base_macro once -->
  <xacro:multirotor_base_macro
    model_name="${model_name}"
    robot_namespace="${namespace}"
    mass="${mass}"
    body_width="${body_width}"
    body_height="${body_height}"
    mesh_file="${mesh_file}"
    mesh_scale="${mesh_scale}"
    color="DarkGrey"
    >
    <xacro:insert_block name="body_inertia" />
  </xacro:multirotor_base_macro>

  <xacro:camera_macro
    namespace="${namespace}"
    parent_link="base_link"
    camera_suffix="0"
    frame_rate="10"
    horizontal_fov="1.07079633"
    image_width="800"
    image_height="600"
    image_format="R8G8B8"
    min_distance="0.01"
    max_distance="100"
    noise_mean="0"
    noise_stddev="0"
    enable_visual="true"
    >
    <xacro:insert_block name="camera_cylinder"/>
    <origin xyz="0 0.24 -0.24" rpy="0 1.57 0" />
  </xacro:camera_macro>

  <!-- Instantiate rotors -->
  <xacro:vertical_rotor
    robot_namespace="${namespace}"
    suffix="right"
    direction="cw"
    motor_constant="${motor_constant}"
    moment_constant="${moment_constant}"
    parent="base_link"
    mass_rotor="${mass_rotor}"
    radius_rotor="${radius_rotor}"
    time_constant_up="${time_constant_up}"
    time_constant_down="${time_constant_down}"
    max_rot_velocity="${max_rot_velocity}"
    motor_number="0"
    rotor_drag_coefficient="${rotor_drag_coefficient}"
    rolling_moment_coefficient="${rolling_moment_coefficient}"
    mesh="prop"
    mesh_scale="${mesh_scale_prop}"
    color="DarkGrey">
    <origin xyz="0 -0.390 0" rpy="0 0 0" />
    <xacro:insert_block name="rotor_inertia" />
  </xacro:vertical_rotor>

  <xacro:vertical_rotor
    robot_namespace="${namespace}"
    suffix="left"
    direction="ccw"
    motor_constant="${motor_constant}"
    moment_constant="${moment_constant}"<commit_msg>Add magnetic gripper to mbzirc platform<commit_after><?xml version="1.0"?>

<robot name="mbzirc" xmlns:xacro="http://ros.org/wiki/xacro">
  <!-- Properties -->
  <xacro:property name="model_name" value="mbzirc" />
  <xacro:property name="namespace" value="" />
  <xacro:property name="rotor_velocity_slowdown_sim" value="10" />
  <xacro:property name="mesh_file" value="multirotor.dae" />
  <xacro:property name="mesh_scale" value=".001 .001 .001"/>
  <xacro:property name="mesh_scale_prop" value=".001 .001 .001"/>
  <xacro:property name="mass" value="5.850" /> <!-- [kg] -->
  <xacro:property name="body_width" value="0.8" /> <!-- [m] -->
  <xacro:property name="body_height" value="0.6" /> <!-- [m] -->
  <xacro:property name="mass_rotor" value="0.005" /> <!-- [kg] -->
  <xacro:property name="rotor_offset_top" value="0.0" /> <!-- [m] -->
  <xacro:property name="radius_rotor" value="0.19" /> <!-- [m] -->
  <xacro:property name="motor_constant" value="20.0e-06" /> <!-- [kg.m/s^2] -->
  <xacro:property name="moment_constant" value="0.12" /> <!-- [m] -->
  <xacro:property name="time_constant_up" value="0.0125" /> <!-- [s] -->
  <xacro:property name="time_constant_down" value="0.025" /> <!-- [s] -->
  <xacro:property name="max_rot_velocity" value="1100" /> <!-- [rad/s] -->
  <xacro:property name="sin30" value="0.5" />
  <xacro:property name="cos30" value="0.866025403784" />
  <xacro:property name="sqrt2" value="1.4142135623730951" />
  <xacro:property name="rotor_drag_coefficient" value="8.06428e-04" />
  <xacro:property name="rolling_moment_coefficient" value="0.000001" />
  <xacro:property name="color" value="$(arg visual_material)" />

  <!-- Property Blocks -->
  <xacro:property name="body_inertia">
    <inertia ixx="0.287" ixy="0.0" ixz="0.0" iyy="0.287" iyz="0.0" izz="0.468" /> <!-- [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] -->
  </xacro:property>

  <!-- inertia of a single rotor, assuming it is a cuboid. Height=3mm, width=15mm -->
  <xacro:property name="rotor_inertia">
    <inertia
    ixx="${1/12 * mass_rotor * (0.015 * 0.015 + 0.003 * 0.003) * rotor_velocity_slowdown_sim}"
    iyy="${1/12 * mass_rotor * (4 * radius_rotor * radius_rotor + 0.003 * 0.003) * rotor_velocity_slowdown_sim}"
    izz="${1/12 * mass_rotor * (4 * radius_rotor * radius_rotor + 0.015 * 0.015) * rotor_velocity_slowdown_sim}"
    ixy="0.0" ixz="0.0"  iyz="0.0" /> <!-- [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] [kg.m^2] -->
  </xacro:property>

  <!--Property cylinder_camera-->
  <xacro:property name="camera_cylinder">
    <box size="0.1 0.025 0.02"/>
  </xacro:property>

  <!-- Included URDF Files -->
  <xacro:include filename="$(find robots_description)/urdf/multirotor_base.xacro" />
  <xacro:include filename="$(find robots_description)/urdf/component_snippets.xacro" />

  <!-- Instantiate multirotor_base_macro once -->
  <xacro:multirotor_base_macro
    model_name="${model_name}"
    robot_namespace="${namespace}"
    mass="${mass}"
    body_width="${body_width}"
    body_height="${body_height}"
    mesh_file="${mesh_file}"
    mesh_scale="${mesh_scale}"
    color="DarkGrey"
    >
    <xacro:insert_block name="body_inertia" />
  </xacro:multirotor_base_macro>

  <xacro:camera_macro
    namespace="${namespace}"
    parent_link="base_link"
    camera_suffix="0"
    frame_rate="10"
    horizontal_fov="1.07079633"
    image_width="800"
    image_height="600"
    image_format="R8G8B8"
    min_distance="0.01"
    max_distance="100"
    noise_mean="0"
    noise_stddev="0"
    enable_visual="true"
    >
    <xacro:insert_block name="camera_cylinder"/>
    <origin xyz="0 0.24 -0.24" rpy="0 1.57 0" />
  </xacro:camera_macro>

  <!-- Magnetic gripper -->
  <link name="magnetic_gripper">
    <inertial>
      <origin xyz="0 0 0"/>
      <mass value="0.015"/>
      <inertia ixx="1e-05" ixy="0" ixz="0" iyy="1e-05" iyz="0" izz="1e-05"/>
    </inertial>
    <visual>
      <origin xyz="0 0 0"/>
      <geometry>
        <cylinder radius="0.01" length="0.01"/>
      </geometry>
    </visual>
  </link>
  <joint name="base_to_gripper" type="revolute">
    <origin xyz="0 0 -0.2"/>
    <parent link="base_link"/>
    <child link="magnetic_gripper"/>
    <limit effort="0" lower="0" upper="0" velocity="0"/>
  </joint>

  <!-- Instantiate rotors -->
  <xacro:vertical_rotor
    robot_namespace="${namespace}"
    suffix="right"
    direction="cw"
    motor_constant="${motor_constant}"
    moment_constant="${moment_constant}"
    parent="base_link"
    mass_rotor="${mass_rotor}"
    radius_rotor="${radius_rotor}"
    time_constant_up="${time_constant_up}"
    time_constant_down="${time_constant_down}"
    max_rot_velocity="${max_rot_velocity}"
    motor_number="0"
    rotor_drag_coefficient="${rotor_drag_coefficient}"
    rolling_moment_coefficient="${rolling_moment_coefficient}"
    mesh="prop"
    mesh_scale="${mesh_scale_prop}"
    color="DarkGrey">
    <origin xyz="0 -0.390 0" rpy="0 0 0" />
    <xacro:insert_block name="rotor_inertia" />
  </xacro:vertical_rotor>

  <xacro:vertical_rotor
    robot_namespace="${namespace}"
    suffix="left"
    direction="ccw"
    motor_constant="${motor_constant}"
    moment_constant="${moment_constant}"
{'fraction_non_alphanumeric': 0.20348004094165814, 'fraction_numerical': 0.055885363357215966, 'mean_word_length': 4.129133858267717, 'pattern_counts': {'":': 0, '<': 159, '<?xml version=': 2, '>': 157, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7142645', 'n_tokens_mistral': 4126, 'n_tokens_neox': 3760, 'n_words': 552}