USD decoder ignores inertiaGroupRange unless both min and max are authored
Los mantenedores suelen responder en 6 días
@blessedefe4real ya está trabajando en esto.
Desde el 19/11/2026.
- #3926 de @blessedefe4real — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
Línea de trabajo
The issue points to the check in plugin/usd_decoder/usd_decoder.cc around lines 866–883; start by reading how it handles authored inertiaGroupRange attributes and their schema fallbacks. Reproduce with the provided Python snippet, comparing the decoded range and body mass when only max is authored versus when both ends are authored. Done means a single authored end is decoded using the other end's resolved default, matching the expected [0, 1] range and 8 kg mass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Intro
Hi!
I work on mujoco-usd-converter, which converts MJCF to OpenUSD with the MjcPhysics schemas, and I check its output with MuJoCo's USD decoder.
My setup
MuJoCo 4.0.1 with mujoco-usd 4.0.1 from PyPI (usd-core 25.11), Python 3.12, Linux x86_64. The same code is in 3.17.0 and on main.
What's happening? What did you expect?
The decoder applies mjc:compiler:inertiaGroupRange:min and mjc:compiler:inertiaGroupRange:max only when both have an authored value. If only one is authored, it warns and ignores both:
WARNING: Only one of inertiaGroupRangeMin and inertiaGroupRangeMax was authored, ignoring both.
An unauthored attribute resolves to its schema fallback, which for these attributes is MuJoCo's default (min = 0, max = 5). So a stage that authors only max = 1 describes inertiagrouprange="0 1", but it decodes as 0 5. That is the natural way to author a range that keeps one default end, such as "0 1" or "0 3", since authoring tools commonly skip values that match the schema fallback. Geoms in groups MuJoCo should exclude from inertia then contribute mass.
I expected the decoder to use the resolved value of each attribute, taking the schema fallback for whichever end is not authored. The other MjcSceneAPI compiler attributes are applied independently whenever each one is authored.
The check is in usd_decoder.cc.
Steps for reproduction
pip install mujoco-usd==4.0.1- Run the code below. It builds the same stage twice, with only
maxauthored and with both ends authored. The body has a 0.2 m box in group 0 (8 kg) and a 0.3 m radius sphere collider in group 2, which is outside the range. - With only
maxauthored, the range decodes as[0, 5]and the body mass is 121.10 kg. Authoring the defaultmin = 0as well gives the expected[0, 1]and 8.00 kg.
WARNING: Only one of inertiaGroupRangeMin and inertiaGroupRangeMax was authored, ignoring both.
min authored=False: inertiagrouprange=[0, 5] body mass=121.10
min authored=True: inertiagrouprange=[0, 1] body mass=8.00
Minimal model for reproduction
The stage is built in memory by the code below. The equivalent MJCF, which compiles to 8 kg:
minimal XML
<mujoco>
<compiler inertiagrouprange="0 1"/>
<worldbody>
<body>
<freejoint/>
<geom type="box" size="0.1 0.1 0.1" group="0"/>
<geom type="sphere" size="0.3" group="2"/>
</body>
</worldbody>
</mujoco>
Code required for reproduction
import mujoco
from pxr import Usd, UsdGeom, UsdPhysics
def make_stage(author_min: bool) -> Usd.Stage:
stage = Usd.Stage.CreateInMemory()
UsdGeom.SetStageMetersPerUnit(stage, 1.0)
UsdGeom.SetStageUpAxis(stage, UsdGeom.Tokens.z)
scene = UsdPhysics.Scene.Define(stage, "/PhysicsScene").GetPrim()
scene.ApplyAPI("MjcSceneAPI")
# Equivalent to <compiler inertiagrouprange="0 1"/>. The min of 0 is the schema default.
scene.GetAttribute("mjc:compiler:inertiaGroupRange:max").Set(1)
if author_min:
scene.GetAttribute("mjc:compiler:inertiaGroupRange:min").Set(0)
body = UsdGeom.Xform.Define(stage, "/World/body").GetPrim()
UsdPhysics.RigidBodyAPI.Apply(body)
# 0.2 m box in group 0: 8 kg at the default density of 1000.
box = UsdGeom.Cube.Define(stage, "/World/body/box")
box.GetSizeAttr().Set(0.2)
UsdPhysics.CollisionAPI.Apply(box.GetPrim())
# 0.3 m radius sphere in group 2, outside the range, so it should not contribute mass.
sphere = UsdGeom.Sphere.Define(stage, "/World/body/sphere")
sphere.GetRadiusAttr().Set(0.3)
UsdPhysics.CollisionAPI.Apply(sphere.GetPrim())
sphere.GetPrim().ApplyAPI("MjcCollisionAPI")
sphere.GetPrim().GetAttribute("mjc:group").Set(2)
return stage
for author_min in (False, True):
stage = make_stage(author_min)
spec = mujoco.MjSpec.from_file(stage.GetRootLayer().identifier)
model = spec.compile()
print(
f"min authored={author_min}: inertiagrouprange={[int(x) for x in spec.compiler.inertiagrouprange]} "
f"body mass={model.body('/World/body').mass[0]:.2f}"
)
Confirmations
- I searched the latest documentation thoroughly before posting.
- I searched previous Issues and Discussions, I am certain this has not been raised before.
- Lenguaje dominante
- C++
- Estrellas
- 18.3k
- Forks
- 2.2k
- Merge medio
- 9 d 11 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google-deepmind/mujoco
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
google-deepmind/mujoco#3932 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
google-deepmind/mujoco#3929 ·
Los mantenedores suelen responder en 6 días
-
`import mujoco.mjx` fails with TypeError when warp-lang is too oldPosiblemente ocupada @moah0911 la tomó hace 22 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
google-deepmind/mujoco#3738 ·
Los mantenedores suelen responder en 6 días
-
Unity 6.6 supportQuizá libre de nuevo @Balint-H la tomó hace 53 días y no hay ningún pull request abierto. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
google-deepmind/mujoco#3615 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 6 días
-
Filament: `filament.ao.bilateral_threshold` and six other model options are ignored since 4.0.1, which changed the default ambient occlusionPosiblemente ocupada @jeongseok-meta la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
google-deepmind/mujoco#3933 ·
Los mantenedores suelen responder en 6 días
Todos los issues de google-deepmind/mujoco
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
maplibre/maplibre-native#5072 ·
Los mantenedores suelen responder en 1 día
-
[UBSan] spawn_simulator passes null child_options.args to uv_spawn (execvp nonnull violation)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
tenstorrent/tt-umd#4017 ·
Los mantenedores suelen responder en 3 días
-
difficulty:easy func:gui prio:low type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NatronGitHub/Natron#1538 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
hyprwm/hyprsunset#103 · 1 comentario ·