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

How to add a custom tool to a UR3e - ROS2

asked 2022-10-31 09:51:31 -0500

LucB gravatar image

updated 2022-11-02 04:55:04 -0500

I try to add a tool on my UR3e in order to avoid collision while manipulating. The tool i`m using is a custom designed tool. For now a cube or a cylinder would be enough, so the gripper is not crashing into the arm.

I`m using ROS2 humble with the universal_robots_ros2_driver.

In the UR_ROS2_Description i read already, that it is possible to reuse the description and add a custom description (in my case a zylidner) to it. But i couldn't figure out what files i have to add to my workspace and what to change with them.

Here i saw that a xacro file can combine many description. But i dont know how this files should exactly look like and if there are more requirements to the file like name or location.

Also i saw a Tutorial for ROS1 which should be pretty similar to ROS 2. But as i understood, this works just if you want to create a completely new robot.

Is it a similiar aproach for ROS1 and ROS2? How should the xacro file look like to create a cylinder and place it on the UR3e?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-11-01 06:49:32 -0500

nils_iseke gravatar image

updated 2022-11-04 05:54:56 -0500

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

Changing the URDF

Updated the answer based on the comments (thanks to gvdhoorn):

Create a new package, depend on the packages which provide the parts you'd like to combine, create a new xacro:macro and combine the robot and EEF models together in a new model.

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

edit flag offensive delete link more

Comments

Thanks for your Answer!!

Do you suggest to make these changes here: /opt/ros/humble/share/ur_description/urdf? Because in the UR Description they explain under the headline Creating your own description including this description this:

It is recommended to create a separate ROS package containing this particular description. Inside this description you could also store your robot-specific kinematics parameters file.

But i didn't know what files i need to copy to my workspace. I tried to copy the whole repo but this didn't work.

LucB gravatar image LucB  ( 2022-11-01 08:48:58 -0500 )edit

If i got i right, the script could look like this. Or did i misunderstand something there?

<!-- ROS-Industrial 'flange' frame - attachment point for EEF models -->
<link name="${prefix}flange" />   #i added a `/`. Maybe a typo in your example
        <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>
<joint name="${prefix}wrist_3-flange" type="fixed">
  <parent link="${prefix}wrist_3_link" />
  <child link="${prefix}flange" />
  <origin xyz="0 0 0" rpy="0 ${-pi/2.0} ${-pi/2.0}" />
</joint>

<!-- ROS-Industrial 'tool0' frame - all-zeros tool frame -->
LucB gravatar image LucB  ( 2022-11-01 08:53:58 -0500 )edit

I tried to change it here: /opt/ros/humble/share/ur_description/urdf but i dont have permissions to do that.

LucB gravatar image LucB  ( 2022-11-01 09:02:33 -0500 )edit

It seems that you installed ur_description via apt (as binary). To be able to make changes to the URDF you need to build the package from source, do the following:

  1. Create a workspace
  2. Clone the repo to your workspace
  3. Change the URDF to your needs
  4. Build your workspace

Hope that helps, if you get stuck feel free to reach out.

nils_iseke gravatar image nils_iseke  ( 2022-11-01 14:21:23 -0500 )edit

Yes I installed the binary.

Anyway I have a bad feeling about changing something in the UR Driver Package. I would rather create my own package and change something in there.

As I understand the UR Description Repo this must be possible, right?

But i don't know what files I need from there. Also I dont know if i need to make any more changes than the one you mentioned above to get it running in my own package.

LucB gravatar image LucB  ( 2022-11-01 17:13:41 -0500 )edit

Thanks for updating your answer with some other solutions. I will try it to get it working quick.

But if i want to use it more often i think a change in the URDF would be the best way. Do you think this is only possible, if i make changes in the ur_description package? Or is there also a way to do it in my own workspace?

LucB gravatar image LucB  ( 2022-11-02 04:53:31 -0500 )edit

I've posted a comment under #q408953, which is a similar question.

Anyway I have a bad feeling about changing something in the UR Driver Package. I would rather create my own package and change something in there.

@LucB: your hesitation about editing / copying files is completely correct. With xacro:macros, it should not be needed. Compose things. Don't edit them.

Also: do not edit tool0 nor flange. That's not what they're for. An attachment point is exactly that: a point to attach new things to, not to edit it to add new things. Create new links and attach those using fixedjoints (but not in the same file, create a new file in a new package, see my comment under #q408953).

gvdhoorn gravatar image gvdhoorn  ( 2022-11-04 03:59:20 -0500 )edit

This sounds good.

Do i just need the ur_macro.xacro file in my workspace or do i need anything else from the ur_description package?

And how can i override/add the loaded description which i launch with

 ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur3e robot_ip:=192.168.56.101 launch_rviz:=false initial_joint_controller:=joint_trajectory_controller

ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur3e launch_rviz:=true
LucB gravatar image LucB  ( 2022-11-04 04:12:23 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-10-31 09:51:31 -0500

Seen: 696 times

Last updated: Nov 04 '22