unisim.backend.isaacgym.tensor

SDK-free CUDA IPC arena helpers for the IsaacGym tensor lifecycle.

This module is intentionally Python 3.8 compatible and importable by file path in the isolated IsaacGym worker. It must not import unisim, IsaacGym, or any other optional runtime at module import time.

Functions

quat_mul(torch, left_wxyz, right_wxyz)

Multiply broadcast-compatible wxyz quaternions without package imports.

quat_rotate(torch, quat_wxyz, vectors)

Rotate broadcast-compatible wxyz-quaternion vectors without package imports.

quat_rotate_inverse(torch, quat_wxyz, vectors)

Rotate vectors into wxyz-quaternion frames without package imports.

torch_from_cuda_pointer(torch_module, ...[, ...])

Return a Torch tensor view without Torch private storage IPC.

Classes

IsaacGymCudaIpcArenaLayout

Fixed offsets for canonical arrays and the selected-reset prefix.

IsaacGymCudaIpcPlan

Control-only pipe plus stable device arenas for IsaacGym hot tensors.

IsaacGymCudaIpcWorkerRuntime

Project native IsaacGym tensors into the host-owned CUDA IPC arena.

RawCudaTensorView

A one-shot DLPack producer for a raw CUDA arena allocation.

RawCudaViewToken

One release callback associated with a stable raw-pointer view.

class unisim.backend.isaacgym.tensor.IsaacGymCudaIpcArenaLayout[source]

Bases: object

Fixed offsets for canonical arrays and the selected-reset prefix.

Parameters:
  • num_envs (int)

  • nq (int)

  • nv (int)

  • nu (int)

  • nbody (int)

  • reset_indices_offset (int)

  • reset_qpos_offset (int)

  • reset_qvel_offset (int)

  • reset_kp_offset (int)

  • reset_kd_offset (int)

  • qpos_offset (int)

  • qvel_offset (int)

  • ctrl_offset (int)

  • body_state_offset (int)

  • sensor_state_offset (int)

  • size_bytes (int)

num_envs: int
nq: int
nv: int
nu: int
nbody: int
reset_indices_offset: int
reset_qpos_offset: int
reset_qvel_offset: int
reset_kp_offset: int
reset_kd_offset: int
qpos_offset: int
qvel_offset: int
ctrl_offset: int
body_state_offset: int
sensor_state_offset: int
size_bytes: int
classmethod create(num_envs, nq, nv, nu, nbody=0)[source]
Parameters:
Return type:

IsaacGymCudaIpcArenaLayout

property qpos_shape: Tuple[int, int]
property qvel_shape: Tuple[int, int]
property ctrl_shape: Tuple[int, int]
property body_state_shape: Tuple[int, int, int]
property sensor_state_shape: Tuple[int, int, int]
property reset_indices_shape: Tuple[int]
property reset_qpos_shape: Tuple[int, int]
property reset_qvel_shape: Tuple[int, int]
property reset_kp_shape: Tuple[int, int]
property reset_kd_shape: Tuple[int, int]
to_wire()[source]
Return type:

Dict[str, Any]

classmethod from_wire(payload)[source]
Parameters:

payload (Dict[str, Any])

Return type:

IsaacGymCudaIpcArenaLayout

__init__(num_envs, nq, nv, nu, nbody, reset_indices_offset, reset_qpos_offset, reset_qvel_offset, reset_kp_offset, reset_kd_offset, qpos_offset, qvel_offset, ctrl_offset, body_state_offset, sensor_state_offset, size_bytes)
Parameters:
  • num_envs (int)

  • nq (int)

  • nv (int)

  • nu (int)

  • nbody (int)

  • reset_indices_offset (int)

  • reset_qpos_offset (int)

  • reset_qvel_offset (int)

  • reset_kp_offset (int)

  • reset_kd_offset (int)

  • qpos_offset (int)

  • qvel_offset (int)

  • ctrl_offset (int)

  • body_state_offset (int)

  • sensor_state_offset (int)

  • size_bytes (int)

class unisim.backend.isaacgym.tensor.IsaacGymCudaIpcWorkerRuntime[source]

Bases: object

Project native IsaacGym tensors into the host-owned CUDA IPC arena.

Parameters:
__init__(context, cuda_ipc, transport, memory, control_event, state_event, reset_event, arena, sensor_specs=None)[source]
Parameters:
publish_state(*, record_event=True)[source]
Parameters:

record_event (bool)

Return type:

None

set_state(payload)[source]
Parameters:

payload (Dict[str, Any])

Return type:

Dict[str, Any]

step(payload)[source]
Parameters:

payload (Dict[str, Any])

Return type:

Dict[str, Any]

close()[source]
Return type:

None

class unisim.backend.isaacgym.tensor.RawCudaViewToken[source]

Bases: object

One release callback associated with a stable raw-pointer view.

Parameters:

on_release (Optional[Callable[[], None]])

__init__(on_release=None)[source]
Parameters:

on_release (Optional[Callable[[], None]])

release()[source]
Return type:

None

class unisim.backend.isaacgym.tensor.RawCudaTensorView[source]

Bases: object

A one-shot DLPack producer for a raw CUDA arena allocation.

Parameters:
__init__(pointer, shape, device_index, dtype='float32', token=None)[source]
Parameters:
unisim.backend.isaacgym.tensor.quat_mul(torch, left_wxyz, right_wxyz)[source]

Multiply broadcast-compatible wxyz quaternions without package imports.

Parameters:
  • torch (Any)

  • left_wxyz (Any)

  • right_wxyz (Any)

Return type:

Any

unisim.backend.isaacgym.tensor.quat_rotate(torch, quat_wxyz, vectors)[source]

Rotate broadcast-compatible wxyz-quaternion vectors without package imports.

Parameters:
Return type:

Any

unisim.backend.isaacgym.tensor.quat_rotate_inverse(torch, quat_wxyz, vectors)[source]

Rotate vectors into wxyz-quaternion frames without package imports.

Parameters:
Return type:

Any

unisim.backend.isaacgym.tensor.torch_from_cuda_pointer(torch_module, pointer, shape, device_index, dtype='float32', token=None)[source]

Return a Torch tensor view without Torch private storage IPC.

Parameters:
Return type:

Any

class unisim.backend.isaacgym.tensor.IsaacGymCudaIpcPlan[source]

Bases: object

Control-only pipe plus stable device arenas for IsaacGym hot tensors.

Parameters:
__init__(backend, device=None)[source]
Parameters:
get_state_views(fields=None)[source]
Parameters:

fields (Optional[Sequence[str]])

Return type:

Dict[str, Any]

get_sensor_view(name)[source]
Parameters:

name (str)

Return type:

Any

write_control(ctrl)[source]
Parameters:

ctrl (Any)

Return type:

None

step(nsteps=1)[source]
Parameters:

nsteps (int)

Return type:

Dict[str, Dict[str, float]]

step_tensor(ctrl, nsteps=1)[source]
Parameters:
Return type:

Dict[str, Dict[str, float]]

set_state_tensor(env_indices, qpos, qvel, randomization=None)[source]
Parameters:
Return type:

Dict[str, Dict[str, float]]

close()[source]
Return type:

None