Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[urdf] Add capsule collision macro to have capsule description of TALOS links through cylinder and spheres. #8

Open
wants to merge 1 commit into
base: humble-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 72 additions & 26 deletions talos_description/urdf/arm/arm.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<xacro:property name="arm_eps" value="0.02" />


<xacro:macro name="talos_arm" params="name parent side reflect">
<xacro:macro name="talos_arm" params="name parent side reflect using_capsule_collision">
<xacro:unless value="$(arg test)">
<xacro:include filename="$(find talos_description_calibration)/urdf/calibration/arm_${side}.xacro" />
</xacro:unless>
Expand All @@ -51,14 +51,27 @@
<material name="DarkGrey" />
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_1_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
<xacro:if value="${using_capsule_collision}">
<xacro:if value="${side == 'left'}">
<xacro:capsule-collision e1="-0.030119 0.141768 0.0465263" e2="-0.00429634 0.0157203 0.0513477" rad="0.076661652397679497" clen="0.12875612953621868" rpy="1.53256 0.201924 0.194397" mid="-0.0172077 0.0787443 0.048937" />
</xacro:if>
<xacro:if value="${side == 'right'}">
<xacro:capsule-collision e1="-0.030119 -0.141768 0.0465263" e2="-0.00429634 -0.0157203 0.0513477" rad="0.076661652397679497" clen="0.12875612953621868" rpy="-1.53256 0.201924 -0.194397" mid="-0.0172077 -0.0787443 0.048937" />
</xacro:if>
</xacro:if>

<xacro:unless value="${using_capsule_collision}">
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_1_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
</xacro:unless>

</link>


<joint name="${name}_${side}_1_joint" type="revolute">
<parent link="${parent}" />
<child link="${name}_${side}_1_link" />
Expand All @@ -85,13 +98,24 @@
</geometry>
<material name="DarkGrey" />
</visual>
<xacro:if value="${using_capsule_collision}">
<xacro:if value="${side == 'left'}">
<xacro:capsule-collision e1="-8.22104e-05 0.00124357 -0.107621" e2="0.0268691 0.000255834 -0.00293965" rad="0.082464320229024751" clen="0.10809965507805776" rpy="0.00943534 0.251977 0.00119509" mid="0.0133935 0.000749701 -0.0552803" />
</xacro:if>
<xacro:if value="${side == 'right'}">
<xacro:capsule-collision e1="-8.22104e-05 -0.00124357 -0.107621" e2="0.0268691 -0.000255834 -0.00293965" rad="0.082464320229024751" clen="0.10809965507805776" rpy="-0.00943534 0.251977 -0.00119509" mid="0.0133935 -0.000749701 -0.0552803" />
</xacro:if>
</xacro:if>

<xacro:unless value="${using_capsule_collision}">
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_2_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
</xacro:unless>

<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_2_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
</link>

<joint name="${name}_${side}_2_joint" type="revolute">
Expand Down Expand Up @@ -121,12 +145,23 @@
<material name="DarkGrey" />
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_3_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
<xacro:if value="${using_capsule_collision}">
<xacro:if value="${side == 'left'}">
<xacro:capsule-collision e1="0.0012938 0.00577828 -0.203827" e2="0.0206547 0.0332832 -0.277413" rad="0.077010074599207598" clen="0.080908820017687497" rpy="-2.78389 0.241638 -1.1828" mid="0.0109743 0.0195307 -0.24062" />
</xacro:if>
<xacro:if value="${side == 'right'}">
<xacro:capsule-collision e1="0.0012938 -0.00577828 -0.203827" e2="0.0206547 -0.0332832 -0.277413" rad="0.077010074599207598" clen="0.080908820017687497" rpy="2.78389 0.241638 1.1828" mid="0.0109743 -0.0195307 -0.24062" />
</xacro:if>
</xacro:if>
<xacro:unless value="${using_capsule_collision}">
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_3_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
</xacro:unless>

</link>

<joint name="${name}_${side}_3_joint" type="revolute">
Expand Down Expand Up @@ -158,12 +193,23 @@
<material name="DarkGrey" />
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_4_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
<xacro:if value="${using_capsule_collision}">
<xacro:if value="${side == 'left'}">
<xacro:capsule-collision e1="-0.020217 -0.00152238 -0.0600083" e2="-0.000255625 -0.0316283 0.0000811275" rad="0.061638573989565293" clen="0.07011106838940788" rpy="0.464462 0.288704 0.0687292" mid="-0.0102363 -0.0165753 -0.0299636" />
</xacro:if>
<xacro:if value="${side == 'right'}">
<xacro:capsule-collision e1="-0.020217 0.00152238 -0.0600083" e2="-0.000255625 0.0316283 0.0000811275" rad="0.061638573989565293" clen="0.07011106838940788" rpy="-0.464462 0.288704 -0.0687292" mid="-0.0102363 0.0165753 -0.0299636" />
</xacro:if>
</xacro:if>
<xacro:unless value="${using_capsule_collision}">
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_4_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
</xacro:unless>

</link>

