Skip to content

feat(manip): GraspGenX provider on the grasping stack - #3874

Open
mustafab0 wants to merge 1 commit into
mb/grasp-06-one-grasping-stackfrom
mb/grasp-07-graspgenx-provider
Open

feat(manip): GraspGenX provider on the grasping stack#3874
mustafab0 wants to merge 1 commit into
mb/grasp-06-one-grasping-stackfrom
mb/grasp-07-graspgenx-provider

Conversation

@mustafab0

Copy link
Copy Markdown
Contributor

xarm-grasp-graspgenx swaps HeuristicGraspModule for GraspGenXModule and changes nothing else; the two share every other module through _XARM_GRASP_MODULES. GraspGenXModule already existed on main and had no caller.

Two constants make the swap work, and both are sourced rather than tuned. XARM_GRASP_FRAME_TO_TCP maps what GraspGenX predicts — a pose on xarm_gripper_base_link, approach along +Z, jaws closing along X — onto the planning tip frame: the 0.172 m offset is joint_tcp read straight out of xarm_gripper.urdf.xacro, and the quarter turn puts the closing axis on the xArm gripper's Y, which is where mj_forward on data/xarm_grasp_sim puts the jaw span. XARM_GRIPPER_SWEEP_VOLUME is the jaw geometry the network reasons about, measured off the same scene at the driver joint limits and expressed in GraspGenX's own convention. It is real gripper geometry, so it holds on hardware too, and the comment says where it came from so the next person can re-measure rather than guess.

Ranked candidates also needed pick_object to stop assuming there is only one. It took candidates[0] and gave up if that pose would not plan — correct for a single-candidate heuristic, wrong for a spread of a hundred where the best-scoring pose is often the one the arm cannot reach. It now walks up to max_grasp_attempts candidates, demoting only on a planning failure, because a drive or execution fault would repeat identically for every one of them, and reports the rank it won on.

Verified in the grasp sim: 100 ranked proposals in the planning frame, scores 0.84 down, and a pick that completes on rank 0 with score 0.966.

Seventh of nine in the xArm grasping re-landing stack.

xarm-grasp-graspgenx swaps HeuristicGraspModule for GraspGenXModule and changes
nothing else; the two share every other module. GraspGenXModule already existed
and had no caller.

Two constants make the swap work. XARM_GRIPPER_SWEEP_VOLUME is the jaw geometry
the network reasons about, measured off data/xarm_grasp_sim at the driver joint
limits and expressed in GraspGenX's own convention. XARM_GRASP_FRAME_TO_TCP maps
what GraspGenX predicts -- a pose on xarm_gripper_base_link, approach along +Z,
jaws closing along X -- onto the planning tip frame: the 0.172 m offset is
joint_tcp straight out of xarm_gripper.urdf.xacro, and the quarter turn puts the
closing axis on the xArm gripper's Y.

Ranked candidates also needed pick_object to stop assuming there is only one.
It took candidates[0] and gave up if that pose would not plan, which is correct
for a single-candidate heuristic and wrong for a spread of a hundred where the
best-scoring pose is often the one the arm cannot reach. It now walks up to
max_grasp_attempts candidates, demoting only on a planning failure -- a drive or
execution fault would repeat identically for every candidate -- and reports the
rank it won on.
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

@@                       Coverage Diff                       @@
##           mb/grasp-06-one-grasping-stack    #3874   +/-   ##
===============================================================
  Coverage                           77.65%   77.66%           
===============================================================
  Files                                1324     1324           
  Lines                              125505   125539   +34     
  Branches                            10915    10916    +1     
===============================================================
+ Hits                                97465    97503   +38     
+ Misses                              24895    24893    -2     
+ Partials                             3145     3143    -2     
Flag Coverage Δ
OS-ubuntu-24.04-arm 74.34% <100.00%> (+0.01%) ⬆️
OS-ubuntu-latest 74.88% <100.00%> (+0.01%) ⬆️
Py-3.10 74.88% <100.00%> (+0.01%) ⬆️
Py-3.11 74.87% <100.00%> (+0.01%) ⬆️
Py-3.12 74.87% <100.00%> (+0.01%) ⬆️
Py-3.13 74.87% <100.00%> (+0.01%) ⬆️
Py-3.14 74.88% <100.00%> (+0.01%) ⬆️
Py-3.14t 74.87% <100.00%> (+0.01%) ⬆️
SelfHosted-Large 30.20% <16.66%> (-0.01%) ⬇️
SelfHosted-Linux 34.71% <20.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dimos/manipulation/pick_and_place_module.py 83.61% <100.00%> (+3.96%) ⬆️
dimos/manipulation/test_pick_and_place_unit.py 100.00% <100.00%> (ø)
dimos/robot/all_blueprints.py 100.00% <ø> (ø)
...imos/robot/manipulators/xarm/blueprints/agentic.py 100.00% <100.00%> (ø)
dimos/robot/manipulators/xarm/blueprints/grasp.py 82.97% <100.00%> (+1.58%) ⬆️
dimos/robot/test_all_blueprints.py 87.50% <ø> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This change adds GraspGenX-backed xArm grasping blueprints, agent-enabled variants, xArm-specific gripper/TCP configuration, and bounded retry behavior for ranked grasps after planning failures.

The ranked-grasp fallback concern was disproved by execution. A focused harness exercised a successful pregrasp followed by a failed grasp plan for the first pose, then verified that the second pose was selected, executed, retracted, and recorded as the successful grasp. The same harness confirmed that max_grasp_attempts=1 does not plan a second candidate and leaves no selected or held object after the first planning failure.

No defects were found.

Confidence Score: 5/5

The reviewed ranked fallback behavior correctly advances only after a planning failure and preserves an unselected state when its attempt limit is reached.

The executed failure path contradicted the identified fallback concern, and no findings remain.

Files Needing Attention: No files require follow-up based on the validated behavior.

T-Rex T-Rex Logs

What T-Rex did

  • I authored a focused harness that loads the checked-out pick-and-place module and asserts ranked-fallback state, motion ordering, and the cap on attempts.
  • I ran the harness with candidate 1 pregrasp succeeding, candidate 1 grasp planning failing, and candidate 2 succeeding, and observed candidate 2 being selected with a held state.
  • I exercised the cap boundary in the same harness with max_grasp_attempts=1 and observed that candidate 2 was not planned and no grasp selection or held state remained.
  • I validated that the requested failure hypothesis did not produce a severity-bearing proof, as the harness disproved it.

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
dimos/manipulation/pick_and_place_module.py Adds bounded fallback to later ranked grasps only after planning failures.
dimos/robot/manipulators/xarm/blueprints/grasp.py Composes the GraspGenX provider with xArm-specific gripper and TCP configuration.
dimos/robot/manipulators/xarm/blueprints/agentic.py Adds an agent-enabled GraspGenX xArm blueprint.
dimos/robot/all_blueprints.py Registers the GraspGenX xArm blueprint names.
dimos/manipulation/test_pick_and_place_unit.py Adds coverage for ranked fallback, failure stopping, and attempt limits.
docs/capabilities/manipulation/xarm-grasp.md Documents the learned and heuristic xArm grasping workflows.

Reviews (1): Last reviewed commit: "feat(manip): GraspGenX provider on the g..." | Re-trigger Greptile

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant