Skip to content

Add a physical grasp validation and generalization benchmark - #1252

Open
yuecideng wants to merge 21 commits into
mainfrom
codex/physical-grasp-benchmark
Open

yuecideng wants to merge 21 commits into
mainfrom
codex/physical-grasp-benchmark

Conversation

@yuecideng

@yuecideng yuecideng commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

Expose main’s physical grasp validator through the benchmark CLI and evaluate ranked grasp poses across rigid objects and parallel-jaw grippers. The existing CoffeeCup benchmark measures candidate generation and selection. These new commands measure whether a selected pose can pick up the object, keep it off the table and retain it during transport.

Run the grasp benchmark

Run from the repository root with CUDA and the simulation dependencies active (conda activate py312_bk on the benchmark machine). The DexTrove commands use the local download directory containing categories/. Replace that path if the dataset is stored elsewhere.

1. Run the desktop subset

Evaluate the 24 tabletop objects with all seven grippers, one gripper–object pair at a time. A full batch tests the first 512 ranked grasp poses simultaneously in 512 independent arenas, with one candidate per arena.

python -m embodichain benchmark grasp-pose-generator run \
  --suite embodichain/extensions/benchmarks/grasp_pose_generator/suite.yaml \
  --headless --resume \
  --output outputs/benchmarks/grasp-desk-512

For generated candidates, the runner settles the object and samples its mesh in one arena, then sizes the validation scene to the number of pending poses. A pair with 17 pending poses uses 17 arenas. Zero candidates skip physical validation. To lower the memory budget, set --num-envs N. This keeps the 512-candidate budget and reuses the smaller scene across batches. Any padding in its final batch is excluded from counts and scoring.

2. Run the full downloaded DexTrove benchmark

Evaluate every compatible downloaded object with each of the seven grippers using the same candidate and arena limits. Each command writes report.md and report.json under its output directory.

python -m embodichain benchmark grasp-pose-generator run \
  --dextrove-root /home/oem/projects/temp_dextorve_subset \
  --headless --resume \
  --output outputs/benchmarks/grasp-dextrove-512

Design

Inputs and execution

  • validate takes a single dynamic rigid-body configuration, a catalog gripper and a ranked JSONL file. Each candidate is a 4×4 object-from-TCP transform in metres. Validation executes every supplied pose.
  • run crosses objects, grippers, placements and seeds from a suite. For each case it freezes up to 512 ranked object-local poses from the antipodal generator or an external ranked file. The visual-check preset still plays the top-ranked candidate for each selected pair.
  • All seven hands have named open_qpos and close_qpos maps in suite.yaml, including mimic followers. The collision sampler and the physical approach share the open command. Per-hand stiffness and max_effort tune the finger drives. The bundled suite sets prismatic drives to 200 N/m and 30 N, and revolute drives to 200 N·m/rad and 30 N·m.
  • The built-in generator uses collision_threshold: 0.005 m in both the full suite and the visual preset. Before ranking, it rejects a pose if any open-hand sample lies at or within 5 mm of the object's convex hulls or less than 5 mm above the inferred support plane. External JSONL candidates go directly to physical validation.
  • Offline labeling and physical benchmarking use the same GraspValidator mounting, trajectory and scoring code. It runs on CUDA with the default PhysX backend or Newton with two-way DexUni coupling. The wrist orientation is set at reset and three translation joints drive the hand during the trial.
  • Each arena receives its own hand, dynamic object, support and contact sensor. The runner restores the frozen resting pose when validating generated candidates in replicated arenas.
  • Atomic case checkpoints store the frozen poses, resting transform, completed ranks, protocol and trial IDs. A compatible --resume tests only pending ranks and reuses completed observations.

Physical protocol

The open gripper approaches from 8 cm away, closes over 0.40 s, holds the closing command for the configured dwell and lifts the object 10 cm. The bundled suite uses 60 additional steps (0.60 s).

Each candidate executes one continuous trial. With enable_disturbance: true, the lifted gripper moves 3 cm along world +X, returns, then moves 3 cm along world +Y and returns. Each leg takes 0.30 s. The gripper then holds for 3 s. Setting the option to false starts the hold immediately after the lift. Success requires clearance above the table, retention throughout the required phases and bilateral terminal pad contact.

Default GPU uses a stationary kinematic table so the contact query can identify its actor. Both backends use a positive measured impulse where available. For DexUni geometry-only rows, a finite, nonpositive signed separation establishes contact. Protocol v8 isolates the 512-pose benchmark from older ten-pose and shared-scene runs. Checkpoint identities include the candidate budget, arena cap, physics settings and asset fingerprints. Use separate output directories to retain both aggregate reports.

Benchmark reports

The two scoring runs write the following artifacts under --output.

Output Contents
report.md / report.json Scores by gripper, category and pair, total passed/tested across all ranks, protocol limits, and per-case timing and arena usage.
trials/v8/<case-hash>.parquet One row per observed candidate rank, including hand, object, backend, outcome and physical diagnostics.
<case-hash>.json Per-case checkpoint with frozen candidates, settled placement, asset fingerprints and recorded trials.

The full suite reports the total number of successful grasps divided by all actual trials from complete cases, alongside Success@1, Hit@5, Hit@10 and Precision@10. A candidate passes by completing the lift, optional disturbance and final hold. Precision@10 counts empty candidate slots as failures. The JSON includes retention at 0.5, 1 and 3 s, drop timing, slip and rotation diagnostics.

Scores average placements and seeds within each object–gripper pair, then weight pairs equally. A completed case with no candidates scores zero. Missing observations suppress the affected algorithm’s scores for that group. With at least two object instances and complete data, the JSON includes 95% object-bootstrap intervals and paired differences for comparisons between algorithms. Usage and suite configuration

Research basis

GraspGen-X and AdaGrasp motivate evaluating grasp generation across grippers. Fixed-budget physical precision can be computed for user assets without collecting a dense reference set of successful poses. GraspGen-X · AdaGrasp · GraspNet ranking protocol

IPC-GraspSim motivates clearance and terminal jaw contact; MultiGripperGrasp motivates a timed hold and fall-off time. ACRONYM and the grasp-planning benchmarking protocol motivate disturbance testing and recording relative motion. The two horizontal trajectories and their intensity are choices made for this suite. IPC-GraspSim · MultiGripperGrasp · ACRONYM · Benchmarking Protocol for Grasp Planning Algorithms

Validation

  • With Robotiq 2F-85 and the same book, seed and 5,711 candidate poses, the 5 mm clearance reduced the qualifying set from 242 to 201. The highest-ranked pose changed from 1.30 mm to 5.31 mm of clearance.

  • Ran the desktop book decor_book_b02 with FrankaPandaHand and DHPGI14080. Each generated and tested 512 distinct ranks in a single 512-arena batch. The two cases recorded 1,024 physical trials and 1,023 successful grasps. Checked the ordered ranks in the checkpoints and Parquet files.

  • A short external candidate set used exactly three arenas for three poses. An empty set completed with zero validation arenas. A partial checkpoint with two outstanding ranks used two arenas and preserved all 510 prior results. The full DexTrove preflight found 910 eligible objects out of 1,115, yielding 6,370 planned pairs.

  • After extracting the video example, all 67 focused benchmark, validator and labeling tests passed in py312_bk, including the 512-arena case and native PhysX and Newton checks. Public API documentation coverage (5,081/5,081) and the project-context check passed.

Type of change

  • New feature

Checklist

  • Ran black . with Black 26.10.1.
  • Updated benchmark usage and the motion-planning context.
  • Verified public API documentation coverage.
  • Reviewed behavioral coverage and ran focused validation.

@yuecideng yuecideng added physics Physics backends, dynamics, contacts, fluids, deformables and physics solvers. benchmark Benchmark protocols, suites, metrics, evaluation tools and technical reports. feature New user-facing capabilities. labels Nov 19, 2026
@matafela
matafela force-pushed the codex/physical-grasp-benchmark branch from c6c60f5 to 938fc08 Compare November 24, 2026 03:05
matafela added 4 commits November 25, 2026 11:16
…grids

Accept a positive station count, place each batch on a square grid and leave spare cells empty. Use isolated supports, restore resting contacts between ranks and report continuous optional X/Y disturbance trials.
matafela added 6 commits November 27, 2026 12:05
Use the affordance GraspValidator for labeling and benchmark trials. Share resting-pose restoration and trial execution across single-pair and grid runs, and retain the earlier public import. Advance the benchmark protocol to v7 for the updated physical evidence.
Capture the top-ranked physical grasp for each DexTrove object and gripper with one 64-pixel camera per station. Stream the shared-clock tiles into resumable page videos and expose a runnable 16-by-16 example.
@matafela
matafela marked this pull request as ready for review December 1, 2026 06:39
# Conflicts:
#	agent_context/topics/motion-planning/motion-planning.md
@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

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

Summary

Adds physical grasp validation and benchmark commands for ranked poses across objects and grippers.

  • Ranked grasp poses can be tested in simulated lift-and-hold trials.
  • Grasp generation reports how many poses pass its sampling and collision checks.
  • DexTrove objects can be selected, prepared, and checked for benchmark use.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Suite and ranked poses] --> B[Freeze candidates and starting pose]
    B --> C[Run pending ranks in independent arenas]
    C --> D[Close and lift]
    D --> E[Optional disturbance and final hold]
    E --> F[Save trial evidence and checkpoint]
    F --> G[Compute scores and stage rates]
    G --> H[Write reports]
Loading

Reviews (6) · Last reviewed commit: "feat(benchmark): report top-ten and per-..." · Reviewed by Greptile

@matafela matafela mentioned this pull request Dec 1, 2026
5 tasks done
matafela added 2 commits December 3, 2026 15:03
Track candidate generation, collision filtering and physical validation by object category. Evaluate up to 256 ranked poses per object and gripper pair by default.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmark Benchmark protocols, suites, metrics, evaluation tools and technical reports. feature New user-facing capabilities. physics Physics backends, dynamics, contacts, fluids, deformables and physics solvers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant