set_gripper¶
Runs at once Any mode Takes control
Give the gripper a target at once, outside the queue. The robot sends the target to the gripper on its next cycle, whatever the arm is doing, and answers at once: the call does not wait for the jaws and reports nothing about them. For a program, use move_gripper(), which runs in order with the moves, waits for the jaws and reports the outcome.
With action 1 the jaws move to position and stay there, pressing with up to current on whatever stops them. With action 0 the gripper is released: it has no target, and depending on its drive the jaws hold still or go limp. The target lasts until the next gripper command; stop(), disable() and an error replace it with where the jaws are.
It takes effect only in firmware mode and on a calibrated gripper; in motor mode the robot keeps it and sends it when firmware mode returns. It ends a calibration in progress, and replaces the target of a queued gripper command still under way, which then fails with GRIPPER_SETTLE_TIMEOUT unless the jaws pass within 5 of its own target.
Syntax¶
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
position |
int |
required | The target, a whole number from 0 (fully open) to 255 (fully closed) on the gripper's scale; not millimetres. |
speed |
int |
100 |
How fast the jaws move, a whole number from 0 (slowest) to 255 (fastest) on the gripper's scale. |
current |
int |
200 |
The gripper motor's current limit while the jaws move and hold, in mA: a whole number from 1 to the gripper XML's <Ilim> (1700 mA for the shipped grippers). |
action |
int |
1 |
1 to move to position and stay there, or 0 to release the gripper. |
Default values¶
No target, the gripper released, each time the robot software starts.
Homing ends with the gripper released too, and so does
set_gripper_ctrl_mode(1).
Returns¶
Any
None. The robot answers before the target reaches the gripper.
Examples¶
Further details¶
Warning
The jaws move at once, also while the robot is disabled, and keep
pressing until the next gripper command, stop(), disable() or an
error, which stop them where they are in firmware mode. Keep hands
away from the jaws.
Usage restrictions 5 codes
This command runs at once; it is not queued. The robot accepts it in any mode and state, from the client that holds control or when no client does.
It answers with one of these codes when it does not carry the command out:
- [6101] Control held by another client — another client holds control; the message names it
- [6023] No gripper — the robot has no CAN gripper
- [6003] Invalid arguments — a value is outside its range above, or the robot did not get exactly four values (this method always sends four)
- [6025] RTI not running or not answering — rTI did not answer within 1 s: it is not running or not responding. The command may still have taken effect
- [6026] Refused by RTI — rTI could not read the values. The message says why
In Python, a code above raises CommandRejected; its number is the code. The call raises:
CommandRejected: The robot refused it: a value is outside its range, the robot has no CAN gripper, or another client holds control. Or RTI refused it or did not answer within 1 s (Errors:).RobotTimeout: The robot did not answer within 5 s.RobotConnectionError: The client is not connected.ValueError: A value cannot be read as a whole number, for example the text "open". Nothing is sent.
If the connection drops while the call waits for the robot's answer, it raises CommandRejected with the code CONNECTION_LOST (DISCONNECTED after disconnect()); while it waits for the robot's status, RobotConnectionError.
Like every immediate command, it also answers BAD_ARGS when a raw client sends a value the robot cannot read at all, and INTERNAL when it fails inside the robot.
Protocol¶
A client that does not use robotclient sends this over the TCP command protocol (port 29000) for the example above: