Raise not implemented for frictionloss for now. #1344

PiperOrigin-RevId: 602453907
Change-Id: I0ea506b54f96c4fadc0f29f9ed0a21b0b6a7e5d9
This commit is contained in:
Baruch Tabanpour
2024-01-29 11:44:38 -08:00
committed by Copybara-Service
parent 4fe16dd44e
commit 508669a9f2
4 changed files with 8 additions and 1 deletions
+1
View File
@@ -31,6 +31,7 @@ MJX
8. Added ``mjx.ray`` which mirrors :ref:`mj_ray` for planes, spheres, capsules, boxes, and meshes.
9. Added ``mjx.is_sparse`` which mirrors :ref:`mj_isSparse` and ``mjx.full_m`` which mirrors :ref:`mj_fullM`.
10. Added support for specifying sparse or dense mass matrices via :ref:`option-jacobian`.
11. Raise a not implemented error when nonzero frictionloss is present. Fixes :github:issue:`1344`.
Python bindings
^^^^^^^^^^^^^^^
+3
View File
@@ -164,6 +164,9 @@ def _validate(m: mujoco.MjModel):
if f & m.opt.enableflags:
warnings.warn(f'Ignoring enable flag {f.name}.')
if not np.allclose(m.dof_frictionloss, 0):
raise NotImplementedError('dof_frictionloss is not implemented.')
@overload
def device_put(value: mujoco.MjData) -> types.Data:
+3
View File
@@ -109,6 +109,9 @@ def put_model(m: mujoco.MjModel, device=None) -> types.Model:
f'{[mj_type(m) for m in missing]} not supported'
)
if not np.allclose(m.dof_frictionloss, 0):
raise NotImplementedError('dof_frictionloss is not implemented.')
opt = _put_option(m.opt, device=device)
stat = _put_statistic(m.stat, device=device)
@@ -12,7 +12,7 @@
<default>
<default class="right_hand">
<mesh scale="0.001 0.001 0.001"/>
<joint axis="1 0 0" damping="0.05" armature="0.0002" frictionloss="0.01"/>
<joint axis="1 0 0" damping="0.05" armature="0.0002"/>
<position forcerange="-1 1"/>
<default class="wrist">