hylo.manip.handpath¶
Package: hylo-manip · Core contracts
handpath ¶
Editing a hand's motion so it holds what it should: a retargeted (human) trajectory of TCP poses and finger joints bent onto a planned grasp around the grasp moment.
tcp, fingers, info = bend_onto_grasp(tcp, fingers, grasp, start=a, end=b, fps=15.0)
Phases (frame indices; grasp is a DexGrasp from hylo.manip.dexgrasp):
ramp [a - ramp, a - approach): from the retargeted pose to the pre-pose (6 cm back along the approach),
fingers to the grasp's open pre-shape;
approach [a - approach, a): straight in along the approach to the grasp pose, fingers open;
hold [a, b): the grasp's offset from the retargeted TCP at frame a rides on the retargeted motion (the hand
carries the object as the human hand does), fingers close to the squeeze command over close_s;
release [b, b + open_s): offset kept, fingers back to the pre-shape;
return then over ramp: back to the retargeted motion.
Frames outside these phases are unchanged.
blend_pose ¶
Pose between A (w = 0) and B (w = 1): positions linear, rotation along the shortest arc.
bend_onto_grasp ¶
bend_onto_grasp(tcp: ndarray, fingers: ndarray, grasp: Any, start: int, end: int, fps: float, *, ramp_s: float = 0.6, approach_s: float = 0.3, close_s: float = 0.3, open_s: float = 0.4, pre_dist: float = 0.06) -> tuple[np.ndarray, np.ndarray, dict[str, float]]
New (T, 4, 4) TCP poses and (T, n) finger targets; see the module docstring. The inputs are not changed.