Skip to content

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

robot.wait_holding_part(timeout=None)

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 example GRIPPER_SETTLE_TIMEOUT or SUPERSEDED, 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. Its result holds the GripperResult, or None.
  • RobotTimeout: The command had not settled within timeout.

See also