0
$\begingroup$

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:enter image description here

Did I add the joint correctly? What else should I add to resize the prismatic joint?

$\endgroup$
5
  • $\begingroup$ 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. $\endgroup$ Commented Oct 25, 2021 at 17:58
  • $\begingroup$ @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? $\endgroup$ Commented Oct 27, 2021 at 17:35
  • $\begingroup$ 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. $\endgroup$ Commented Oct 27, 2021 at 18:02
  • $\begingroup$ @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. $\endgroup$ Commented Oct 27, 2021 at 19:35
  • $\begingroup$ 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. $\endgroup$ Commented Oct 27, 2021 at 20:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.