unilab.base.base¶
Classes
Config for the environment |
|
Env-facing play/render capabilities consumed by training entrypoints. |
- class unilab.base.base.EnvPlayCapabilities[source]¶
Bases:
objectEnv-facing play/render capabilities consumed by training entrypoints.
- Parameters:
- __init__(supports_native_interactive_renderer=False, supports_physics_state_playback=False, supports_native_video_capture=False, supports_debug_overlay=False, supports_interactive_debug_overlay=False, supports_mocap_playback=False)¶
- class unilab.base.base.EnvCfg[source]¶
Bases:
objectConfig for the environment
- Parameters:
fixed_model_variants (
FixedModelVariantCatalogCfg|None)sim_dt (
float)ctrl_dt (
float)render_spacing (
float)render_offset_mode (
str)drake_backend_mode (
str)drake_nthread (
int)superdex_num_workers (
int)superdex_execution_mode (
str)superdex_allow_contact_approximation (
bool)newton_capacity_check_steps (
int)newton_use_cuda_graph (
bool)isaacsim_render_width (
int)isaacsim_render_height (
int)isaacsim_tensor_cuda_ipc (
bool)isaacsim_share_friction_materials (
bool)
-
fixed_model_variants:
FixedModelVariantCatalogCfg|None= None¶
- __init__(scene=None, fixed_model_variants=None, sim_dt=0.01, max_episode_seconds=None, ctrl_dt=0.01, render_spacing=1.0, render_offset_mode='grid', drake_backend_mode='batch', drake_nthread=0, superdex_num_workers=0, superdex_execution_mode='batch', superdex_assets_root=None, superdex_effort_limits=None, superdex_allow_contact_approximation=False, motrix_max_iterations=None, cpu_ids=None, mjwarp_nconmax=None, mjwarp_njmax=None, newton_device=None, newton_nconmax=None, newton_njmax=None, newton_capacity_check_steps=1, newton_use_cuda_graph=True, isaacgym_device_id=None, isaacgym_worker_timeout_s=None, genesis_device_id=None, genesis_integrator=None, genesis_constraint_solver=None, genesis_friction_cone=None, genesis_solver_iterations=None, isaacsim_device_id=None, isaacsim_worker_timeout_s=None, isaacsim_render_mode=None, isaacsim_render_width=1280, isaacsim_render_height=720, isaacsim_tensor_cuda_ipc=False, isaacsim_share_friction_materials=False, isaacsim_env_spacing=None)¶
- Parameters:
fixed_model_variants (
FixedModelVariantCatalogCfg|None)sim_dt (
float)ctrl_dt (
float)render_spacing (
float)render_offset_mode (
str)drake_backend_mode (
str)drake_nthread (
int)superdex_num_workers (
int)superdex_execution_mode (
str)superdex_allow_contact_approximation (
bool)newton_capacity_check_steps (
int)newton_use_cuda_graph (
bool)isaacsim_render_width (
int)isaacsim_render_height (
int)isaacsim_tensor_cuda_ipc (
bool)isaacsim_share_friction_materials (
bool)
- class unilab.base.base.ABEnv[source]¶
Bases:
ABC- property play_capabilities: EnvPlayCapabilities¶
Return env-facing play/render capabilities.
- resolve_play_render_plan(*, play_render_mode, play_steps, output_video)[source]¶
Resolve high-level playback mode through the backend contract.
- run_playback(*, initialize, step, num_steps, output_video=None, render_spacing=None, render_offset_mode=None, headless=None, record_video=None, frame_state_getter=None, camera_kwargs=None, debug_overlay_getter=None, on_frame=None)[source]¶
Execute playback through the backend contract.
debug_overlay_getterreturns per-env sequences ofunisim.backend.base.DebugPrimitivewith env-local poses (Nonedisables overlays for the frame).on_frameis an optional(frame_index, frame) -> frame | Nonecallback applied to each recorded frame before it is written to the video.
- run_playback_mode(*, play_render_mode, play_steps, output_video, initialize, step, render_spacing=None, render_offset_mode=None, frame_state_getter=None, camera_kwargs=None, debug_overlay_getter=None, on_frame=None, on_plan=None)[source]¶
Resolve configured playback mode and execute it through the backend contract.
Overlay gating follows the resolved plan mode:
recordplayback requiresplay_capabilities.supports_debug_overlay(backends fail closed otherwise);interactiveplayback requiressupports_interactive_debug_overlay— when the backend lacks it the getter is dropped with a warning so interactive playback still runs without overlays.camera_kwargsis a record/offline camera profile. Some native interactive viewers (for example the Isaac family) fail closed when they receive one because the user owns the camera in the window; in that case the profile is dropped with a warning and playback retried without it, so interactive playback still runs.
- abstract property obs_groups_spec: dict[str, int]¶
Map from observation group name to its dimension.
- abstract step(actions)[source]¶
Step the environment with owner-declared action carrier.
The abstract base stays runtime-neutral. Concrete owners validate the declared carrier; the Torch lifecycle accepts Torch tensors.
- init_play_renderer(render_spacing=None, render_offset_mode=None, *, headless=False, capture=False, width=1280, height=720, camera_kwargs=None)[source]¶
Initialize env-facing playback rendering when supported.
- render(mode='rgb_array')[source]¶
Render the current state;
mode="rgb_array"returns an RGB frame.Convenience wrapper over
init_play_renderer()andcapture_play_video_frame(), gated onplay_capabilities.supports_native_video_capture.
- capture_play_video_frame()[source]¶
Capture one RGB frame through the env-facing video contract.
- Return type:
- get_physics_state_snapshot()[source]¶
Return a physics snapshot for offline playback/video export.
- Return type: