Skip to content

Loading search…

grasping

Grasp planning on a mask: top-down, pitched, side, part and rim grasps.

  • Layer: base
  • Needs: –
  • Requires: –
  • Conflicts with: –
  • Never dropped: yes
  • Mixin: skills.grasping:Grasping
  • Manifest: skills/grasping/skill.toml
def plan_grasp(observation, mask, camera='cam_head', z=None, lift=0.1, top_down=False, arm=None, prefer_side=False, grasp_z=None)

Grasp of the object in mask (from camera).

Projects the mask onto the plane at height z (default: 2 cm above the table) and plans at the footprint center. Top-down: the fingers close across the footprint’s short axis. Angled: link6 approaches from the arm’s base toward the object, tilted down by a pitch (60, 45 or 30 degrees, or 0 for a horizontal side grasp), and the fingers close horizontally across it. Returns tip position, approach (“top_down”, “pitched_60”, “pitched_45”, “pitched_30” or “side”), closing direction, width across the fingers (m), link6 grasp pose and a pregrasp pose lift before it (above it for top-down, back along the approach otherwise), graspable (width below the open gripper), and, without top_down, the arm and whether both poses have IK solutions (reachable).

top_down=True returns the top-down grasp. Otherwise the first candidate in the order top-down, pitched 60, 45, 30, side (with prefer_side, for tall objects: side, pitched 30, 45, 60, top-down) that is graspable and reachable for arm (default: the arm whose base is nearer in x). When the whole object is too wide, a part grasp (“top_down_part”): top-down across a thin part of the footprint (a ring’s band, a rim, a handle) whose finger landing spots are clear of the rest of the object; also when the closing line through the center crosses little of the object (a ring’s or a crown’s hole, the gap of a bent tool). Else the top-down one. Pass z at the height of the mask’s outline (_measure estimates it from two wrist views): projecting a tall object’s mask onto a plane far below its outline inflates the footprint, most for close wrist cameras. The fingers close at grasp_z (default z).

From the RoboDojo prompt pack (prompts/robodojo/), with every skill and feature on:

plan_grasp(observation, mask, camera="cam_head", z=None, lift=0.10, top_down=False, arm=None,
prefer_side=False)
-> dict or None: "tip", "approach" ("top_down", "pitched_60", "pitched_45",
"pitched_30" or "side"), "closing_direction", "width_m", "length_m", "graspable",
link6 "grasp" and "pregrasp" poses, and without top_down "arm" and "reachable".
It returns the first of top-down, then approaches from the arm's base tilted down
by 60, 45, 30 or 0 degrees (fingers close horizontally; pregrasp is `lift` back
along the approach), that is graspable and reachable; prefer_side=True tries the
side first (tall objects); for an object too wide to grasp whole, a
"top_down_part" grasp across a thin part (a ring's band, a rim, a handle) clear of
the rest; else the top-down one.
Tilted approaches reach objects further forward than top-down. top_down=True
plans only the top-down grasp.
Pass z = the height where the fingers should close (below the object's top from
localize_3d); the default is 2 cm above the table. Each finger travels 0.044 m, so
fully open the fingers are about 0.09 m apart; wider objects need another grasp.