# I would like to add a prismatic joint to the Z axis of the 6th joint of Urdf

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">
<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>
<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>

<joint name="wrist_3_joint" type="revolute">
<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>
<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>

<joint name="prismatic_joint" type="prismatic">
<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>

<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>


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?

• A few issues I see: 1) limits on prismatic joint are +-2Pi. For a prismatic joint this is meters, so you've got a huge range. 2) You reuse the wrist geometry, so visualization will look weird. Why aren't you using Rviz or some other visualization package to visualize the URDF? Then you coudl move each joint individually and see if you've set up the URDF properly. Oct 25 '21 at 17:58
• @andymcevoy I used gazebo and rviz. But I never tried a custom urdf in those programs. I am not sure how to do it. Btw what you mean by wrist geometry? Doesn't it directly added to the end of last joint? Oct 27 '21 at 17:35
• your last two links both use wrist.dae & wrist.stl for the visual and collision geometry. I think you should go through the URDF tutorials to understand exactly what you're putting in the xml. There's also a tutorial on how to launch rviz with your custom URDF. You have a functional URDF... that's why the IK works. There's also drag-and-drop URDF viewers you could use to see what's going on. Oct 27 '21 at 18:02
• @andymcevoy Thank you very much, but I guess meshes or textures doesnt really matter in my case. I just want it to use it for Inverse kinematic solutions. I also will change the joint limits. But do you think the prismatic joint is in the right spot? (I mean on the Z axis of the 6th Joint) Thank you for your answer. Oct 27 '21 at 19:35
• I don't think you gave us enough info to know if it's "in the right spot." You just copied and pasted the last joint, changing only the type. This is why I recommend the vizualizers. But yes, your prismatic joint is moving along the z axis. Whether or not the z-axis is pointed in the diretion you desire I do not know, use a better visualizer and confirm. Oct 27 '21 at 20:45