1.将旱枪soildwork文件转换成stl文件,然后导入blender软件中,对焊枪进行等比例缩放,建立焊枪坐标系,让坐标系位于旱枪底部中心。
2.将STL文件加载进xacro文件中
整体xacro文件如下:
<?xml version="1.0"?>
<!--
Project Name: ebot
Created on: 2.10.2020
Author: ROS team
Copyright (c) 2020 eYantra IITB
-->
<robot name="ebot" xmlns:xacro="http://www.ros.org/wiki/xacro">
<!-- ebot arm -->
<xacro:include filename="$(find ur_description)/urdf/common.gazebo.xacro" />
<xacro:include filename="$(find ur_description)/urdf/ur5.urdf.xacro" />
<xacro:ur5_robot prefix="" joint_limited="false" />
<link name="world" />
<!-- 关节属性 -->
<joint name="fixed" type="fixed">
<parent link="world" />
<child link="base_init" />
</joint>
<link name="base_init">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.1 0.1 0.04" />
</geometry>
<material name="White" />
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.1 0.1 0.04" />
</geometry>
</collision>
</link>
<gazebo reference="base_init">
<material>Gazebo/Black</material>
</gazebo>
<joint name="ebot_joint" type="fixed">
<parent link="base_init" />
<child link="base_link" />
<origin xyz="0 0 0.521" rpy="0.0 0.0 0" /> <!--576 height from ground-->
</joint>
<joint name="hp_joint" type="fixed">
<parent link="wrist_3_link" />
<child link="hanq_link" />
<origin xyz="0 0.1 0" rpy="0.0 0.0 0" /> <!--576 height from ground-->
</joint>
<link name="hanq_link">
<visual>
<geometry>
<!--旱枪STL文件位置-->
<mesh filename="package://icl_ur5_setup_description/meshes/33.stl" />
</geometry>
<origin xyz="0 0 0" rpy="-1.57 0 0" />
<material name="black">
<color rgba="1 0.4 0 1" />
</material>
</visual>
</link>
<gazebo reference="hanq_link">
<material>Gazebo/Black</material>
</gazebo>
<joint name="hp2_joint" type="fixed">
<parent link="hanq_link" />
<child link="hanq2_link" />
<origin xyz="0 0.65 0.17 " rpy="0 0.0 0" /> <!--576 height from ground-->
</joint>
<link name="hanq2_link">
<visual>
<origin xyz="0 0 0 " rpy="0 0 0" />
<geometry>
<cylinder length="0.001" radius="0.001" />
</geometry>
<material name="yellow">
<color rgba="10 10 0 1" />
</material>
</visual>
</link>
<gazebo reference="hanq2_link">
<material>Gazebo/Black</material>
</gazebo>
</robot>