include/combine xacro UR5e + custom gripper
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:
- ur5e.xacro
- ur5e_macro.xacro
- 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>
Asked by release_Jolly on 2022-07-15 14:05:56 UTC
Answers
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 (
Asked by release_Jolly on 2022-07-19 08:26:23 UTC
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.
Asked by LucB on 2022-10-31 06:48:33 UTC
Comments