Add asset argument to MjSpec constructors.
PiperOrigin-RevId: 720628689 Change-Id: I189aa34973e58b9fb87951e34cb923d94e081a55
This commit is contained in:
committed by
Copybara-Service
parent
5b330ca19c
commit
0643017346
@@ -749,6 +749,22 @@ class SpecsTest(absltest.TestCase):
|
||||
self.assertEqual(model.nmeshvert, 8)
|
||||
self.assertEqual(spec.assets['cube.obj'], cube)
|
||||
|
||||
xml = """
|
||||
<mujoco model="test">
|
||||
<asset>
|
||||
<mesh name="cube" file="cube.obj"/>
|
||||
</asset>
|
||||
<worldbody>
|
||||
<geom mesh="cube"/>
|
||||
</worldbody>
|
||||
</mujoco>
|
||||
"""
|
||||
assets = {'cube.obj': cube}
|
||||
spec = mujoco.MjSpec.from_string(xml, assets=assets)
|
||||
model = spec.compile()
|
||||
self.assertEqual(model.nmeshvert, 8)
|
||||
self.assertEqual(spec.assets['cube.obj'], cube)
|
||||
|
||||
def test_include(self):
|
||||
included_xml = """
|
||||
<mujoco>
|
||||
|
||||
Reference in New Issue
Block a user