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

<!-- Here we define the robot, we named it "iiwa7_tool" -->
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="iiwa7_tool">
  
  <!-- Import Rviz colors -->
  <xacro:include filename="$(find iiwa_description)/urdf/materials.xacro" />
  <!--Import the iiwa7 macro -->
  <xacro:include filename="$(find iiwa_description)/urdf/iiwa7.xacro"/>
  
<!--  Define the origin of your 3D space
      Here we define a box lying at 0,0,0 with some dimensions, in reality our robot is place on top of a metal cart with those dimensions.
      This will include the cart in the scene and avoid the robot to hit it when using MoveIt! 
      If you don't want to have that you can define a basic world link (see commented lines)
  -->
  
<!--     <link name="world"/> -->
  
  <link name="world">
    <visual>
      <origin xyz="0 0 0.42" rpy="0 0 0"/>
      <geometry>
	<box size="0.68 0.605 0.84"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 0.42" rpy="0 0 0"/>
      <geometry>
	<box size="0.68 0.605 0.84"/>
      </geometry>
    </collision>
  </link>
  
  <gazebo reference="world">
    <static>true</static>
  </gazebo>
  
<!-- Here we insert an iiwa7 robot in the scene, it's origin is just on top of the box previously defined. You can use 0,0,0 if you don't have that. -->
  <xacro:iiwa7 hardware_interface="$(arg hardware_interface)" robot_name="$(arg robot_name)" parent="world">
    <origin xyz="0 0 0.84" rpy="0 0 0"/>
  </xacro:iiwa7>
  
  <!-- Tool properties -->
  <property name="tool_mass" value="0.200" />
  <property name="tool_joint_offset" value="0.00 0.00 0.00" />
  <property name="tool_link_offset" value="0.00 0.00 0.1275" />
  
<!--  Here we define a dummy joint between the tip of the iiwa7 and the base of the tool. 
      There is no offset between the two, that means the tool is attached at the robot flange. -->
  <joint name="tool_joint" type="fixed">
    <parent link="iiwa_link_ee" />
    <child link = "tool_link" />
    <origin xyz="${tool_joint_offset}" rpy="0 ${PI/2.0} 0" />  
  </joint>
  
<!-- Here we define the geometry of the tool. We designed the tool ourselves, so we have a mesh file that represents it.   
  Else, one can define it using a geometric representation that approximate it, like a cylinder (see commented lines) -->
  <link name="tool_link">
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
	<mesh filename="package://iiwa_tool_description/meshes/visual/tool.stl"/>
<!-- 	<cylinder length="0.1275" radius="0.020"/> -->
      </geometry>
      <material name="Grey"/>
    </visual>
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
	<mesh filename="package://iiwa_tool_description/meshes/visual/tool.stl"/>
<!-- 	<cylinder length="0.1275" radius="0.020"/> -->
      </geometry>
      <material name="Grey"/>
    </collision>
  </link>

<!--  Here we define another dummy joint. It is placed at the end of the tool, so we can then attach a frame at its TCP for control -->
  <joint name="tool_tip_joint" type="fixed">
    <parent link="tool_link" />
    <child link = "tool_link_ee" />
   <origin xyz="${tool_link_offset}" rpy="0 ${-PI/2.0} 0" />   
  </joint>
  
<!--  The TCP frame is here defined -->
  <link name="tool_link_ee"/>
  
<!-- Here we do the same as before, the resulting frame will be in the same position of the last one,
  but we add a rotation to be aligned with the convention used by KUKA. So this fame will have exactly the same representation of the frame
  attached to this tool as defined in Sunrise Workbench! This is really useful when directly controlling the robot without MoveIt! -->
    <joint name="tool_tip_joint_kuka" type="fixed">
    <parent link="tool_link" />
    <child link = "tool_link_ee_kuka" />
    <origin xyz="${tool_link_offset}" rpy="0 0 0" />   
  </joint>
  
  <link name="tool_link_ee_kuka"/>
</robot> 
<commit_msg>aligned<commit_after><?xml version="1.0"?>

<!-- Here we define the robot, we named it "iiwa7_tool" -->
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="iiwa7_tool">
  
  <!-- Import Rviz colors -->
  <xacro:include filename="$(find iiwa_description)/urdf/materials.xacro" />
  <!--Import the iiwa7 macro -->
  <xacro:include filename="$(find iiwa_description)/urdf/iiwa7.xacro"/>
  
  <!--  Define the origin of your 3D space
  Here we define a box lying at 0,0,0 with some dimensions, in reality our robot is place on top of a metal cart with those dimensions.
  This will include the cart in the scene and avoid the robot to hit it when using MoveIt! 
  If you don't want to have that you can define a basic world link (see commented lines)
  -->
  
  <!--     <link name="world"/> -->
  
  <link name="world">
    <visual>
      <origin xyz="0 0 0.42" rpy="0 0 0"/>
      <geometry>
	<box size="0.68 0.605 0.84"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 0.42" rpy="0 0 0"/>
      <geometry>
	<box size="0.68 0.605 0.84"/>
      </geometry>
    </collision>
  </link>
  
  <gazebo reference="world">
    <static>true</static>
  </gazebo>
  
  <!-- Here we insert an iiwa7 robot in the scene, it's origin is just on top of the box previously defined. You can use 0,0,0 if you don't have that. -->
  <xacro:iiwa7 hardware_interface="$(arg hardware_interface)" robot_name="$(arg robot_name)" parent="world">
    <origin xyz="0 0 0.84" rpy="0 0 0"/>
  </xacro:iiwa7>
  
  <!-- Tool properties -->
  <property name="tool_mass" value="0.200" />
  <property name="tool_joint_offset" value="0.00 0.00 0.00" />
  <property name="tool_link_offset" value="0.00 0.00 0.1275" />
  
  <!--  Here we define a dummy joint between the tip of the iiwa7 and the base of the tool. 
  There is no offset between the two, that means the tool is attached at the robot flange. -->
  <joint name="tool_joint" type="fixed">
    <parent link="iiwa_link_ee" />
    <child link = "tool_link" />
    <origin xyz="${tool_joint_offset}" rpy="0 ${PI/2.0} 0" />  
  </joint>
  
  <!-- Here we define the geometry of the tool. We designed the tool ourselves, so we have a mesh file that represents it.   
  Else, one can define it using a geometric representation that approximate it, like a cylinder (see commented lines) -->
  <link name="tool_link">
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
	<mesh filename="package://iiwa_tool_description/meshes/visual/tool.stl"/>
	<!-- 	<cylinder length="0.1275" radius="0.020"/> -->
      </geometry>
      <material name="Grey"/>
    </visual>
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
	<mesh filename="package://iiwa_tool_description/meshes/visual/tool.stl"/>
	<!-- 	<cylinder length="0.1275" radius="0.020"/> -->
      </geometry>
      <material name="Grey"/>
    </collision>
  </link>
  
  <!--  Here we define another dummy joint. It is placed at the end of the tool, so we can then attach a frame at its TCP for control -->
  <joint name="tool_tip_joint" type="fixed">
    <parent link="tool_link" />
    <child link = "tool_link_ee" />
    <origin xyz="${tool_link_offset}" rpy="0 ${-PI/2.0} 0" />   
  </joint>
  
  <!--  The TCP frame is here defined -->
  <link name="tool_link_ee"/>
  
  <!-- Here we do the same as before, the resulting frame will be in the same position of the last one,
  but we add a rotation to be aligned with the convention used by KUKA. So this fame will have exactly the same representation of the frame
  attached to this tool as defined in Sunrise Workbench! This is really useful when directly controlling the robot without MoveIt! -->
  <joint name="tool_tip_joint_kuka" type="fixed">
    <parent link="tool_link" />
    <child link = "tool_link_ee_kuka" />
    <origin xyz="${tool_link_offset}" rpy="0 0 0" />   
  </joint>
  
  <link name="tool_link_ee_kuka"/>
</robot> 

{'fraction_non_alphanumeric': 0.14626067014906358, 'fraction_numerical': 0.03210600076442859, 'mean_word_length': 3.0631469979296067, 'pattern_counts': {'":': 0, '<': 161, '<?xml version=': 2, '>': 161, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4324806', 'n_tokens_mistral': 2770, 'n_tokens_neox': 2588, 'n_words': 904}