Add flange / gripper to existing robot model (ur3)
Hello everybody,
I am using the following model description of 6-DOF UR3 robot in this repo: urdf
I have read that it is not recommended to change the original xacro file (ur3.urdf.xacro). Now my goal is to add a simple cylindrical flange to the end of the kinematic chain by creating an own urdf.
flange.urdf.xacro looks like this:
<?xml version="1.0"?>
<!-- xacro flange for rg6 -->
<robot name="flange" xmlns:xacro="http://wiki.ros.org/xacro">
<xacro:macro name="flange" params="prefix">
<!-- flange joint and link -->
<joint name="${prefix}flange_joint" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0"/>
<parent link="${prefix}ee_link"/>
<child link="${prefix}flange_link"/>
</joint>
<link name="${prefix}flange_link">
<visual>
<origin rpy="0 0 0" xyz="0 0 0.05"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur3/visual/flange.stl" scale="0.001 0.001 0.001"/>
</geometry>
<material name="White">
<color rgba="1.0 1.0 1.0 1.0"/>
</material>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0.05"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur3/visual/flange.stl" scale="0.001 0.001 0.001"/>
</geometry>
</collision>
<inertial>
<mass value="0.2"/>
<inertia ixx="1" ixy="0.0" ixz="0.0" iyy="1" iyz="0.0" izz="1"/>
</inertial>
</link>
</xacro:macro>
</robot>
I have included the corresponding joint for the extended move_group in ur3.srdf and added the tag to ur3_robot.urdf.xacro:
<xacro:include filename="$(find ur_description)/urdf/flange.urdf.xacro" />
Launching the config of ur3 in Rviz does not show the flange and brings up following messages in the terminal:
[ERROR] Joint 'flange_joint' declared as part of group state 'home' is not known to the URDF
[WARN] Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world'
[INFO] No root/virtual joint specified in SRDF. Assuming fixed joint
[WARN] Kinematics solver doesn't support #attempts anymore, but only a timeout.
Can anybody give me a detailled instruction of how to handle this issue. I think my way of thinking is not correct at this point or something significant is missing. I have found Example: adding an end-effector to a robot, but it could not help me.
indeed.
But the same best-practice applies to the package itself. You appear to have copied your new mesh into the
ur_description
package.That's essentially the same as editing "the original xacro file".