unilab.base.entity.EntityScene¶
- class unilab.base.entity.EntityScene[source]¶
-
Read-only name-addressable collection of backend-bound entities.
- Parameters:
Methods
__init__(entities, backend[, ...])bind_gravity_write(*, term_name)Bind immutable backend gravity for a reset event on the cold path.
bind_gravity_write_tensor(*, term_name, device)Bind immutable backend gravity as a tensor table for tensor events.
bind_sensor_data(names)Bind existing backend sensors for a manager term on the cold path.
compile_tensor_reads(device, specs)Compile the scene's only packed tensor read layout for one device.
env_origins(device)Return immutable per-environment origins as a cached tensor table.
from_scene_cfg(cfg, backend[, ...])get(k[,d])items()keys()reset_to_default(reset_mask, *, term_name)Stage a full-scene default state in the active mask transaction.
values()write_gravity_to_sim(values, env_ids, *, ...)Stage gravity values in the exactly-once reset transaction.
Attributes
Pinned community-style read-only entity mapping.
- classmethod from_scene_cfg(cfg, backend, control_buffer=None, *, reset_state=None, default_qpos=None)[source]¶
- Parameters:
cfg (
SceneCfg)backend (
SimBackend)reset_state (
ResetStateTransaction|None)
- Return type:
- compile_tensor_reads(device, specs)[source]¶
Compile the scene’s only packed tensor read layout for one device.
HOST_BRIDGEexecution aggregates every entity’s sensors and canonical body views into one publicTensorIOSpec, so a read phase performs one H2D transfer.DEVICE_RESIDENTexecution keeps stable backend views but exposes the same phase API; manager terms therefore do not branch on the backend topology.- Parameters:
specs (
Sequence[SceneTensorReadSpec])
- Return type:
- reset_to_default(reset_mask, *, term_name)[source]¶
Stage a full-scene default state in the active mask transaction.
- bind_gravity_write(*, term_name)[source]¶
Bind immutable backend gravity for a reset event on the cold path.
- bind_gravity_write_tensor(*, term_name, device)[source]¶
Bind immutable backend gravity as a tensor table for tensor events.
- get(k[, d]) D[k] if k in D, else d. d defaults to None.¶
- items() a set-like object providing a view on D's items¶
- keys() a set-like object providing a view on D's keys¶
- values() an object providing a view on D's values¶
- write_gravity_to_sim(values, env_ids, *, term_name)[source]¶
Stage gravity values in the exactly-once reset transaction.
- bind_sensor_data(names)[source]¶
Bind existing backend sensors for a manager term on the cold path.
The returned view owns the backend-specific reader. Terms retain that view and only call
SensorView.read()while stepping, so the scene facade never exposes a backend model, data object, or native handle.