unilab.tasks.motion_tracking.common.tensor_state_store

Device-resident robot state reads for tensor motion-tracking owners.

The store consumes only SimBackend public tensor APIs. It owns stable view negotiation and full/selected-row ingestion, while task owners remain responsible for their semantic contracts and downstream finite checks.

Classes

DeviceStateStore

Read qpos/qvel, scalar sensors, and tracked body state on one device.

class unilab.tasks.motion_tracking.common.tensor_state_store.DeviceStateStore[source]

Bases: object

Read qpos/qvel, scalar sensors, and tracked body state on one device.

Parameters:
__init__(*, backend, device, num_envs, joint_qpos_ids, joint_qvel_ids, body_names, body_ids)[source]
Parameters:
qviews()[source]

Return the current backend qpos/qvel views after a full read.

Return type:

tuple[Tensor, Tensor]

read(rows=None)[source]
Parameters:

rows (Tensor | None)

Return type:

None

step_tensor(ctrl, nsteps)[source]

Step through the negotiated packed plan when one is available.

Parameters:
Return type:

dict | None

refresh_named_sensors()[source]

Cross the backend’s named-sensor projection boundary.

DEVICE_RESIDENT adapters may recompute derived projections when a named sensor view is requested. Unlike read(), this method performs no row validation, state-view negotiation, or task-buffer copy.

Return type:

None

apply_reset(reset_mask, qpos, qvel)[source]

Apply a fixed-width reset through the public mask boundary.

Parameters:
Return type:

dict | None

validate_finite()[source]
Return type:

None