unisim.backend.isaacgym.scene_worker.SceneWorker

class unisim.backend.isaacgym.scene_worker.SceneWorker[source]

Bases: object

Own one native scene, public/native maps and pending indexed writes.

Parameters:

Methods

__init__(context, payload)

adopt_initialized_context(context, metadata, ...)

Adopt a cold raw-asset loader's objects into the single scene runtime.

initialize()

physics_state()

Assemble one batched [qpos, qvel, (mocap_pos, mocap_quat)?] block.

refresh()

reset(payload)

stage_fk_overlay_rows(env_ids, qpos_rows, ...)

Overlay exact FK body state for freshly written envs until the first step.

step(payload)

Attributes

projection: Any
__init__(context, payload)[source]
Parameters:
records: list[list[dict[str, Any]]]
assets: list[dict[int, Any]]
control_lower: ndarray | None
control_upper: ndarray | None
pending_roots: dict[int, ndarray]
pending_dofs: dict[int, ndarray]
pending_dof_actors: set[int]
pending_body_fk: dict[int, ndarray] | None
metadata: dict[str, Any]
classmethod adopt_initialized_context(context, metadata, payload, bridge)[source]

Adopt a cold raw-asset loader’s objects into the single scene runtime.

The bridge’s synthetic root and D control columns are compatibility projections, not assertions about the source’s physical joint tree. Native indices below come from Gym, never actor-order arithmetic.

Parameters:
Return type:

SceneWorker

stage_fk_overlay_rows(env_ids, qpos_rows, qvel_rows)[source]

Overlay exact FK body state for freshly written envs until the first step.

Parameters:
  • env_ids (Any)

  • qpos_rows (Any)

  • qvel_rows (Any)

Return type:

None

initialize()[source]
Return type:

dict[str, Any]

refresh()[source]
Return type:

None

physics_state()[source]

Assemble one batched [qpos, qvel, (mocap_pos, mocap_quat)?] block.

The canonical slots already carry MuJoCo-layout public state (wxyz quaternions, link-origin linear velocity, body-frame root angular velocity), so the block is a plain column concat of qpos/qvel plus one pos(3), quat(4) tail per kinematic entity (the composed playback MJCF compiles those roots as mocap bodies, in layout order). Slots are refreshed by every step/reset/attach, and no native state can change between protocol commands, so no re-refresh happens here; the host owns the leading snapshot time column. The reply is raw C-order float32 bytes because NumPy pickle internals are not stable across the host/worker interpreter versions.

Return type:

dict[str, Any]

reset(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]