Add frame property to python bindings.

PiperOrigin-RevId: 762452877
Change-Id: I555cec650d04700f6718b4d77a866c821b90685c
This commit is contained in:
Alessio Quaglino
2025-05-23 09:23:28 -07:00
committed by Copybara-Service
parent e44513bee5
commit e389872c7d
2 changed files with 52 additions and 0 deletions
+9
View File
@@ -1069,6 +1069,15 @@ class SpecsTest(absltest.TestCase):
frame = body.to_frame()
np.testing.assert_array_equal(frame.pos, [1, 2, 3])
def test_get_frame(self):
spec = mujoco.MjSpec()
body = spec.worldbody.add_body()
frame = body.add_frame()
geom = body.add_geom()
geom.set_frame(frame)
self.assertIsNotNone(frame)
self.assertIs(geom.frame, frame)
def test_attach_to_frame(self):
parent = mujoco.MjSpec()
parent.assets = {'cube.obj': 'cube_content'}