Advertisement
Guest User

Untitled

a guest
Mar 27th, 2012
732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 5.24 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <robot xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
  3.      xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
  4.      xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
  5.      xmlns:xacro="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" name="myrobot">
  6.  
  7.     <!-- Included URDF Files -->
  8.     <include filename="$(find myrobot_description)/urdf/myrobot_materials.xacro" />
  9.     <include filename="$(find myrobot_description)/urdf/myrobot_constants.xacro" />
  10.     <include filename="$(find myrobot_description)/urdf/myrobot_wheel.xacro" />
  11.  
  12.  
  13.  
  14. <xacro:macro name="myrobot">
  15.         <!-- base_footprint is a fictitious link(frame) that is on the ground right below base_link origin,
  16.             navigation stack depends on this frame -->
  17.         <link name="base_footprint">
  18.             <inertial>
  19.                 <mass value="0.0001" />
  20.                 <origin xyz="0 0 0" />
  21.                 <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
  22.                         iyy="0.0001" iyz="0.0"
  23.                         izz="0.0001" />
  24.             </inertial>
  25.  
  26.             <visual>
  27.                 <origin xyz="0 0 0" rpy="0 0 0" />
  28.                 <geometry>
  29.                     <box size="0.001 0.001 0.001" />
  30.                 </geometry>
  31.                 <material name="Green" />
  32.             </visual>
  33.  
  34.             <collision>
  35.                 <origin xyz="0 0 ${base_size_z/2 + 0.051}" rpy="0 0 0" />
  36.                 <geometry>
  37.                   <box size="0.001 0.001 0.001" />
  38.                 </geometry>
  39.             </collision>
  40.         </link>
  41.  
  42.         <joint name="base_footprint_joint" type="fixed">
  43.             <!-- NB: While you would think this would make it go up, it is oddly reversed.
  44.                 This moves the joint to 0,0,0 where we want it for rviz, etc. -->
  45.             <origin xyz="0 0 ${base_size_z/2 + 0.051}" rpy="0 0 0" />        
  46.             <parent link="base_footprint"/>
  47.             <child link="base_link" />
  48.         </joint>
  49.  
  50.     <link name="base_link">
  51.         <visual>
  52.             <origin rpy="0 0 0" xyz="0 0 0" />
  53.             <geometry>
  54.                 <box size="${base_size_x} ${base_size_y} ${base_size_z}"/>
  55.             </geometry>
  56.             <material name="Grey2" />
  57.         </visual>
  58.         <collision>
  59.             <origin rpy="0 0 0" xyz="0 0 0" />
  60.             <geometry>
  61.                 <box size="${base_size_x} ${base_size_y} ${base_size_z}"/>
  62.             </geometry>
  63.         </collision>
  64.  
  65.             <inertial>
  66.                 <mass value="${body_mass}" />
  67.                 <origin xyz="0 0 0" />
  68.                 <inertia ixx="1.0" ixy="0.0" ixz="0.0"
  69.                         iyy="1.0" iyz="0.0"
  70.                         izz="1.0" />
  71.             </inertial>
  72.  
  73.         <gazebo reference="base_link">
  74.             <material>Gazebo/Gray</material>
  75.             <turnGravityOff>false</turnGravityOff>
  76.         </gazebo>
  77.     </link>
  78.  
  79.     <!-- MACRO INSTANTIATION -->
  80.     <xacro:wheel prefix="front_right" front="1" right="1" />
  81.     <xacro:wheel prefix="front_left" front="1" right="-1" />
  82.     <xacro:wheel prefix="back_right" front="-1" right="1" />
  83.     <xacro:wheel prefix="back_left" front="-1" right="-1" />
  84.  
  85.   <gazebo>
  86.     <controller:myrobot_diffdrive_plugin name="differential_drive_plugin" plugin="libmyrobot_diffdrive_plugin.so">
  87.       <alwaysOn>true</alwaysOn>
  88.       <node_namespace>myrobot_node</node_namespace>
  89.       <front_left_wheel_joint>front_left_wheel_joint</front_left_wheel_joint>
  90.       <front_right_wheel_joint>front_right_wheel_joint</front_right_wheel_joint>
  91.       <back_left_wheel_joint>back_left_wheel_joint</back_left_wheel_joint>
  92.       <back_right_wheel_joint>back_right_wheel_joint</back_right_wheel_joint>
  93.       <wheel_separation>${body_width}</wheel_separation>
  94.       <wheel_diameter>${wheel_diameter}</wheel_diameter>
  95.       <base_geom>base_link_geom_base_link</base_geom>
  96.     <interface:position name="position_iface_0"/>
  97.       <updateRate>100</updateRate>
  98.       <torque>1.0</torque>
  99.     </controller:myrobot_diffdrive_plugin>
  100.    
  101.  
  102.  
  103.             <controller:gazebo_ros_p3d name="p3d_base_controller" plugin="libgazebo_ros_p3d.so">
  104.                 <alwaysOn>true</alwaysOn>
  105.                 <updateRate>100.0</updateRate>
  106.                 <bodyName>base_link</bodyName>
  107.                 <topicName>base_pose_ground_truth</topicName>
  108.                 <gaussianNoise>0.01</gaussianNoise>
  109.                 <frameName>map</frameName>
  110.                 <xyzOffsets>0 0 0</xyzOffsets>
  111.                 <rpyOffsets>0 0 0</rpyOffsets>
  112.                 <interface:position name="p3d_base_position"/>
  113.             </controller:gazebo_ros_p3d>
  114.  
  115.             <canonicalBody>base_footprint</canonicalBody>
  116.  
  117.             <!-- this publishes empty joint_states due to no transmission, but
  118.             triggering robot_state_publisher to publish tf between fixed joints in erratic,
  119.             (e.g. base_laser_link for the base_scan frame) -->
  120.             <controller:gazebo_ros_controller_manager name="gazebo_ros_controller_manager" plugin="libgazebo_ros_controller_manager.so">
  121.                 <alwaysOn>true</alwaysOn>
  122.                 <updateRate>100.0</updateRate>
  123.                 <interface:audio name="gazebo_ros_controller_manager_dummy_iface" />
  124.             </controller:gazebo_ros_controller_manager>
  125.  
  126.   </gazebo>
  127.  
  128. </xacro:macro>
  129.  
  130.     <xacro:myrobot />
  131. </robot>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement