Expose mjs_resolveOrientation to the Python API.
PiperOrigin-RevId: 762571376 Change-Id: I08d8394b24670c7f102356da4234b17f1ba4e05f
This commit is contained in:
committed by
Copybara-Service
parent
eb6f7dc6b7
commit
7a5b55f57e
@@ -16,6 +16,7 @@
|
||||
|
||||
import gc
|
||||
import inspect
|
||||
import math
|
||||
import os
|
||||
import textwrap
|
||||
import typing
|
||||
@@ -129,6 +130,18 @@ class SpecsTest(absltest.TestCase):
|
||||
""")
|
||||
self.assertEqual(spec.to_xml(), xml)
|
||||
|
||||
def test_resolve_orientation(self):
|
||||
spec = mujoco.MjSpec()
|
||||
body = spec.worldbody.add_body(euler=[0, 0, 90])
|
||||
quat = mujoco.MjSpec.resolve_orientation(
|
||||
degree=spec.compiler.degree,
|
||||
sequence=spec.compiler.eulerseq,
|
||||
orientation=body.alt,
|
||||
)
|
||||
np.testing.assert_array_almost_equal(
|
||||
quat, [math.sqrt(2) / 2, 0, 0, math.sqrt(2) / 2]
|
||||
)
|
||||
|
||||
def test_kwarg(self):
|
||||
# Create a spec.
|
||||
spec = mujoco.MjSpec()
|
||||
|
||||
Reference in New Issue
Block a user