Skip to content

Move the collision geoms to geom group 3 - #22

Merged
T-K-233 merged 1 commit into
mainfrom
fix/collision-geom-group
Oct 2, 2026
Merged

T-K-233 merged 1 commit into
mainfrom
fix/collision-geom-group

Conversation

@T-K-233

@T-K-233 T-K-233 commented Oct 2, 2026

Copy link
Copy Markdown
Member

Summary

The URDF import leaves every collision geom in geom group 0. Group 0 is also the group of the scene's floor. A ray cast that looks for the terrain in group 0 therefore hits the robot too.

lite-motion-tracking's velocity task has such a ray cast. Its foot height scan casts 6 rays down from each sole and keeps the smallest height. When the swing foot passes the stance foot, a ray lands on the stance foot, and the scan reads the gap to its top face instead of the gap to the ground. The foot_clearance reward and the critic's foot_height observation use this reading.

urdf_to_mjcf now moves every collision geom to group 3 (COLLISION_GROUP), as MuJoCo Menagerie and mjlab's G1 do. The geoms keep colliding. Viewers and mjlab's ray sensors see groups 0 to 2 by default, so they no longer see the collision geoms. The visual meshes stay in group 1.

Variant Collision geoms moved
lite 17
lite_pro 17
lite_dummy 12
lite_bimanual 11
lite_biped 26
lite_biped_debug 6

Impact

  • Training: lite-motion-tracking's velocity foot scan sees only the ground. On a trained biped velocity policy (512 training envs), 0.3% of swing-phase readings were too low before: 1.8 cm median, 24 cm at worst, almost all on the other foot. With this change, 0.0% are wrong. lite-motion-tracking needs a lock update (uv lock --upgrade-package lite-description) to pick this up.
  • Viewers: the MuJoCo viewer hides collision geoms by default. Turn on group 3 to show them.
  • Physics: no change. Contacts do not depend on the geom group.

Test plan

  • With the old code, a regeneration of all six MJCFs is byte-identical with MuJoCo 3.6.0, so the generator output is reproducible.
  • With the new code, the group attribute of the 89 collision geoms is the only change. Every other element and attribute is identical.
  • New test test_set_collision_group_moves_collision_geoms_only covers the post-process step.
  • New test test_committed_mjcf_keeps_group_0_for_the_scene loads every committed MJCF and requires each robot collision geom in group 3, and the floor of a *_scene.xml in group 0. It failed on all 8 MJCFs before the regeneration.
  • pytest: 1599 passed, 36 skipped.
  • lite-motion-tracking, with this checkout on PYTHONPATH: all 26 tasks build, and the foot height scan reads 0.0% wrong.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X43rjzmEQRBQHqbFhzEfXC

The URDF import leaves every collision geom in group 0, the group of the
scene's floor. A ray cast that looks for the terrain in group 0, such as
the foot height scan of lite-motion-tracking's velocity task, therefore
hits the robot too: the rays under the swing foot land on the other foot.

urdf_to_mjcf now moves every collision geom to group 3, as MuJoCo
Menagerie and mjlab's G1 do. The geoms keep colliding, but viewers and
mjlab's ray sensors, which see groups 0 to 2 by default, no longer see
them. The visual meshes stay in group 1.

All six MJCFs are regenerated. The group attribute of the 89 collision
geoms is the only change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X43rjzmEQRBQHqbFhzEfXC
@T-K-233
T-K-233 merged commit 0f2b033 into main Oct 2, 2026
2 checks passed
@T-K-233
T-K-233 deleted the fix/collision-geom-group branch October 2, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant