unilab.tasks.manipulation.allegro_inhand.grasp_gen

Manager-Based terms and registry owner for Allegro grasp generation.

Classes

AllegroGraspQualityMetric

Expose one cached quality condition through the community MetricsManager.

AllegroGraspQualityTermination

Reject timeouts that are not stable multi-finger grasps.

AllegroGraspRecorder

Collect successful timeout states and persist the canonical 23-D cache.

class unilab.tasks.manipulation.allegro_inhand.grasp_gen.AllegroGraspQualityMetric[source]

Bases: ManagerTermBase

Expose one cached quality condition through the community MetricsManager.

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (_GraspEnv)

__init__(cfg, env)[source]
Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (_GraspEnv)

class unilab.tasks.manipulation.allegro_inhand.grasp_gen.AllegroGraspQualityTermination[source]

Bases: ManagerTermBase

Reject timeouts that are not stable multi-finger grasps.

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (_GraspEnv)

__init__(cfg, env)[source]
Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (_GraspEnv)

property last_counter: int
reset(env_ids=None)[source]

Resets the manager term.

Parameters:

env_ids (ndarray | slice | None)

Return type:

None

class unilab.tasks.manipulation.allegro_inhand.grasp_gen.AllegroGraspRecorder[source]

Bases: RecorderTerm

Collect successful timeout states and persist the canonical 23-D cache.

Parameters:
  • cfg (RecorderTermCfg)

  • env (_GraspEnv)

__init__(cfg, env)[source]
Parameters:
  • cfg (RecorderTermCfg)

  • env (_GraspEnv)

property total_saved_grasps: int
property cache_saved: bool
property output_path: Path
record_pre_reset(env_ids)[source]

Called in env.step() before terminated environments are reset.

What is available:

  • obs_buf contains the observation from the end of the previous step (the input the agent used to choose the terminal action). It does not contain the post-action terminal observation (the state reached after applying the action), which is never computed for resetting environments.

  • action_manager.action contains the action applied during this step. This is the correct terminal action. It will be zeroed for these environments by _reset_idx immediately after this hook returns, so capture it here if you need it later.

  • reward_buf contains the reward for this terminal step.

  • reset_terminated and reset_time_outs reflect why each environment is resetting.

This is the right hook to record the terminal transition (obs_t, action_t, reward_t, done=True) for each resetting environment.

Parameters:

env_ids (ndarray) – Indices of environments that are about to be reset.

Return type:

None

close()[source]

Called when the environment closes.

Release file handles, flush write buffers, or finalize output here.

Return type:

None