Add crude broadphase impl.

PiperOrigin-RevId: 611643683
Change-Id: Id7816dadd7e9f1b8855268b815353c61540c4e0c
This commit is contained in:
Baruch Tabanpour
2024-02-29 17:11:30 -08:00
committed by Copybara-Service
parent 8f1ea05bef
commit 419be4c605
10 changed files with 130 additions and 31 deletions
+10
View File
@@ -199,3 +199,13 @@ def local_to_global(
pos = world_pos + math.rotate(local_pos, world_quat)
mat = math.quat_to_mat(math.quat_mul(world_quat, local_quat))
return pos, mat
def get_custom_numeric(m: Union[Model, mujoco.MjModel], name: str) -> float:
"""Returns a custom numeric given an MjModel or mjx.Model."""
for i in range(m.nnumeric):
name_ = m.names[m.name_numericadr[i] :].decode('utf-8').split('\x00', 1)[0]
if name_ == name:
return m.numeric_data[m.numeric_adr[i]]
return -1