Verify Grasps with Simulation Example

September 27, 2025 · View on GitHub

This example shows how to validate grasps using physics-based simulation with grasp_sim.py. You can use grasps generated by grasp_guess.py or your own YAML in the Isaac Grasp format.

Prerequisites

  • A grasp YAML file (from grasp_guess.py or authored manually)
  • A compatible gripper USD and object mesh (referenced in the YAML or via CLI overrides)

Quick Start (from grasp guess output)

python scripts/graspgen/grasp_sim.py \
    --grasp_file grasp_guess_data/onrobot_rg6/banana.yaml \
    --max_num_envs 512

Manual YAML Example

Minimal YAML structure (fields can be overridden via CLI):

format: isaac_grasp
format_version: "1.0"
object_file: objects/mug.obj
object_scale: 1.0
gripper_file: bots/onrobot_rg6.usd
finger_colliders: [right_inner_finger, left_inner_finger]
open_limit: lower
grasps:
  g0:
    position: [0.10, 0.00, 0.15]
    orientation: { w: 1.0, xyz: [0.0, 0.0, 0.0] }
    cspace_position: { finger_joint: -0.31 }

Run the simulation on a custom YAML:

python scripts/graspgen/grasp_sim.py \
    --grasp_file grasp_data/mug.yaml \
    --max_num_envs 256 \
    --fps 250

Example with stronger disturbances:

python scripts/graspgen/grasp_sim.py \
    --grasp_file grasp_guess_data/onrobot_rg6/banana.yaml \
    --force_magnitude 2.0 \
    --tug_sequences '[[0.5,[0,0,1],1.0],[0.5,[2,0,1],1.0]]'

Output

  • Results are written to grasp_sim_data/<gripper>/<object>.yaml with per-grasp confidence (1.0 pass, 0.0 fail).
  • Failed grasp poses can be written with --output_failed_grasp_locations for visualization.

Tips

  • If the gripper seems to “open,” check --open_limit {upper|lower} to ensure correct close direction.
  • If objects tunnel or jitter, try --fps 500 or enable CCD on CPU.
  • To debug a single grasp interactively: --debug_single_index <i> --max_num_envs 1 --force_headed.