unisim.backend.mjwarp.materialization

Cold-path scene materialization for the independent mjwarp backend.

Functions

materialize_mjwarp_scene(scene, *[, ...])

Resolve a flat/fragments scene before CUDA model upload.

Classes

MjwarpSceneContext

Cold-path scene source and cleanup ownership for one backend instance.

class unisim.backend.mjwarp.materialization.MjwarpSceneContext[source]

Bases: object

Cold-path scene source and cleanup ownership for one backend instance.

Parameters:
source_model_file: str
diagnostic_model_file: str
cleanup_handle: Any | None = None
tracked_body_names: tuple[str, ...] = ()
__init__(source_model_file, diagnostic_model_file, cleanup_handle=None, tracked_body_names=())
Parameters:
unisim.backend.mjwarp.materialization.materialize_mjwarp_scene(scene, *, add_body_sensors=False)[source]

Resolve a flat/fragments scene before CUDA model upload.

Height-field terrain construction is intentionally rejected in the first correctness profile. The rejection happens before model upload so an unsupported owner cannot silently fall back to a different terrain path.

When add_body_sensors is set, world-frame body tracking sensors are injected into the resolved model on the cold path (same helper as the MuJoCo backend) so the host profile can serve body kinematics from its per-step sensor cache without extra device transfers.

Parameters:
  • scene (SceneCfg)

  • add_body_sensors (bool)

Return type:

MjwarpSceneContext