unilab.base.entity.EntityScene

class unilab.base.entity.EntityScene[source]

Bases: Mapping[str, Entity]

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_sensor_data(names)

Bind existing backend sensors for a manager term on the cold path.

from_scene_cfg(cfg, backend[, ...])

get(k[,d])

items()

keys()

reset_to_default(env_ids, *, term_name)

Stage a full-scene default state in the active reset transaction.

values()

write_gravity_to_sim(values, env_ids, *, ...)

Stage gravity values in the exactly-once reset transaction.

Attributes

entities

Pinned community-style read-only entity mapping.

env_origins

Read-only per-environment origins; flat UniLab scenes default to zero.

__init__(entities, backend, control_buffer=None, *, reset_state=None, default_qpos=None)[source]
Parameters:
classmethod from_scene_cfg(cfg, backend, control_buffer=None, *, reset_state=None, default_qpos=None)[source]
Parameters:
Return type:

EntityScene

property entities: Mapping[str, Entity]

Pinned community-style read-only entity mapping.

property env_origins: ndarray

Read-only per-environment origins; flat UniLab scenes default to zero.

reset_to_default(env_ids, *, term_name)[source]

Stage a full-scene default state in the active reset transaction.

Parameters:
Return type:

None

bind_gravity_write(*, term_name)[source]

Bind immutable backend gravity for a reset event on the cold path.

Parameters:

term_name (str)

Return type:

ndarray

write_gravity_to_sim(values, env_ids, *, term_name)[source]

Stage gravity values in the exactly-once reset transaction.

Parameters:
Return type:

None

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 BackendSensorView.read() while stepping, so the scene facade never exposes a backend model, data object, or native handle.

Parameters:

names (Sequence[str])

Return type:

BackendSensorView

__getitem__(name)[source]
Parameters:

name (str)

Return type:

Entity

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
__len__()[source]
Return type:

int