I have a urdf file,urdf of UR5 robot and added a prismatic joint to the end of 6th joint of the robot with the "prismatic_joint" tag (By copying other joints and links)
<joint name="wrist_2_joint" type="revolute">
<parent link="wrist_1_link" />
<child link="wrist_2_link" />
<origin rpy="0.0 0.0 0.0" xyz="0.0 0.093 0.0" />
<axis xyz="0 0 1" />
<limit effort="28.0" lower="-6.2831853071" upper="6.2831853071" velocity="3.2" />
<dynamics damping="0.0" friction="0.0" />
</joint>
<link name="wrist_2_link">
<visual>
<geometry>
<mesh filename="package://ur_description/meshes/ur5/visual/wrist2.dae" />
</geometry>
<material name="LightGrey">
<color rgba="0.7 0.7 0.7 1.0" />
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://ur_description/meshes/ur5/collision/wrist2.stl" />
</geometry>
</collision>
<inertial>
<mass value="1.219" />
<origin rpy="0 0 0" xyz="0.0 0.0 0.0" />
<inertia ixx="0.111172755531" ixy="0.0" ixz="0.0" iyy="0.111172755531" iyz="0.0" izz="0.21942" />
</inertial>
</link>
<joint name="wrist_3_joint" type="revolute">
<parent link="wrist_2_link" />
<child link="wrist_3_link" />
<origin rpy="0.0 0.0 0.0" xyz="0.0 0.0 0.09465" />
<axis xyz="0 1 0" />
<limit effort="28.0" lower="-6.2831853071" upper="6.2831853071" velocity="3.2" />
<dynamics damping="0.0" friction="0.0" />
</joint>
<link name="wrist_3_link">
<visual>
<geometry>
<mesh filename="package://ur_description/meshes/ur5/visual/wrist3.dae" />
</geometry>
<material name="LightGrey">
<color rgba="0.7 0.7 0.7 1.0" />
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://ur_description/meshes/ur5/collision/wrist3.stl" />
</geometry>
</collision>
<inertial>
<mass value="0.1879" />
<origin rpy="0 0 0" xyz="0.0 0.0 0.0" />
<inertia ixx="0.0171364731454" ixy="0.0" ixz="0.0" iyy="0.0171364731454" iyz="0.0" izz="0.033822" />
</inertial>
</link>
<!-- I added this section-->
<joint name="prismatic_joint" type="prismatic">
<parent link="wrist_3_link" />
<child link="prismatic_link" />
<origin rpy="0.0 0.0 0.0" xyz="0.0 0.0 0.09465" />
<axis xyz="0 0 1" />
<limit effort="28.0" lower="-6.2831853071" upper="6.2831853071" velocity="3.2" />
<dynamics damping="0.0" friction="0.0" />
</joint>
<link name="prismatic_link">
<visual>
<geometry>
<mesh filename="package://ur_description/meshes/ur5/visual/wrist3.dae" />
</geometry>
<material name="LightGrey">
<color rgba="0.7 0.7 0.7 1.0" />
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://ur_description/meshes/ur5/collision/wrist3.stl" />
</geometry>
</collision>
<inertial>
<mass value="0.1879" />
<origin rpy="0 0 0" xyz="0.0 0.0 0.0" />
<inertia ixx="0.0171364731454" ixy="0.0" ixz="0.0" iyy="0.0171364731454" iyz="0.0" izz="0.033822" />
</inertial>
</link>
Even though I am not sure if it is correct, I tried it on a inverse kinematic solver library. It seems somehow working. But I would like to resize the prismatic joint length. In the inverse kinematic solver, the prismatic joint size was too high as below:
Did I add the joint correctly? What else should I add to resize the prismatic joint?