<joint name="${name}_${side}_4_joint" type="revolute">
Expand Down Expand Up @@ -218,7 +264,7 @@
<!--************************-->
<!-- WRIST -->
<!--************************-->
<xacro:talos_wrist name="arm" parent="${name}_${side}_4_link" side="${side}" reflect="${reflect}" />
<xacro:talos_wrist name="arm" parent="${name}_${side}_4_link" side="${side}" reflect="${reflect}" using_capsule_collision="${using_capsule_collision}" />

</xacro:macro>

Expand Down
74 changes: 55 additions & 19 deletions talos_description/urdf/arm/wrist.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<xacro:property name="wrist_eps" value="0.02" />


<xacro:macro name="talos_wrist" params="name parent side reflect">
<xacro:macro name="talos_wrist" params="name parent side reflect using_capsule_collision">
<xacro:unless value="$(arg test)">
<xacro:include filename="$(find talos_description_calibration)/urdf/calibration/arm_${side}.xacro" />
</xacro:unless>
Expand All @@ -48,12 +48,24 @@
<material name="LightGrey" />
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_5_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
<xacro:if value="${using_capsule_collision}">
<xacro:if value="${side == 'left'}">
<xacro:capsule-collision e1="-2.13964e-05 0.000999035 0.0358616" e2="0.000145615 0.0012191 0.121451" rad="0.077412213480368891" clen="0.085589949413547098" rpy="-0.00257122 0.0019513 -2.50861e-06" mid="6.21094e-05 0.00110907 0.0786563" />
</xacro:if>
<xacro:if value="${side == 'right'}">
<xacro:capsule-collision e1="-2.13964e-05 -0.000999035 0.0358616" e2="0.000145615 -0.0012191 0.121451" rad="0.077412213480368891" clen="0.085589949413547098" rpy="0.00257122 0.0019513 2.50861e-06" mid="6.21094e-05 -0.00110907 0.0786563" />
</xacro:if>
</xacro:if>

<xacro:unless value="${using_capsule_collision}">
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_5_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
</xacro:unless>

</link>

<joint name="${name}_${side}_5_joint" type="revolute">
Expand Down Expand Up @@ -82,12 +94,24 @@
<material name="LightGrey" />
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_6_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
<xacro:if value="${using_capsule_collision}">
<xacro:if value="${side == 'left'}">
<xacro:capsule-collision e1="3.71733e-07 -0.000248227 -0.00766634" e2="5.46154e-05 -8.61821e-05 0.00107298" rad="0.044402592090813625" clen="0.0087409825962203314" rpy="-0.0185399 0.00620572 -5.75286e-05" mid="2.74936e-05 -0.000167204 -0.00329668" />

</xacro:if>
<xacro:if value="${side == 'right'}">
<xacro:capsule-collision e1="3.71733e-07 0.000248227 -0.00766634" e2="5.46154e-05 8.61821e-05 0.00107298" rad="0.044402592090813625" clen="0.0087409825962203314" rpy="0.0185399 0.00620572 5.75286e-05" mid="2.74936e-05 0.000167204 -0.00329668" />
</xacro:if>
</xacro:if>

<xacro:unless value="${using_capsule_collision}">
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_6_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
</xacro:unless>
</link>

<joint name="${name}_${side}_6_joint" type="revolute">
Expand Down Expand Up @@ -116,12 +140,24 @@
<material name="DarkGrey" />
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_7_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
<xacro:if value="${using_capsule_collision}">
<xacro:if value="${side == 'left'}">
<xacro:capsule-collision e1="-3.67844e-05 -8.9312e-05 -0.0167866" e2="1.80245e-05 -1.49283e-05 -0.0702192" rad="0.048804145966408037" clen="0.05343267786175529" rpy="-3.1402 0.00102576 -1.27005" mid="-9.37996e-06 -5.21201e-05 -0.0435029" />
</xacro:if>
<xacro:if value="${side == 'right'}">
<xacro:capsule-collision e1="-3.67844e-05 8.9312e-05 -0.0167866" e2="1.80245e-05 1.49283e-05 -0.0702192" rad="0.048804145966408037" clen="0.05343267786175529" rpy="3.1402 0.00102576 1.27005" mid="-9.37996e-06 5.21201e-05 -0.0435029" />
</xacro:if>
</xacro:if>

<xacro:unless value="${using_capsule_collision}">
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://talos_description/meshes/arm/arm_7_collision.STL" scale="1 ${reflect} 1"/>
</geometry>
</collision>
</xacro:unless>

</link>

<joint name="${name}_${side}_7_joint" type="revolute">
Expand Down
22 changes: 22 additions & 0 deletions talos_description/urdf/capsule_collision.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<robot xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:macro name="capsule-collision" params="e1 e2 rad clen rpy mid">
<collision>
<origin rpy="${rpy}" xyz="${e1}" />
<geometry>
<sphere radius="${rad}" />
</geometry>
</collision>
<collision>
<origin rpy="${rpy}" xyz="${mid}" />
<geometry>
<cylinder length="${clen}" radius="${rad}" />
</geometry>
</collision>
<collision>
<origin rpy="${rpy}" xyz="${e2}" />
<geometry>
<sphere radius="${rad}" />
</geometry>
</collision>
</xacro:macro>
</robot>
Loading