Skip to content

wait_motion_complete

Runs in the client Sends nothing to the robot

Wait until the last command this client queued has finished. It waits for one command: the last move, delay or gripper command the robot accepted from this client. A command the robot refused when it was sent does not count. It returns at once when this client has queued nothing yet or called stop() since, or when that command has already finished.

It does not wait for the commands queued before it, nor report their failures: wait_idle() does both. Moves finish in the order they were queued, but a gripper command does not hold up the moves after it, so an earlier gripper command can still be moving.

Syntax

robot.wait_motion_complete(timeout=None)

Arguments

Name Type Default Description
timeout float | None None Seconds to wait at most. None or 0 waits up to 120 s.

Returns

Nothing.

Examples

robot.move_joints(90, -105, 165, 0, -30, 180)
robot.wait_motion_complete()
robot.move_joints(90, -100, 160, 0, -30, 180)
robot.wait_motion_complete(timeout=30)

Exceptions

  • CommandRejected: The command failed after the robot accepted it, for example with JOINT_LIMIT, STOPPED or ABORTED, or the connection was lost first (CONNECTION_LOST or DISCONNECTED). Its code names the failure. Every later call raises it again, until another command is queued or this client calls stop().
  • RobotTimeout: The command had not finished after timeout, or 120 s.

See also