0
$\begingroup$

Rosanswers logo

I am trying to update warthog description, by attaching three universal robot arms(2 UR5, 1 UR3). I am following the second approach pointed here. I was succesfull in adding all the robot descriptions needed. But UR arm breaks which actually is included later. In the following example:

  <xacro:include filename="$(find mbs_description)/urdf/accessories/arms/right_ur_arm.urdf.xacro" />
  <xacro:if value="$(optenv WARTHOG_RIGHT_ARM 0)">
    <joint name="right_arm_joint" type="fixed">
      <origin xyz="0 0 -0.025" rpy="0 0 0" />
      <parent link="right_arm_mount_link"/>
      <child link="right_arm/base_link" />
    </joint>
  </xacro:if>

  <xacro:include filename="$(find mbs_description)/urdf/accessories/arms/left_ur_arm.urdf.xacro" />
  <xacro:if value="$(optenv WARTHOG_LEFT_ARM 0)">
    <joint name="left_arm_joint" type="fixed">
      <origin xyz="0 0 -0.025" rpy="0 0 0" />
      <parent link="left_arm_mount_link"/>
      <child link="left_arm/base_link" />
    </joint>
  </xacro:if>
  
  <xacro:include filename="$(find mbs_description)/urdf/accessories/arms/center_ur_arm.urdf.xacro" />
  <xacro:if value="$(optenv WARTHOG_CENTER_ARM 0)">
    <joint name="center_arm_joint" type="fixed">
      <origin xyz="0 0 -0.025" rpy="0 0 3.1415" />
      <parent link="center_arm_mount_link"/>
      <child link="center_arm/base_link" />
    </joint>
  </xacro:if>

Here I have added right and left (both UR5e) and than center(UR3), so the arm in the center breaks its joints and goes to the length of UR5e.

And if I take the center arm at the top like here:

<xacro:include filename="$(find mbs_description)/urdf/accessories/arms/center_ur_arm.urdf.xacro" />
  <xacro:if value="$(optenv WARTHOG_CENTER_ARM 0)">
    <joint name="center_arm_joint" type="fixed">
      <origin xyz="0 0 -0.025" rpy="0 0 3.1415" />
      <parent link="center_arm_mount_link"/>
      <child link="center_arm/base_link" />
    </joint>
  </xacro:if>
  
  <xacro:include filename="$(find mbs_description)/urdf/accessories/arms/right_ur_arm.urdf.xacro" />
  <xacro:if value="$(optenv WARTHOG_RIGHT_ARM 0)">
    <joint name="right_arm_joint" type="fixed">
      <origin xyz="0 0 -0.025" rpy="0 0 0" />
      <parent link="right_arm_mount_link"/>
      <child link="right_arm/base_link" />
    </joint>
  </xacro:if>

  <xacro:include filename="$(find mbs_description)/urdf/accessories/arms/left_ur_arm.urdf.xacro" />
  <xacro:if value="$(optenv WARTHOG_LEFT_ARM 0)">
    <joint name="left_arm_joint" type="fixed">
      <origin xyz="0 0 -0.025" rpy="0 0 0" />
      <parent link="left_arm_mount_link"/>
      <child link="left_arm/base_link" />
    </joint>
  </xacro:if>

Now center arm will be fine but both right and left will shrink to the length of center arm i.e. UR3.

I am not able to sort out this issue, can anyone have an insight on the problem.

Note:

The robot descriptions UR5e and UR3 are the same as on the official supported repo

Note: The same issue is raised on Warthog's github and Universal Robot's repo repo as currently I don't know where the problem could be.

UR3 affected

UR5e affected


Originally posted by Tahir M. on ROS Answers with karma: 213 on 2020-07-16

Post score: 0


Original comments

Comment by gvdhoorn on 2020-08-05:
Finally: please refrain from cross-posting to three different places at the same time.

As evidenced by your post on the CP tracker, this leads to split discussions and potentially wasted effort.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I was including macros in top level xacro and than include them in another file. Due to this essentially the last one was overwriting the values. So at the end changing variables for xacro:include solved the issue.

The issue can be recreated by the steps described here.

Note: I was able to solve the issue by a discussion here.


Originally posted by Tahir M. with karma: 213 on 2020-08-05

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by gvdhoorn on 2020-08-05:\

I was including macros in top level xacro and than include them in another file.

to be more precise: you included top-level files in other top-level files. This essentially leads to a situation where you have multiple definitions of the same content, which results in the last one to 'overwrite' the previous two.

That was why the last arm 'included' was the one which configured things like link-lengths.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.