unilab.base.entity.EntityData¶
- class unilab.base.entity.EntityData[source]¶
Bases:
objectBackend host adapter plus Torch cold tables owned by the entity facade.
The remaining host getters and default arrays are explicit adapter internals; Manager runtime reads use packed Torch views or cached tensor tables. Control writes publish into the same actuator layout without touching backend-private state.
- Parameters:
backend (
SimBackend)entity_name (
str)backend_type (
str)state_read_cache (
_EntityStateReadCache)
Methods
__init__(backend, *, root_body_ids, ...)default_joint_pos(device)Return the cold-path default joint positions as a cached tensor.
default_joint_vel(device)Return the cold-path default joint velocities as a cached tensor.
default_root_state(device)Return the immutable default root state as a cached tensor table.
gravity_vec_w(device)Return the immutable world-frame gravity vector as a cached tensor table.
set_encoder_bias_tensor(values)Publish a device-resident encoder-bias transaction.
soft_joint_pos_limits(device)Return the cold-path joint position limits as a cached tensor.
update_encoder_bias_tensor_mask(reset_mask, ...)Merge full-width authoritative encoder-bias values by mask.
write_ctrl(values[, env_ids, actuator_ids])Write entity-local actuator controls into the env-owned control buffer.
Attributes
Return the authoritative actuator control buffer without copying.
Mutable per-environment joint encoder bias used by position actions.
Return the mutable encoder bias as a same-storage Torch view.
- __init__(backend, *, root_body_ids, joint_pos_ids, joint_qpos_ids, joint_vel_ids, default_root_state, default_root_state_error, default_joint_pos, default_joint_vel, soft_joint_pos_limits, gravity_vec_w, body_ids, root_body_name, body_names, actuator_ids, actuator_ctrl_range, control_buffer, entity_name, backend_type, state_read_cache)[source]¶
- Parameters:
backend (
SimBackend)entity_name (
str)backend_type (
str)state_read_cache (
_EntityStateReadCache)
- gravity_vec_w(device)[source]¶
Return the immutable world-frame gravity vector as a cached tensor table.
- default_root_state(device)[source]¶
Return the immutable default root state as a cached tensor table.
- default_joint_vel(device)[source]¶
Return the cold-path default joint velocities as a cached tensor.
- soft_joint_pos_limits(device)[source]¶
Return the cold-path joint position limits as a cached tensor.
- property encoder_bias: ndarray¶
Mutable per-environment joint encoder bias used by position actions.
- set_encoder_bias_tensor(values)[source]¶
Publish a device-resident encoder-bias transaction.
The tensor becomes the authoritative same-storage carrier. This is an explicit public tensor boundary for DEVICE_RESIDENT owners; CPU/HOST bridge owners retain the existing NumPy carrier.
- update_encoder_bias_tensor_mask(reset_mask, columns, values)[source]¶
Merge full-width authoritative encoder-bias values by mask.
- property control_buffer: ndarray | Tensor | None¶
Return the authoritative actuator control buffer without copying.
- write_ctrl(values, env_ids=None, *, actuator_ids=None)[source]¶
Write entity-local actuator controls into the env-owned control buffer.
This is an in-memory scene write, analogous to the pinned manager runtime’s entity target buffers. Physics remains owned by
TorchEnv/SimBackend; this method never steps or calls a backend-private API.