Pick and Place (grasp_helpers.py)
Compose grasp_helpers.py (numpy) with
physical_robot_safety.md,
workspace-calibration,
rgb-object-localization,
visual-servoing, and
motion-planning (when obstacles or walls sit
near the swept path). Whenever surface_z or wrist hand-eye is not yet cached,
read workspace-calibration and import
calibration.py
(probe_surface_z, fit_wrist_jacobian, jacobian_step_xy) — never
hand-roll a Z-probe.
- Live Perception & Pre-Localize Movable Destinations:
- Keep robot, camera, and IK handles live in one re-runnable script—unless
fixed coordinates are given, never hardcode object or destination
(x, y)from an earlier probe. - Localize any movable place target (cup, coaster, stack base, bin) before picking, while the gripper is empty and unoccluded.
- Prefer wrist-camera closed-loop alignment when the target is in view
(masking out frame borders/base clutter with
roi_mask); add an overhead coarse seed when targets may lie outside the wrist FOV.
- Keep robot, camera, and IK handles live in one re-runnable script—unless
fixed coordinates are given, never hardcode object or destination
- Separate
z_topfromz_grasp— Descend Flush on Top-Down Jaw Grasps:- Use
z_top = surface_z + visible_heightfor 3D ray-plane localization; never passz_topas jawz_grasp(which closes in thin air). - For top-down jaw grasps, descend all the way to the support plane
(
surface_z_cmdon compliant arms,surface_z + 1–2 mmon stiff arms) unless the object is taller than the finger pads or flanged—this maximizes pad contact area. If the object rests on a raised tray, book, or coaster rather than the probed table, use that surface's height or depth. For side, rim, suction, or wall-singulation grasps, seereferences/grasp_modes.md.
- Use
0°Top-Down Pitch, Wrist Limits & Gentle Closure:- Keep
0°vertical pitch on top-down grasps whenever IK reaches it: tilting even10–15°puts one jaw on the table while the other stays in mid-air, pinching nothing or sweeping the object. - Align jaw closing across the narrow width (perpendicular to the long axis)
at hover, check wrist limits with
plan_wrist_yaw(...)(±πpre-wind or midpoint regrasp), and gently nudge wall-flush objects into open space before grasping. - Import
grasp_helpers.pyrather than hand-rolling grip loops: close withclose_until_contact(...)(polarity-agnostic contact stall tog_hold, keepingtol_fracsmall for thin shafts) and verify twice withverify_grasp(...)(post-close and post-lift); ifgraspedisFalse, abort and retry rather than continuing to transit.
- Keep
- Place, Vertical Retreat & Retry Cap:
- Descend vertically to placement height, release gently, retreat
vertically first, and confirm settled placement in a compact
.jpg. - Cap retries at
<= 3(flushing frames and re-localizing live each try).
- Descend vertically to placement height, release gently, retreat
vertically first, and confirm settled placement in a compact


