wait_holding_part¶
Runs in the client Sends nothing to the robot
Wait until the last gripper command has settled holding a part. It waits like wait_gripper_move_complete(), then checks why the jaws stopped: something must have stopped them before their target. Jaws that closed on nothing raise GripFailed as soon as they settle, so a missed pick cannot go unnoticed. Call it after close_gripper(), or a move_gripper() that closes, before the arm moves away.
Syntax¶
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
timeout |
float | None |
None |
The longest wait for the jaws to settle, in seconds. None or 0 mean 120 s. |
Returns¶
GripperResult
The command's GripperResult: code 2 after a close. Code 1, an opening that something blocked, passes too.
Examples¶
from robotclient import GripFailed
robot.close_gripper()
try:
robot.wait_holding_part()
except GripFailed as missed:
print(missed.result)
Exceptions¶
CommandRejected: The gripper command failed: its code says why, for exampleGRIPPER_SETTLE_TIMEOUTorSUPERSEDED, or the connection closed before it settled.GripFailed: The jaws settled without stopping on anything, or no gripper command of this client has settled yet. Itsresultholds theGripperResult, orNone.RobotTimeout: The command had not settled withintimeout.