Skip to content

Discover task grasp pairs and reuse external grasp labels - #1314

Merged
matafela merged 4 commits into
mainfrom
codex/task-grasp-labels
Dec 1, 2026
Merged

matafela merged 4 commits into
mainfrom
codex/task-grasp-labels

Conversation

@matafela

Copy link
Copy Markdown
Collaborator

Description

Prepare the grasp labels that a Task Program will actually request, then pass their output directory to run-task. The labeler resolves the mounted hand, target mesh, effective hand commands and TCP adjustments for each sampled grasp call. Repeated requests with the same physical configuration share one file. During planning, a missing external label identifies the required key.

task=embodichain/extensions/tasks/configs/tasks/manipulation/repeated_pick_place/task.franka.yaml
labels=outputs/grasp-labeling/franka_cube
python -m embodichain label-grasps --gym-config "$task" --output-dir "$labels"
python -m embodichain run-task --gym_config "$task" --grasp-labels "$labels" \
  --no-headless --renderer fast-rt --max_episodes 1 --filter-dataset-saving

Migration from #1297

  • Remove --pair HAND OBJECT AFFORDANCE from affordance precompute-grasp-cache. The deployment selects its own grasp pairs.
  • Standalone labeling accepts the original --config and --output arguments and optional --gripper-urdf and --mesh overrides. Both label-grasps and affordance label-grasps reach the same handler.
  • The standalone CLI now writes grasp_pose, an [N, 4, 4] tensor of TCP poses in the object frame. Add --save-evidence when consuming opening widths, trial records or sampled object placements, including when resuming an already completed full-evidence output. The Python labeling API and built-in deployment cache retain their full-evidence defaults.
  • Use --gym-config and --output-dir to generate files named with the planning keys for external run-task lookup. Runtime accepts the output directory or individual keyed files and transforms each selected pose with the current object pose.

Type of change

Validation

  • In py312_bk, ran the CobotMagic cup example twice with the same seed and reduced sampling budget, once with its YAML assets and once with explicit URDF and mesh paths plus --save-evidence. Both runs accepted 31 of 32 trials and produced identical object-local TCP tensors. The top-level alias resumed the completed output successfully.
  • Ran the Franka example above. The three pick-ups reused all 12,176 external labels and the task saved one episode.
  • The reduced-budget TianjiMarvin handover run discovered both hands, wrote two different files and loaded both from the same external directory. Each file had 28 poses. The planner exhausted its attempts without a feasible pickup-side grasp in that sample. Separate regression coverage exercises two hands with two different target meshes.
  • Ran 200 focused CLI, labeling, task, planner and deployment regression tests and 42 project-context tests. Re-ran all 64 root CLI, affordance CLI and standalone label tests after registering the top-level alias. Covered matching keys, repeated calls, old full-evidence files, fixed grasps and missing external labels.

Checklist

  • Ran black . with Black 26.10.1.
  • Updated the grasp example and task usage guides, and revised environment and motion-planning context for the new workflow. Context validation passed.
  • Ran python docs/scripts/check_api_docs.py with 5,078 of 5,078 exports documented.
  • Reviewed new and existing coverage against the CLI, file format and runtime lookup contracts.
  • Reviewed dependencies. The implementation uses the existing runtime libraries.

@matafela matafela added atomic-skill Atomic Skill goals, planning, execution, verification and recovery. breaking User-visible incompatible changes requiring migration. feature New user-facing capabilities. task-program Task Program language, semantics, compiler, runtime and integration contracts. labels Nov 30, 2026
@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The reviewed changes appear safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

The PR discovers the grasp labels requested by a Task Program and lets planning reuse external keyed files.

  • Labeling follows a deployment’s sampled-grasp calls and writes keyed pose files.
  • Planning loads matching grasp poses from supplied keyed files.
  • Standalone labeling saves object-local poses by default and offers full evidence on request.
  • Cohort jobs record and verify external grasp labels when they resume.

No new actionable issues were found in the changes since the previous review. No previous review threads were supplied.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Task deployment] --> B[Select Task Program]
  B --> C[Discover sampled grasp calls]
  C --> D[Resolve hand, target, commands and TCP]
  D --> E[Write keyed grasp files]
  E --> F[Run task with external labels]
  F --> G[Find matching physical key]
  G --> H[Transform poses using current object pose]
  F --> I[Cohort records file hashes]
  I --> J[Resume restores and checks labels]
Loading

Reviews (2) · Last reviewed commit: "fix(expansion): pin and restore external..." · Reviewed by Greptile

@yuecideng yuecideng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three P2 findings are attached inline. The 60 focused CPU tests passed, and targeted CPU probes confirmed the three cases.

Comment thread embodichain/lab/scripts/run_task.py Resolved
@matafela
matafela merged commit f3b68e1 into main Dec 1, 2026
14 checks passed
@matafela
matafela deleted the codex/task-grasp-labels branch December 1, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

atomic-skill Atomic Skill goals, planning, execution, verification and recovery. breaking User-visible incompatible changes requiring migration. feature New user-facing capabilities. task-program Task Program language, semantics, compiler, runtime and integration contracts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants