ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

include/combine xacro UR5e + custom gripper [closed]

asked 2022-07-15 14:05:56 -0500

release_Jolly gravatar image

updated 2022-07-19 02:43:47 -0500

Hello all!

I am not new to ROS but I have never had to edit a robot model before (luckily). I downloaded th UR5e robot files from this repository. In ur_description/urdf I can find basically 3 main files:

  1. ur5e.xacro
  2. ur5e_macro.xacro
  3. ur_macro

From what is my few knowledge in URDF/xacros etc, the 1st includes the 2nd that includes the 3rd. In this way we can have one file to describe all the UR version joints/links and with the other two we pass the proper parameters base on the robot we choose (UR3, UR3e, UR5, etc).

I created a xacro file that describes my gripper (actually just two cilynders) and I would like to have a final model of the robot that also integrates the gripper. My final goal is to create a moveit package with the UR5e robot + my gripper in order to move the manipulator keeping the collision check plugin.

my xacro file look like this:

<?xml version="1.0"?>
<robot name="ur5e_robot" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <xacro:macro name="camera_with_gripper" params="">
    <joint name="camera_support_joint" type="fixed">
      <!-- The parent link must be read from the robot model it is attached to. -->
      <parent link="tool0"/>
      <child link="camera_support"/>
      <!-- The tool is directly attached to the flange. -->
      <origin rpy="0 0 0" xyz="0 0 0.004"/>
    </joint>
    <link name="camera_support">
      <visual>
        <geometry>
          <!-- The path to the visual meshes in the package. -->
          <cylinder length="0.008" radius="0.0865"/>
        </geometry>
        <material name="blue">
          <color rgba="0 0 0.8 1"/>
        </material>
      </visual>
      <collision>
        <geometry>
          <!-- The path to the collision meshes in the package. -->
          <cylinder length="0.018" radius="0.0965"/>
        </geometry>
      </collision>
    </link>
    <!-- Create a fixed joint with a parameterized name. -->
    <joint name="mygripper_joint" type="fixed">
      <!-- The parent link must be read from the robot model it is attached to. -->
      <parent link="camera_support"/>
      <child link="mygripper"/>
      <!-- The tool is directly attached to the flange. -->
      <origin rpy="0 0 0" xyz="0 0 0.094"/>
    </joint>
    <link name="mygripper">
      <visual>
        <geometry>
          <!-- The path to the visual meshes in the package. -->
          <cylinder length="0.18" radius="0.0375"/>
        </geometry>
      </visual>
      <collision>
        <geometry>
          <!-- The path to the collision meshes in the package. -->
          <cylinder length="0.18" radius="0.0375"/>
        </geometry>
      </collision>
    </link>
    <!-- TCP frame -->
    <joint name="tcp_joint" type="fixed">
      <origin rpy="0 0 0" xyz="0 0 0.09"/>
      <parent link="mygripper"/>
      <child link="tcp"/>
    </joint>
    <link name="tcp"/>
  </xacro:macro>
  <xacro:camera_with_gripper />
</robot>
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by release_Jolly
close date 2022-07-19 08:27:07.239938

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-07-19 08:26:23 -0500

release_Jolly gravatar image

I solved my problem. I crated this file:

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="ur5e_cg">

    <xacro:include filename="$(find ur_description)/urdf/inc/ur5e_macro.xacro" />
    <xacro:include filename="$(find urdf_tutorial)/urdf/ur5e_camera_gripper.xacro" />

    <xacro:ur5e_robot prefix="" />
    <xacro:camera_with_gripper />
</robot>

and I deleted second to last line (<xacro:camera_with_gripper/>) from the file I posted in the question. I hope this may be useful for other people.

edit flag offensive delete link more

Comments

Hi, i`m new to ROS and have the same problem than you had. Can you please explain for a beginner what you did? Is it necessary to use specific file names? Where to locate these files? What other files are needed? etc.

LucB gravatar image LucB  ( 2022-10-31 06:48:33 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-07-15 14:05:56 -0500

Seen: 100 times

Last updated: Jul 19 '22