[Feature]: Preserve MJCF geom group through import
What feature or enhancement are you proposing?
Preserve the MJCF group attribute on imported geoms, exposed as a read-only RigidGeom.group / RigidVisGeom.group, defaulting to None for geoms parsed from anything other than MJCF.
The value is already parsed. utils/mjcf.py puts "group": mj_geom.group[0] into the geom info dict, reads it once to decide which collision geoms get a visual twin (if g_info["group"] in (0, 1, 2)), and then drops it, because _add_geom and _add_vgeom have no parameter to receive it. No new parsing is required — only threading the existing value through to the geom object.
This adds no simulation behaviour. The group would be passive data, unrelated to contype/conaffinity, which remain the fields that filter collision pairs.
Motivation
group is a standard MJCF authoring convention for tagging a geom's role, and MuJoCo treats it as first-class: the reference viewer exposes per-group visibility toggles, so authors routinely rely on the group to control what is shown. It is common for a model to carry several categories of geom that are deliberately non-colliding — reference shapes, decorative or annotation geometry, and shapes used only by external tooling — distinguished from one another solely by group.
Genesis classifies geoms with is_col = contype or conaffinity, so every geom with both zeroed is imported as visual. Since all visual geoms therefore have contype == conaffinity == 0 by construction, group is the only field that could distinguish them from one another. It is discarded during import, so the distinction becomes unrecoverable from Genesis's own representation: the geoms arrive as one flat, undifferentiated list, and no property of the imported model can separate them again.
The practical consequence is that tooling built on Genesis cannot reproduce behaviour that MuJoCo offers directly — selectively displaying or operating on geoms by their authored role — even though the model carries exactly the information required.
Recovering the group outside Genesis means compiling the model a second time with MuJoCo, which risks diverging from the model Genesis actually simulates, since Genesis rewrites assetdir/meshdir, injects default armature/solref, and folds into the contype/conaffinity masks before compiling. Parsing the XML directly is worse, as it would miss class inheritance and resolution.
Potential Benefit
Round-trip fidelity: authored MJCF metadata survives the import rather than being silently lost. Lets tooling filter or display geoms by authored role, matching MuJoCo's own viewer behaviour. Recovers the only remaining discriminator between visual geoms, which are otherwise indistinguishable by construction. No simulation behaviour change, and negligible cost — one optional int per geom. No impact on URDF, MSH, or primitive entities, which have no such concept.
What is the expected outcome of the implementation work?
RigidGeom.group returns the MJCF geom group of the geom, or None when it has none. RigidVisGeom.group likewise, including for visual twins generated from collision geoms. Geoms parsed from URDF, MSH, or primitive entities report None. No change to any simulation result. Test asserting the group survives import for a fixture covering both a group set explicitly on the geom and one inherited through a class chain.
Additional information
No response
Source: Genesis-Embodied-AI/genesis-world