Add mujoco.MjSpec.MjStruct type.

PiperOrigin-RevId: 723552214
Change-Id: I8ecb43b4025b532ba8b48e15c9c6a2b350293d20
This commit is contained in:
Alessio Quaglino
2025-02-05 10:00:40 -08:00
committed by Copybara-Service
parent fe16c27555
commit dec7b661c1
3 changed files with 49 additions and 9 deletions
+7
View File
@@ -17,6 +17,7 @@
import inspect
import os
import textwrap
import typing
import zipfile
from absl.testing import absltest
@@ -32,6 +33,12 @@ def get_linenumber():
class SpecsTest(absltest.TestCase):
def test_typing(self):
spec = mujoco.MjSpec()
self.assertIsInstance(spec, mujoco.MjSpec)
self.assertIsInstance(spec.worldbody, mujoco.MjsBody)
self.assertIsInstance(spec.worldbody, typing.get_args(mujoco.MjStruct))
def test_basic(self):
# Create a spec.
spec = mujoco.MjSpec()