Skip to content

[MISC] Make collision bitmasks filter local to entity for MJCF morphs.#1499

Merged
duburcqa merged 2 commits intoGenesis-Embodied-AI:mainfrom
duburcqa:mjcf_collision_filter
Aug 5, 2025
Merged

[MISC] Make collision bitmasks filter local to entity for MJCF morphs.#1499
duburcqa merged 2 commits intoGenesis-Embodied-AI:mainfrom
duburcqa:mjcf_collision_filter

Conversation

@duburcqa
Copy link
Collaborator

@duburcqa duburcqa commented Aug 4, 2025

Description

Add extra flag to only apply collision pairs filtering based on contype / conaffinity bitmasks locally (i.e. for geometries associated with the same entity), then enforcing this flag to True for MJCF morphs, False otherwise.

Motivation and Context

The collision bitmasks filters are ill-defined for MJCF, in a sense that they are dynamically generated, based on a the combination of some original bitmasks with an optional set of explicitly excluded collision pairs. Moreover, Mujoco does not allow loading multiple MJCF in the scene, nor does it allow to add additional entities manually afterward. This meanst that contype / conaffinity can be viewed as systemically "local". As a result, it would be error prone to use them to filter collision pairs among different MJCF entities. Still, it is relevant to have the ability to enable cross-entity contype / conaffinity for primitives and meshes, since it is perfectly well-defined in this case, and basically aligns with what is done within MJCF.

How Has This Been / Can This Be Tested?

Running the example script examples/collision/contype.py

Checklist:

  • I read the CONTRIBUTING document.
  • I followed the Submitting Code Changes section of CONTRIBUTING document.
  • I tagged the title correctly (including BUG FIX/FEATURE/MISC/BREAKING)
  • I updated the documentation accordingly or no change is needed.
  • I tested my changes and added instructions on how to test it for reviewers.

@duburcqa duburcqa requested a review from YilingQiao as a code owner August 4, 2025 21:17
@duburcqa duburcqa requested a review from Kashu7100 August 4, 2025 21:17
@duburcqa duburcqa changed the title Make collision bitmask filter local to entity for MJCF morphs. [MISC] Make collision bitmask filter local to entity for MJCF morphs. Aug 4, 2025
@duburcqa duburcqa changed the title [MISC] Make collision bitmask filter local to entity for MJCF morphs. [MISC] Make collision bitmasks filter local to entity for MJCF morphs. Aug 4, 2025
@duburcqa duburcqa enabled auto-merge (squash) August 4, 2025 23:20

Note
----
Genesis currently processes MJCF as if it describing a single entity instead of an actual scene. This means that
Copy link
Collaborator

Choose a reason for hiding this comment

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

"describing" -> "describes"

----
Genesis currently processes MJCF as if it describing a single entity instead of an actual scene. This means that
there is a single gigantic kinematic chain comprising multiple physical kinematic chains connected together using
fee joints. The definition of kinematic chain has been stretched a bit to allow us. In particular, there must be
Copy link
Collaborator

Choose a reason for hiding this comment

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

"connected together using fee joints" -> "connected by free joints"

Copy link
Collaborator

Choose a reason for hiding this comment

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

"to allow us" -> "to allow for this"

----
Genesis currently processes MJCF as if it describing a single entity instead of an actual scene. This means that
there is a single gigantic kinematic chain comprising multiple physical kinematic chains connected together using
fee joints. The definition of kinematic chain has been stretched a bit to allow us. In particular, there must be
Copy link
Collaborator

Choose a reason for hiding this comment

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

"to allow us" -> "to allow for this"

@duburcqa duburcqa disabled auto-merge August 5, 2025 01:08
@duburcqa duburcqa force-pushed the mjcf_collision_filter branch from 6e72d55 to 68ed585 Compare August 5, 2025 01:09
@duburcqa duburcqa merged commit 5d0b452 into Genesis-Embodied-AI:main Aug 5, 2025
17 checks passed
@duburcqa duburcqa deleted the mjcf_collision_filter branch August 5, 2025 15:27
YilingQiao pushed a commit to YilingQiao/Genesis that referenced this pull request Aug 22, 2025
Genesis-Embodied-AI#1499)

* Make collision bitmask filter local to entity for MJCF morphs.
* Fix broken 'RigidSolver.links_info.entity_idx'.
winnieyangwannan pushed a commit to winnieyangwannan/Genesis that referenced this pull request Sep 14, 2025
Genesis-Embodied-AI#1499)

* Make collision bitmask filter local to entity for MJCF morphs.
* Fix broken 'RigidSolver.links_info.entity_idx'.
Kashu7100 pushed a commit to Kashu7100/Genesis that referenced this pull request Jan 26, 2026
Genesis-Embodied-AI#1499)

* Make collision bitmask filter local to entity for MJCF morphs.
* Fix broken 'RigidSolver.links_info.entity_idx'.
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.

3 participants