google-deepmind / mujoco_menagerie

A collection of high-quality models for the MuJoCo physics engine, curated by Google DeepMind.
Other
1.45k stars 202 forks source link

Collision Issue in `spot_arm.xml` Model's `arm_link_sh0` Link #73

Closed jc-bao closed 4 months ago

jc-bao commented 4 months ago

Which model is the issue affecting?

spot_arm.xml

What is the issue?

The model's link arm_link_sh0 has a collision with other links.

Is there any additional context you can provide (e.g., a spec sheet or a URDF to show a value mismatch)?

Here is the contact force:

image

As you can see, the arm base has a large contact force, making the arm immovable. By removing the following collision geometries:

<geom class="collision" mesh="arm_link_sh0_base_coll" />
<geom class="collision" mesh="arm_link_sh0_left_motor_coll" />
<geom class="collision" mesh="arm_link_sh0_right_motor_coll" />

The arm can move freely.

kevinzakka commented 4 months ago

@jc-bao I cannot reproduce this locally. We carefully checked and excluded spurious collisions.

What MuJoCo version are you using? Can you load scene.xml with spot_arm.xml without any modification and tell me if you see still observe these large forces?

Here's what I see on my end on Ubuntu with 3.1.6:

screenshot

jc-bao commented 4 months ago

Hi @kevinzakka, I am using 3.1.6 under Ubuntu 22.04. Let me double check the original model and see what's wrong. My modification is to fix the base and only test the diffik in your repo. Thanks for the prompt response!

kevinzakka commented 4 months ago

@jc-bao By "fix base", do you mean removing the freejoint? If the answer is yes, then that explains the behavior you are seeing. The reason is that MuJoCo excludes collisions between parent and child bodies by default, but this exclusion is not applied if the parent is a static body (aka world or dof-less descendant of world).

See Yuval's answer here google-deepmind/mujoco#104 for more context.

TLDR: Add <exclude body1="body" body2="arm_link_sh0"/> to the exclude clause of the XML if you remove the base freejoint.

jc-bao commented 4 months ago

Oh that make sense. I can confirm that the original model works fine. After exclude the contact, it works perfectly. Thanks!

yuvaltassa commented 4 months ago

For future reference, this is documented here

https://mujoco.readthedocs.io/en/3.2.0/overview.html#surprising-collisions