Advertisement
Guest User

Untitled

a guest
May 17th, 2017
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.75 KB | None | 0 0
  1. <?xml version="1.0" ?>
  2. <robot name="navi_robot" xmlns:xacro="http://ros.org/wiki/xacro">
  3.  
  4.  
  5.   <xacro:property name="torso_m" value="10.0"/>
  6.   <xacro:property name="torso_x" value="0.6"/>
  7.   <xacro:property name="torso_y" value="0.4"/>
  8.   <xacro:property name="torso_z" value="0.15"/>
  9.  
  10.   <xacro:property name="caster_m" value="2"/>
  11.   <xacro:property name="caster_r" value="0.1"/>
  12.  
  13.   <xacro:property name="base_m" value="2"/>
  14.   <xacro:property name="base_x" value="0.4"/>
  15.   <xacro:property name="base_y" value="0.1"/>
  16.   <xacro:property name="base_z" value="0.1"/>
  17.  
  18.   <xacro:property name="wheel_m" value="0.4"/>
  19.   <xacro:property name="wheel_rad" value="0.035"/>
  20.   <xacro:property name="wheel_len" value="0.1"/>
  21.  
  22.   <xacro:property name="head_m" value="2"/>
  23.   <xacro:property name="head_rad" value="0.2"/>
  24.  
  25.   <xacro:property name="box_m" value="1"/>
  26.   <xacro:property name="box_l" value="0.08"/>
  27.  
  28.   <xacro:property name="mu1" value="0.9"/>
  29.   <xacro:property name="mu2" value="0.9"/>
  30.   <xacro:property name="kp" value="10000000.0"/>
  31.   <xacro:property name="kd" value="1.0"/>
  32.  
  33.   <xacro:macro name="sphere_inertial" params="radius mass">
  34.     <inertial>
  35.       <mass value="${mass}" />
  36.       <origin xyz="0 0 0" />
  37.       <inertia ixx="${0.4 * mass * radius * radius}" ixy="0.0" ixz="0.0"
  38.               iyy="${0.4 * mass * radius * radius}" iyz="0.0"
  39.               izz="${0.4 * mass * radius * radius}" />
  40.     </inertial>
  41.   </xacro:macro>
  42.  
  43.   <xacro:macro name="cylinder_inertial" params="radius length mass">
  44.     <inertial>
  45.       <mass value="${mass}" />
  46.       <origin xyz="0 0 0" />
  47.       <inertia ixx="${0.0833333 * mass * (3 * radius * radius + length * length)}" ixy="0.0" ixz="0.0"
  48.               iyy="${0.0833333 * mass * (3 * radius * radius + length * length)}" iyz="0.0"
  49.               izz="${0.5 * mass * radius * radius}" />
  50.     </inertial>
  51.   </xacro:macro>
  52.  
  53.   <xacro:macro name="box_inertial" params="x y z mass">
  54.     <inertial>
  55.       <mass value="${mass}" />
  56.       <origin xyz="0 0 0" />
  57.       <inertia ixx="${0.0833333 * mass * (y*y + z*z)}" ixy="0.0" ixz="0.0"
  58.               iyy="${0.0833333 * mass * (x*x + z*z)}" iyz="0.0"
  59.               izz="${0.0833333 * mass * (x*x + y*y)}" />
  60.     </inertial>
  61.   </xacro:macro>
  62.  
  63.   <material name="blue">
  64.     <color rgba="0 0 0.8 1"/>
  65.   </material>
  66.  
  67.   <material name="black">
  68.     <color rgba="0 0 0 1"/>
  69.   </material>
  70.  
  71.   <material name="white">
  72.     <color rgba="1 1 1 1"/>
  73.   </material>
  74.  
  75.   <link name="base_link">
  76.     <visual>
  77.       <geometry>
  78.         <box size="${torso_x} ${torso_y} ${torso_z}"/>
  79.       </geometry>
  80.       <material name="blue"/>
  81.     </visual>
  82.     <collision>
  83.       <geometry>
  84.         <box size="${torso_x} ${torso_y} ${torso_z}"/>
  85.       </geometry>
  86.     </collision>
  87.     <xacro:box_inertial x="${torso_x}" y="${torso_y}" z="${torso_z}" mass="${torso_m}"/>
  88.   </link>
  89.   <gazebo reference="base_link">
  90.     <material>Gazebo/Blue</material>
  91.   </gazebo>
  92.  
  93.   <link name="caster">
  94.     <visual>
  95.       <geometry>
  96.         <sphere radius="${caster_r}"/>
  97.       </geometry>
  98.       <origin rpy="0 0 0" xyz="0 0 0"/>
  99.       <material name="white"/>
  100.     </visual>
  101.     <collision>
  102.       <geometry>
  103.         <sphere radius="${caster_r}"/>
  104.       </geometry>
  105.       <origin rpy="0 0 0" xyz="0 0 0"/>
  106.     </collision>
  107.     <xacro:sphere_inertial radius="${caster_r}" mass="${caster_m}"/>
  108.   </link>
  109.  
  110.   <joint name="base_to_caster" type="continuous">
  111.     <parent link="base_link"/>
  112.     <child link="caster"/>
  113.     <origin xyz="-0.2 0 ${-torso_z*0.5}"/>
  114.     <axis xyz="0 0 1"/>
  115.   </joint>
  116.   <joint name="base_to_caster2" type="continuous">
  117.     <parent link="base_link"/>
  118.     <child link="caster"/>
  119.     <origin xyz="-0.2 0 ${-torso_z*0.5}"/>
  120.     <axis xyz="0 1 0"/>
  121.   </joint>
  122. </robot>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement