Skip to content

Capsule-box collision #135

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

Merged
merged 19 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from 6 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
22 changes: 22 additions & 0 deletions mujoco_warp/_src/collision_driver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,28 @@ class CollisionTest(parameterized.TestCase):
</worldbody>
</mujoco>
""",
"capsule_box_cap": """
<mujoco>
<worldbody>
<geom type="box" pos="0 0 0" size=".5 .4 .9" />
<body pos="0 0 1.5" >
<geom type="capsule" size="0.5 0.8"/>
<freejoint/>
</body>
</worldbody>
</mujoco>
""",
"capsule_box_edge": """
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capsule box is complicated! Is this also testing capsule on box corner? If not, let's add it. Generally speaking, please add a few more fixtures to fully exercise that kernel logic which is pretty complex.

Copy link
Collaborator Author

@camevor camevor Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! I added a two more fixtures (capsule on corner and capsule flat on face -> requires 2 contacts) and more strict contact checking in the test.

<mujoco>
<worldbody>
<geom type="box" pos="0 0 0" size=".5 .4 .9" />
<body pos="0.4 0.2 0.8" euler="0 -40 0" >
<geom type="capsule" size="0.5 0.8"/>
<freejoint/>
</body>
</worldbody>
</mujoco>
""",
}

@parameterized.parameters(_FIXTURES.keys())
Expand Down
Loading