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

How to add tool to URDF for robot to account for it during process

asked 2022-11-03 17:32:01 -0500

Predict gravatar image

updated 2022-11-10 08:26:53 -0500

Please help! I'm trying to add a tool (camera) to the end of the robot so it can take pictures of the object I put beneath it. The problem is, the way the camera is mounted to the robot, I need to set an offset. I'm trying to add the tool to the URDF file but I'm unsure how or where to add it, as well as what to add with it. I'd assume I need to include the origin, the length/width?

I'm using the ABB irb2400 robot. I cannot attach the URDF files since I do not have points but here is a link:

https://github.com/ros-industrial/abb...

In the picture below, the red arrow represents where the camera lens will be facing and the blue arrow represents how/where the puck will connected to the case of the camera. I need to see the offset so that the puck itself isn't facing the object but instead it angles the camera so that it can scan the object. Here is a link to the picture of the robot and "camera" (object I used in place of camera):

https://prnt.sc/hZm2_R8lK4Ny

I'm using ROS Noetic on Ubuntu 20.04

Any help would be appreciated!!!

EDIT -- Adding images after last comment Images added correspond to my last comment:

--> I made a new xacro:macro file with the end effector in it: <robot <a="" href="http://xmlns:xacro="http://ros.org/wiki/xacro%22">xmlns:xacro="http://ros.org/wiki/xacro"> <xacro:include filename="$(find abb_resources)/urdf/common_materials.xacro"> <xacro:include filename="$(find abb_irb2400_support)/urdf/end_effector_macro.xacro"></xacro:include></xacro:include></robot>

<xacro:macro name="abb_irb2400_end_effector" params="prefix">
    <link name="${prefix}tool0"> 
        <visual>
        <origin xyz="0 0 0" rpy="0 0 0"/>
         <geometry>
            <box size="1 1 1" />
         </geometry>
        </visual>
    </link>
</xacro:macro>

</robot>

--> However, I do not think I linked them correctly. There is no box showing up in the RVIZ simulation: image description

--> I have the new xacro:macro inside this URDF folder (attaching github repo so those helping can access it too to hopefully have a better idea how to help): https://github.com/ros-industrial/abb... image description

but I think I linked it wrong? It's in the code above

edit retag flag offensive close merge delete

Comments

Please attach all of your images directly to this question. I've given you sufficient karma to do that.

Note: do not post screenshots of code. That's not needed, as it's all text. Just copy-paste the text.

gvdhoorn gravatar image gvdhoorn  ( 2022-11-09 02:42:49 -0500 )edit

Gotcha, thank you. I edited the original question and attached the images and code. I tried the link you sent about combining the robot and the EEF model. However I'm not sure what package I would need to create for the camera. I really just need the object in there and the program to account for it when moving to the positions.

I still think I linked my new xacro:macro incorrectly, but I could be wrong and it's failing somewhere else. I appreciate all your time and help.

Predict gravatar image Predict  ( 2022-11-10 08:35:26 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-11-04 03:43:39 -0500

nils_iseke gravatar image

updated 2022-11-04 05:53:41 -0500

First of all i would recommend you to go through the tutorials to gain a better understanding of 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.

edit flag offensive delete link more

Comments

Please do not recommend to edit existing files. This question is the ROS 1 version of #q408775 where similar advice was given.

In the case of xacro:macros, there would be no need. It's all meant to be composable.

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.

you need to add a description to the link <link name="${prefix}tool0"/> [..]

don't edit tool0. It's an all-zeros tool frame (ie: the mathematical concept), not a tool attachment link in a urdf/xacro. See this for some more discussion/background (or on the ROS wiki).

gvdhoorn gravatar image gvdhoorn  ( 2022-11-04 03:54:53 -0500 )edit

The offset of the tool can be set via the origin of the following joint.

base_link is the start of the robot model in the xacro:macro.

base is a mapping frame which lets users transform "ROS poses" to the Base frame of ABB robot controllers (which may not be coincident with base_link).

Neither of those frames influence "offset of [the] tool[s]". Could you clarify how you propose changing the base_link-basejoint to influence tool offset?

gvdhoorn gravatar image gvdhoorn  ( 2022-11-04 04:04:22 -0500 )edit

Hi there, thank you for your response! I am not exactly sure how I would influence tool offset. I was hoping once I got the end effector into the URDF that it would fix the issue.

I made a new xacro:macro file with the end effector in it: https://prnt.sc/9Tc0ADJAMzKA

However, I do not think I linked them correctly. There is no box showing up in the RVIZ simulation: https://prnt.sc/IvTU4WBptdfW

I have the new xacro:macro inside this URDF folder https://github.com/ros-industrial/abb...
https://prnt.sc/ieAjQEQ_pNjv but I think I linked it wrong?

With the package part, is that creating the xacro:macros file or something different?

I am very new to this but was kind of thrown into it and this is the last step I need to do. Have been trying to figure this part out for a couple ...(more)

Predict gravatar image Predict  ( 2022-11-08 17:37:57 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-11-03 17:32:01 -0500

Seen: 250 times

Last updated: Nov 10 '22