Add crude broadphase impl.
PiperOrigin-RevId: 611643683 Change-Id: Id7816dadd7e9f1b8855268b815353c61540c4e0c
This commit is contained in:
committed by
Copybara-Service
parent
8f1ea05bef
commit
419be4c605
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user