Page 1 of 1

URDF_USE_SELF_COLLISION_EXCLUDE_PARENT issue

Posted: Fri Nov 03, 2017 8:42 pm
by MIT
I'm attempting to use the flag p.URDF_USE_SELF_COLLISION_EXCLUDE_PARENT when loading a URDF via pybullet.

model = p.loadURDF( "model.urdf"), [0, 0, 0.7], [0, 0, 0, 0.7], globalScaling=1.0, flags=p.URDF_USE_SELF_COLLISION_EXCLUDE_PARENT )


However, when doing so self collisions are no longer detected by the mesh being loaded (ie the arms go through the body). Using URDF_USE_SELF_COLLISION works as expected. The URDF is using mesh collision geometry, where the mesh is scaled. As an example:

<link name="root_link">
<inertial>
<origin xyz="0.0248821 0.000103947 -0.0440806" rpy="1.57079632679 0 -1.57079632679"/>
<mass value="5.09143"/>
<inertia ixx="0.0139679" ixy="-5.93488e-06" ixz="-1.55458e-05" iyy="0.0202112" iyz="-0.00170968" izz="0.0249124"/>
</inertial>
<visual>
<origin xyz="-0.0364 0 0.032" rpy="1.57079632679 0 -1.57079632679"/>
<geometry>
<mesh filename="root.stl" scale="0.001 0.001 0.001"/>
</geometry>
<material name="green">
<color rgba="0 1 0 1"/>
</material>
</visual>
<collision>
<origin xyz="-0.0364 0 0.032" rpy="1.57079632679 0 -1.57079632679"/>
<geometry>
<mesh filename="root.stl" scale="0.001 0.001 0.001"/>
</geometry>
</collision>
</link>

The links are correctly parented using joints. Is this a known issue or am I missing something else required to get this flag to work?

Re: URDF_USE_SELF_COLLISION_EXCLUDE_PARENT issue

Posted: Fri Nov 03, 2017 10:02 pm
by MIT
Alright, I'm a step closer. Combining the flags p.URDF_USE_SELF_COLLISION_EXCLUDE_PARENT|p.URDF_USE_INERTIA_FROM_FILE appears to enforce collisions, however it causes the mesh go to crazy as the parent and child appear to interact. Am I combining flags incorrectly here?

Re: URDF_USE_SELF_COLLISION_EXCLUDE_PARENT issue

Posted: Sat Nov 04, 2017 6:55 am
by MIT
Here's the solution I settled on in case someone with similar issues comes across this.

After numerous attempts I was unable to get the URDF_USE_SELF_COLLISION_EXCLUDE_PARENT to work correctly, so I went the route of using the URDF_USE_SELF_COLLISION flag and removing all overlapping collision volumes (basically the connecting collision volumes: the shoulder joint, hip joint, etc). I then used a combination of geometry mesh and capsule collision volumes for the remainder of the ridged bodies (chest, upper arm, etc), making sure that none of the collusion volumes overlapped. Its an approximation, but good enough for my purposes. If I find the time to dig into the source code and figure out what's going on I'll post a follow up answer.