USD decoder ignores the NewtonSceneAPI fallback for newton:timeStepsPerSecond
メンテナーはふだん 6 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
調査の方向性
plugin/usd_decoder/usd_decoder.ccの498~504行付近にある、デコーダーがnewton:timeStepsPerSecondを読み取るチェックから始めてください。属性がauthoredされておらず、NewtonSceneAPIがフォールバック値を提供する場合に、解決済みのUSD属性値がどのように取得されるかを確認してください。この場合にデコーダーが毎秒1000ステップを使用し、タイムステップが0.001 sになることを完了条件とします。authoredの場合とauthoredされていない場合の両方を確認してください。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C++
- スター
- 18.3k
- フォーク
- 2.2k
- 平均マージ
- 9日 11時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google-deepmind/mujoco のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google-deepmind/mujoco#3932 ·
メンテナーはふだん 6 日以内に返信
-
`import mujoco.mjx` fails with TypeError when warp-lang is too old対応中かも @moah0911 が 22 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google-deepmind/mujoco#3738 ·
メンテナーはふだん 6 日以内に返信
-
Unity 6.6 support再び着手できるかも @Balint-H が 53 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
google-deepmind/mujoco#3615 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 6 日以内に返信
-
Filament: `filament.ao.bilateral_threshold` and six other model options are ignored since 4.0.1, which changed the default ambient occlusion対応中かも @jeongseok-meta が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
google-deepmind/mujoco#3933 ·
メンテナーはふだん 6 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
google-deepmind/mujoco#3931 ·
メンテナーはふだん 6 日以内に返信
google-deepmind/mujoco の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
maplibre/maplibre-native#5072 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
tenstorrent/tt-umd#4017 ·
メンテナーはふだん 3 日以内に返信
-
difficulty:easy func:gui prio:low type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NatronGitHub/Natron#1538 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
hyprwm/hyprsunset#103 · コメント 1 件 ·