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

Revision history [back]

click to hide/show revision 1
initial version

Have a look at the ur.urdf.xacro which is loaded by the launch file view_ur.launch.py. There the xacro ur_macro.xacro is included: <xacro:include filename="$(find ur_description)/urdf/ur_macro.xacro"/>. If you have a look in this file, there you will find the line <link name="${prefix}flange" />. There you can add your custom tool, or e.g. a cylinder, therefore just replace the line by:

<link name="${prefix}flange" >
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="0.3" radius="0.03"/>
            </geometry>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="0.3" radius="0.03"/>
            </geometry>
        </collision>
    </link>

Disclaimer: I did not test the code, there might be a typo, just reach out to me if you are getting stuck.

Have a look at the ur.urdf.xacro which is loaded by the launch file view_ur.launch.py. There the xacro ur_macro.xacro is included: <xacro:include filename="$(find ur_description)/urdf/ur_macro.xacro"/>. If you have a look in this file, there you will find the line <link name="${prefix}flange" />. There you can add your custom tool, or e.g. a cylinder, therefore just replace the line by:

<link name="${prefix}flange" >
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="0.3" radius="0.03"/>
            </geometry>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="0.3" radius="0.03"/>
            </geometry>
        </collision>
    </link>

To further understand the usage of xacro i can recomend you this tutorial

Disclaimer: I did not test the code, there might be a typo, just reach out to me if you are getting stuck.

If you want to add a tool to your robot, there are a few alternatives.

Changing the URDF Have a look at the ur.urdf.xacro which is loaded by the launch file view_ur.launch.py. There the xacro ur_macro.xacro is included: <xacro:include filename="$(find ur_description)/urdf/ur_macro.xacro"/>. If you have a look in this file, there you will find the line <link name="${prefix}flange" />. There you can add your custom tool, or e.g. a cylinder, therefore just replace the line by:

<link name="${prefix}flange" >
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="0.3" radius="0.03"/>
            </geometry>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="0.3" radius="0.03"/>
            </geometry>
        </collision>
    </link>

To further understand the usage of xacro i can recomend you this tutorial

Disclaimer: I did not test the code, there might be a typo, just reach out to me if you are getting stuck.

Adding a tool via rviz In RVIZ click Panels -> MotionPlanning image description

Then you can add a Scene Object, and attach it to the flange.

Adding a tool via code This is described here

If you want to add a tool to your robot, there are a few alternatives.

Changing the URDF

Have a look at the ur.urdf.xacro which is loaded by the launch file view_ur.launch.py. There the xacro ur_macro.xacro is included: <xacro:include filename="$(find ur_description)/urdf/ur_macro.xacro"/>. If you have a look in this file, there you will find the line <link name="${prefix}flange" />. There you can add your custom tool, or e.g. a cylinder, therefore just replace the line by:

<link name="${prefix}flange" >
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="0.3" radius="0.03"/>
            </geometry>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="0.3" radius="0.03"/>
            </geometry>
        </collision>
    </link>

To further understand the usage of xacro i can recomend you this tutorialDisclaimer: I did not test the code, there might be a typo, just reach out to me if you are getting stuck.

Adding a tool via rviz

In RVIZ click Panels -> MotionPlanning image description

Then you can add a Scene Object, and attach it to the flange.

Adding a tool via code

This is described here

If you want to add a tool to your robot, there are a few alternatives.

Changing the URDF

Have a look at the ur.urdf.xacro which is loaded by the launch file view_ur.launch.py. There the xacro ur_macro.xacro is included: <xacro:include filename="$(find ur_description)/urdf/ur_macro.xacro"/>. If you have a look in this file, there you will find the line <link name="${prefix}flange" />. There you can add your custom tool, or e.g. a cylinder, therefore just replace the line by:

<link name="${prefix}flange" >
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="0.3" radius="0.03"/>
            </geometry>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="0.3" radius="0.03"/>
            </geometry>
        </collision>
    </link>

To further understand the usage of xacro i can recomend you this tutorialDisclaimer: I did not test the code, there might be a typo, just reach out to me if you are getting stuck.

Adding a tool via rviz

In RVIZ click Panels -> MotionPlanning image description

Then you can add a Scene Object, and attach it to the flange.

Adding a tool via code

This is described here

If you want to add a tool to your robot, there are a few alternatives.

Changing the URDF

Have a look at Updated the ur.urdf.xacroanswer based on the comments (thanks to gvdhoorn which is loaded by the launch file view_ur.launch.py. There the xacro ur_macro.xacro is included: <xacro:include filename="$(find ur_description)/urdf/ur_macro.xacro"/>. If you have a look in this file, there you will find the line <link name="${prefix}flange" />. There you can add your custom tool, or e.g. a cylinder, therefore just replace the line by:):

<link name="${prefix}flange" >

Create a new package, depend on the packages which provide the parts you'd like to combine, create a new <visual> xacro:macro and combine the robot and <origin xyz="0 0 0" rpy="0 0 0"/> <geometry> <cylinder length="0.3" radius="0.03"/> </geometry> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0"/> <geometry> <cylinder length="0.3" radius="0.03"/> </geometry> </collision> </link>

EEF models together in a new model.

To further understand the usage of xacro i can recomend you this tutorialDisclaimer: I did not test the code, there might be a typo, just reach out to me if you are getting stuck.

Adding a tool via rviz

In RVIZ click Panels -> MotionPlanning image description

Then you can add a Scene Object, and attach it to the flange.

Adding a tool via code

This is described here