USD decoder ignores the NewtonSceneAPI fallback for newton:timeStepsPerSecond
Los mantenedores suelen responder en 6 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
Línea de trabajo
Empieza por la comprobación en plugin/usd_decoder/usd_decoder.cc, alrededor de las líneas 498–504, donde el decodificador lee newton:timeStepsPerSecond. Comprueba cómo se obtiene el valor resuelto del atributo USD cuando el atributo no está authored y NewtonSceneAPI proporciona su valor alternativo. El objetivo se cumple cuando el decodificador usa 1000 pasos por segundo en ese caso, lo que da un paso de tiempo de 0,001 s; verifica los casos authored y no authored.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
My setup
MuJoCo 4.0.1 with mujoco-usd 4.0.1 from PyPI (usd-core 25.11, newton-usd-schemas 0.7.0), Python 3.12, Linux x86_64. The same code is on main.
What's happening? What did you expect?
The decoder applies newton:timeStepsPerSecond only when it has an authored value. When it is not authored, the timestep stays at MuJoCo's default of 0.002 s.
NewtonSceneAPI defines a fallback of 1000 for newton:timeStepsPerSecond, so an applied NewtonSceneAPI with no authored value describes a 0.001 s timestep. Authoring tools commonly skip values that match the schema fallback, and mujoco-usd-converter does, so any MJCF with <option timestep="0.001"/> decodes at 0.002 s and simulates at twice the intended step. In MuJoCo Menagerie this affects google_barkour_v0, google_barkour_vb, and trossen_wxai.
I expected the decoder to use the resolved value of newton:timeStepsPerSecond whenever NewtonSceneAPI is applied, so the unauthored attribute gives 0.001 s. The other two Newton scene attributes the decoder reads have fallbacks that already agree with MuJoCo (newton:maxSolverIterations = -1 means the solver default, and newton:gravityEnabled = true), so only the timestep is affected.
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
NewtonSceneAPIandMjcSceneAPIapplied to the physics scene asmujoco-usd-converterdoes, with and without an authorednewton:timeStepsPerSecond = 1000. - In both cases the attribute resolves to 1000, but the timestep is 0.002 unless the value is authored.
authored=False: newton:timeStepsPerSecond resolves to 1000, timestep=0.002
authored=True: newton:timeStepsPerSecond resolves to 1000, timestep=0.001
Minimal model for reproduction
The stage is built in memory by the code below. The equivalent MJCF:
minimal XML
<mujoco>
<option timestep="0.001"/>
<worldbody>
<body>
<freejoint/>
<geom type="box" size="1 1 1"/>
</body>
</worldbody>
</mujoco>
Code required for reproduction
import mujoco
from pxr import Usd, UsdGeom, UsdPhysics
def make_stage(author: 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("NewtonSceneAPI")
scene.ApplyAPI("MjcSceneAPI")
# Equivalent to <option timestep="0.001"/>. 1000 Hz is the NewtonSceneAPI fallback.
if author:
scene.GetAttribute("newton:timeStepsPerSecond").Set(1000)
body = UsdGeom.Cube.Define(stage, "/World/box")
UsdPhysics.RigidBodyAPI.Apply(body.GetPrim())
UsdPhysics.CollisionAPI.Apply(body.GetPrim())
return stage
for author in (False, True):
stage = make_stage(author)
attr = stage.GetPrimAtPath("/PhysicsScene").GetAttribute("newton:timeStepsPerSecond")
spec = mujoco.MjSpec.from_file(stage.GetRootLayer().identifier)
model = spec.compile()
print(f"authored={author}: newton:timeStepsPerSecond resolves to {attr.Get()}, timestep={model.opt.timestep}")
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
-
`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
-
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
google-deepmind/mujoco#3931 ·
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 ·