mp_yam_code / source /bimanual /yam /solvers /pick_place.py
yqi19's picture
YAM bimanual task suite: env, solvers, tasks, converters
7399b6f verified
Raw
History Blame Contribute Delete
581 Bytes
"""Grasp one object, put it in/on one region."""
from .base import approach_and_grasp, place_at
def solve(env, obj, target, arm="right", jaw="auto", grasp_top=None, lift=0.16,
on_top=False, max_gap=0.045):
a = env.arms[arm]
res, ext = approach_and_grasp(env, a, obj, jaw=jaw, grasp_top=grasp_top, max_gap=max_gap)
if not res.ok:
env.recorder.phase = "ABORT: no grasp"
return {"grasped": False, "reason": res.reason}
return {"grasped": True,
"place_err": place_at(env, a, target, float(ext[2])/2.0, on_top=on_top, lift=lift)}