Skip to content

Select physically validated half-turn variants for antipodal grasps - #1325

Merged
matafela merged 7 commits into
mainfrom
codex/validated-antipodal-grasp-symmetry
Dec 3, 2026
Merged

matafela merged 7 commits into
mainfrom
codex/validated-antipodal-grasp-symmetry

Conversation

@matafela

@matafela matafela commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Franka's parallel gripper can reach the same antipodal grasp with either finger on either side of the object. The validated-grasp cache previously stored individual poses, so the planner could only command the recorded orientation even when a half-turn would reduce wrist rotation.

This change adds tcp_symmetry: z_roll_180 to the antipodal generator and enables it for the Franka Panda profile. Labeling rotates about the calibrated TCP's local Z axis and physically tests each orientation independently. Older pose-only files still load as individual validated grasps.

PickUp, AxisAlign, HandOver, CoordinatedPickment, Slide and OpenDoor share the same selection rule. By default, each arm keeps the grasp-quality ordering, checks the skill's waypoints and picks the reachable side closest to its starting TCP orientation. Each skill can retry the other validated side when full trajectory planning fails. PickUp and either role in HandOver can opt into joint-travel selection within a validated pair. HandOver uses pickup_prefer_least_joint_motion_within_pair for the source pickup and receive_prefer_least_joint_motion_within_pair for the receiver. The cross-grasp shortlist from #1324 remains a separate option.

This PR targets feat/least-joint-motion-ik-and-grasp from #1324 so that the diff contains the symmetry changes only.

Type of change

  • Enhancement

Verify in the native simulator window

From the repository root, activate py312 on a machine with a GPU and a desktop display. Generate the paired labels and run one Franka episode:

conda activate py312
task=embodichain/extensions/tasks/configs/tasks/manipulation/repeated_pick_place/task.franka.yaml
labels=outputs/grasp-labeling/franka_cube

python -m embodichain affordance 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

The DexSim window shows three cube pickups alternating with three placements. In the windowed run, each pickup reported 18,414 validated poses (9,207 pairs after half-turn deduplication). After the third placement the episode counter reached 1/1 and the command exited successfully.

To check the selection rule directly, run:

python -m pytest -q tests/sim/atomic_skills/test_actions.py \
  -k 'pick_validated_pair_joint_travel or paired_grasps_retry_an_interior or validated_grasp_replays_a_preferred_side'

An earlier simulator check rotated the initial wrist joint by 180° and observed the opposite side of the same tested pair. The modified-start episode completed its last placement with a temporary 1,600-step budget. The command above uses the deployment’s standard 1,200-step limit.

Validation

  • 886 focused tests passed with GPU tests enabled, covering physical labeling and legacy files, mixed batches, same-pair and shortlist selection, trajectory retries and configured integrations.
  • 42 agent-context tests passed. The static deployment inspector resolved six pick/place segments.
  • Black 26.10.1, git diff --check, the context map check and API coverage (5,078/5,078 exports) passed.

Checklist

  • Ran black ..
  • Updated the repeated-pick-place instructions and the atomic-skill affordance sampling reference.
  • Verified public API documentation coverage.
  • Reviewed the added behavioral coverage and ran the affected tests.

Yuan-Xinyi and others added 3 commits December 2, 2026 13:42
Two choices could send an arm through a large joint swing for a pose it
could reach directly:

- PytorchSolver "nearest" selection folds every multi-start candidate into
  [-pi, pi] before measuring its distance to the seed. On a joint whose
  limits allow more than one turn, a candidate just across +-pi then looks
  almost a turn away, and a flipped-wrist branch can win for nearly the
  same TCP pose. PytorchSolverCfg.ik_wrap_to_seed compares and returns each
  candidate at its whole-turn equivalent nearest the seed (nearest the
  previous waypoint in continuous path selection).
- PickUp keeps the first reachable grasp in cache order and picks the
  half-turn roll variant by TCP rotation error, which cannot tell the two
  variants apart from an upright start pose.
  PickUpOptions.prefer_least_joint_motion ranks the first
  least_motion_candidates reachable grasps, and the roll variant, by IK
  joint travel from the current arm posture (joint_motion_weights); a
  fixed_object_to_eef grasp may be replaced by its half-turn twin.
  HandOverOptions.receive_prefer_least_joint_motion ranks the receiving
  grasp the same way.

All options default off; inactive options are omitted from the Task
Program integration identity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- select_ranked_grasp: rank only the first motion_candidates reachable
  labels by motion cost; labels kept in a larger pool (check_selection
  retries, sampling branches) follow them in cache order, and the motion
  cost is evaluated only for the compared labels.
- PickUp fixed-grasp twin comparison: with approach_along_grasp_axis the
  pre-grasp follows the grasp's TCP +Z (shared by the twin), as the pickup
  does, instead of the configured approach direction.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@matafela matafela added atomic-skill Atomic Skill goals, planning, execution, verification and recovery. enhancement Improvements to existing capabilities; use feature for new capabilities. task-program Task Program language, semantics, compiler, runtime and integration contracts. labels Dec 2, 2026
@matafela
matafela requested a review from yuecideng December 2, 2026 07:37
@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Confidence Score: 3/5RetriggerView in Greptile

[Medium impact] The PR changes grasp selection across several simulated manipulation skills and adds an optional shared IK behavior.

The latest AxisAlign change looks sound, but the two previous benchmark failures remain unresolved and block merging.

FindingsFix All in Codex

  1. P1 OVRTX benchmarks cannot run ▶
  2. P1 Emission check cannot start ▶
