SHARE
TWEET

xacro arm 2 axes

a guest Feb 21st, 2016 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" ?>
  2. <!-- Lamp -->
  3. <robot name="arm" xmlns:xacro="http://www.ros.org/wiki/xacro">
  4. <!-- Lamp has 5 joints and 5 links -->
  5.  
  6.   <!--  Constants for robot dimensions -->
  7.   <xacro:property name="height1" value="0.20" /> <!-- Link 1 -->
  8.   <xacro:property name="height2" value="0.10" /> <!-- Link 2 -->
  9.   <xacro:property name="width" value="0.02" /> <!-- Square dimensions (widthxwidth) of beams -->
  10.   <xacro:property name="gap_link" value="0.0" /> <!-- Distance gap between each axis -->
  11.   <xacro:property name="mass" value="1" /> <!-- arbitrary value for mass -->
  12.   <xacro:property name="axel_offset" value="0.0" /> <!-- Space btw top of beam and the each joint -->
  13.  
  14.   <!-- Import Rviz colors -->
  15.   <xacro:include filename="$(find luxo_descriptions)/descriptions/materials.xacro" />
  16.  
  17. <!-- ***************** WORLD ********************* -->
  18. <!-- Used for fixing the robot to Gazebo 'base_link' -->
  19. <link name="world"/>
  20.  
  21. <joint name="fixed" type="fixed">
  22.   <parent link="world"/>
  23.     <child link="link1"/>
  24. </joint>
  25.  
  26. <!-- Base Link -->
  27. <link name="link1">
  28.   <collision>
  29.     <origin xyz="0 0 ${height1/2}" rpy="0 0 0"/>
  30.     <geometry>
  31.       <box size="${width} ${width} ${height1}"/>
  32.     </geometry>
  33.   </collision>
  34.  
  35.   <visual>
  36.     <origin xyz="0 0 ${height1/2}" rpy="0 0 0"/>
  37.     <geometry>
  38.       <box size="${width} ${width} ${height1}"/>
  39.     </geometry>
  40.     <material name="orange"/>
  41.   </visual>
  42.  
  43.   <inertial>
  44.     <origin xyz="0 0 ${height1/2}" rpy="0 0 0"/>
  45.     <mass value="1"/>
  46.     <inertia
  47.      ixx="${mass / 12.0 * (width*width + height1*height1)}" ixy="0.0" ixz="0.0"
  48.      iyy="${mass / 12.0 * (height1*height1 + width*width)}" iyz="0.0"
  49.      izz="${mass / 12.0 * (width*width + width*width)}"/>
  50.   </inertial>
  51. </link>
  52.  
  53. <!-- ***************** JOINT1 ********************* -->
  54. <!-- Used for fixing link1 to link2  -->
  55. <joint name="joint1" type="continuous">
  56.   <parent link="link1"/>
  57.     <child link="link2"/>
  58.   <origin xyz="0 ${gap_link} ${height1 - axel_offset}" rpy="0 0 0"/>
  59.   <axis xyz="0 1 0"/>
  60.   <dynamics damping="0.7"/>
  61. </joint>
  62.  
  63. <link name="link2">
  64.   <collision>
  65.     <origin xyz="0 0 ${height2/2}" rpy="0 0 0"/>
  66.     <geometry>
  67.       <box size="${width} ${width} ${height2}"/>
  68.     </geometry>
  69.   </collision>
  70.  
  71.   <visual>
  72.     <origin xyz="0 0 ${height2/2}" rpy="0 0 0"/>
  73.     <geometry>
  74.       <box size="${width} ${width} ${height2}"/>
  75.     </geometry>
  76.     <material name="black"/>
  77.  </visual>
  78.  
  79.   <inertial>
  80.     <origin xyz="0 0 ${height2/2}" rpy="0 0 0"/>
  81.     <mass value="1"/>
  82.     <inertia
  83.      ixx="${mass / 12.0 * (width*width + height2*height2)}" ixy="0.0" ixz="0.0"
  84.      iyy="${mass / 12.0 * (height2*height2 + width*width)}" iyz="0.0"
  85.      izz="${mass / 12.0 * (width*width + width*width)}"/>
  86.   </inertial>
  87. </link>
  88.  
  89. </robot>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top