Make MJX device_put type validation more verbose.

PiperOrigin-RevId: 575050350
Change-Id: I7cab4ee54d462b61e9478dbd58d99bb9fb662daf
This commit is contained in:
Baruch Tabanpour
2023-10-19 17:28:50 -07:00
committed by Copybara-Service
parent dd841c9283
commit e4a9f535a4
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -15,6 +15,7 @@ MJX Bug fixes
1. Fix typos and supported fields in the docs (fixes :github:issue:`1105` and :github:issue:`1106`).
2. Fix bug where mixed `jnt_limited` joints are not being constrained correctly.
3. Make `device_put` type validation more verbose (fixed :github:issue:`1113`).
Version 3.0.0 (October 18, 2023)
--------------------------------
+3 -2
View File
@@ -116,8 +116,9 @@ def _validate(m: mujoco.MjModel):
typs = set(val) if isinstance(val, Iterable) else {val}
unsupported_typs = typs - set(_TYPE_MAP[mj_type])
if unsupported_typs:
raise NotImplementedError(f'{unsupported_typs} not implemented.')
unsupported = [mj_type(t) for t in unsupported_typs]
if unsupported:
raise NotImplementedError(f'{unsupported} not implemented.')
# check condim
if any(dim != 3 for dim in m.geom_condim) or any(