Fix with agent prompt
### Issue 1
scripts/benchmark/tech_reports/rendering/platforms/gaussian_splatting/ovrtx_gaussian_benchmark.py:384-386
Selecting `ovrtx` always sends `--capture-output`, but this parser does not accept it. The worker exits before rendering, so every selected cell fails.

Adding the argument alone is insufficient. `run()` must also save every camera’s RGB image and return `capture_output` and `frame_times_ms`, which the parent requires for success.

### Issue 2
scripts/benchmark/tech_reports/rendering/platforms/gaussian_splatting/_isaac_emissive_transport.py:undefined-89
`--verify-isaac-emissive-transport` launches this module with `-m`, but `_render_control()` imports its sibling as a top-level module. The launcher adds the repository root to `PYTHONPATH`, not this package directory. The control process therefore raises `ModuleNotFoundError` before starting Isaac Sim and stops the command before its final report update.

Use `from .isaacsim_gaussian_benchmark import ...`.

```suggestion
    from .isaacsim_gaussian_benchmark import (
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds independently tested half-turn grasp pairs and shares their selection and retry behavior across six skills.

  • Antipodal labels can pair a grasp with its tested local-Z half-turn.
  • Manipulation skills can choose the reachable side of a tested grasp pair.
  • The PyTorch solver can compare IK angles across whole turns near its seed.

No new actionable issues were found in the changes since the previous review. Checks were based on source and test inspection; no simulator run was performed.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Generate calibrated TCP] --> B[Test original and half-turn separately]
    B --> C[Cache successful sides as a group]
    C --> D[Rank groups by grasp quality]
    D --> E[Check waypoint reachability]
    E --> F[Choose a reachable side]
    F --> G[Plan complete arm and hand commands]
    G --> H{Plan succeeds?}
    H -->|Yes| I[Keep accepted commands]
    H -->|No| J{Another tested side available?}
    J -->|Yes| K[Plan the other side]
    K --> L[Merge successful rows at phase boundaries]
    J -->|No| M[Report failed row]
Loading

Reviews (6) · Last reviewed commit: "fix(atomic-skills): preserve AxisAlign g..." · Reviewed by Greptile

@Yuan-Xinyi Yuan-Xinyi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I checked the paired labels against the dual ARX5 RoboTwin scenes from #1324. Physically testing both sides is what our geometric half-turn twin lacked. Two grasp-side cases stay open for that arm; details inline.

@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.

I reviewed this revision against #1324. All 54 focused tests passed, and targeted CPU probes reproduced the four findings below. I recommend addressing the three P2 findings before merging.

Comment on lines +384 to +386
parser.add_argument("--output", type=Path)
parser.add_argument("--sample-output", type=Path)
return parser

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 OVRTX benchmarks cannot run

Selecting ovrtx always sends --capture-output, but this parser does not accept it. The worker exits before rendering, so every selected cell fails.

Adding the argument alone is insufficient. run() must also save every camera’s RGB image and return capture_output and frame_times_ms, which the parent requires for success.

Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/benchmark/tech_reports/rendering/platforms/gaussian_splatting/ovrtx_gaussian_benchmark.py
Line: 384-386

Comment:
**OVRTX benchmarks cannot run**

Selecting `ovrtx` always sends `--capture-output`, but this parser does not accept it. The worker exits before rendering, so every selected cell fails.

Adding the argument alone is insufficient. `run()` must also save every camera’s RGB image and return `capture_output` and `frame_times_ms`, which the parent requires for success.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex Fix in Claude Code

from ...experiments.gaussian_splatting._gaussian_comparison_modes import (
load_relighting_rig,
)
from isaacsim_gaussian_benchmark import (

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Emission check cannot start

--verify-isaac-emissive-transport launches this module with -m, but _render_control() imports its sibling as a top-level module. The launcher adds the repository root to PYTHONPATH, not this package directory. The control process therefore raises ModuleNotFoundError before starting Isaac Sim and stops the command before its final report update.

Use from .isaacsim_gaussian_benchmark import ....

Suggested change
from isaacsim_gaussian_benchmark import (
from .isaacsim_gaussian_benchmark import (
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/benchmark/tech_reports/rendering/platforms/gaussian_splatting/_isaac_emissive_transport.py
Line: 89

Comment:
**Emission check cannot start**

`--verify-isaac-emissive-transport` launches this module with `-m`, but `_render_control()` imports its sibling as a top-level module. The launcher adds the repository root to `PYTHONPATH`, not this package directory. The control process therefore raises `ModuleNotFoundError` before starting Isaac Sim and stops the command before its final report update.

Use `from .isaacsim_gaussian_benchmark import ...`.

```suggestion
    from .isaacsim_gaussian_benchmark import (
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex Fix in Claude Code

@matafela
matafela changed the base branch from feat/least-joint-motion-ik-and-grasp to main December 3, 2026 03:40
@matafela matafela closed this Dec 3, 2026
@matafela matafela reopened this Dec 3, 2026

@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.

One follow-up finding in the AxisAlign trajectory retry.

@matafela
matafela merged commit 41610e5 into main Dec 3, 2026
8 checks passed
@matafela
matafela deleted the codex/validated-antipodal-grasp-symmetry branch December 3, 2026 09:36
Yuan-Xinyi added a commit that referenced this pull request Dec 3, 2026
Main already carries the first two commits of this branch through the
squash merge of #1325, so each conflicted file takes main's version and
only the last commit of this branch (post-lift travel origin, unranked
grasps kept) is reapplied on top.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. enhancement Improvements to existing capabilities; use feature for new 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.

3 participants