ros-industrial/universal_robot

How is the offical xacro file generated? I am the beginner of learning universal robot with ros and urdf

gavin112-lhy opened this issue · 1 comments

In the real UR10e robot arm, I have added the customize gripper as the tcp and mounted depth camera d435 on the gripper. I can use the offical xacro file and do moving plan by moveit following the toturial and instrution, however, I need to do the simulation of the real robot arm with gripper and camera embegged in boh gazebo and unity envrionment. Practically, I know that need to combine the gripper and camera in SolidWorks of the CAD model before generating the URDF file through SolidWorks URDF plug in. I realize that the offical ur10e xacro file including multiplr layer of oher xacro file, and there is a ur_common.xacro and ur_transmissions.xarco file. How can I conbine those features in ur_common.xacro and ur_transmissions.xarco into the new generated URDF file from Solidworks. I am so sorry for such a long question, thank you.

I can share my experience. you should xacro:include ur10e_macro.xacro, Here is the example snippet:

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

    <xacro:property name="prefix" value=""/> 

    <link name="world" /> <!--The world link is required by Gazebo -->
    
    <xacro:include filename="$(find ur_description)/urdf/inc/ur10e_macro.xacro"/> 
    <xacro:ur10e_robot prefix="${prefix}"/>

    <joint name="world_base_link" type="fixed">
        <origin xyz="0.0 0.0 0.935" rpy="0.0 0.0 ${pi/2}"/>
        <parent link="world"/>
        <child link="${prefix}base_link"/>
    </joint>

    <link name="gripper_coupler">
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <mesh filename="package://csc-591_project/robot_description/meshes/visual/coupler_v.stl"/>
            </geometry>
            <material name="flat_black">
                <color rgba="0.1 0.1 0.1 1.0"/>
            </material>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <mesh filename="package://csc-591_project/robot_description/meshes/collision/coupler_c.stl"/>
            </geometry>
        </collision>
        <inertial>
                <origin xyz="0.0016 0.0026 0.0037" rpy="0.0 0.0 0.0"/>
                <mass value="0.111"/>
                <inertia ixx="6.116e-05" ixy="-2.276e-08" ixz="1.96e-07" iyy="5.203e-05" iyz="7.44e-06" izz="9.976e-05"/>
            </inertial>
    </link>

    <joint name="gripper_coupler_tool0" type="fixed">
        <origin xyz="0.0 0.0 0" rpy="0.0 0.0 ${pi}"/>
        <parent link="${prefix}tool0"/>
        <child link="gripper_coupler"/>
    </joint>

    <xacro:include filename="$(find robotiq_2f_140_gripper_visualization)/urdf/robotiq_arg2f_140_model_macro.xacro" />
    <xacro:robotiq_arg2f_140 prefix=""/>

    <joint name="gripper_gripper_coupler" type="fixed">
        <origin xyz="0.0 0.0 0.011" rpy="0.0 0.0 -${pi/2}"/>
        <parent link="gripper_coupler"/>
        <child link="robotiq_arg2f_base_link"/>
    </joint>
     ...

I hope this helps