Skip to content

6. End Effectors

API List

Vacuum Gripper

API FunctionDescription
set_vacuum_gripper()Set vacuum gripper to pick or release
get_vacuum_gripper()Get vacuum gripper state

UFACTORY Gripper

API FunctionDescription
set_gripper_enable()Enable the gripper
set_gripper_speed()Set gripper speed
set_gripper_position()Control gripper position
get_gripper_position()Get current gripper position
get_gripper_err_code()Get gripper error code
clean_gripper_error()Clear gripper error

BIO Gripper

API FunctionDescription
set_bio_gripper_enable()Enable BIO gripper
set_bio_gripper_speed()Set BIO gripper speed
open_bio_gripper()Open BIO gripper
close_bio_gripper()Close BIO gripper
get_bio_gripper_status()Get BIO gripper status
get_bio_gripper_error()Get BIO gripper error code
clean_bio_gripper_error()Clear BIO gripper error

Robotiq Gripper (2F-85 and 2F-140)

API FunctionDescription
set_robotiq_gripper_enable()Enable Robotiq gripper
set_robotiq_gripper_speed()Set Robotiq gripper speed
set_robotiq_gripper_force()Set Robotiq gripper force
open_robotiq_gripper()Open Robotiq gripper
close_robotiq_gripper()Close Robotiq gripper
get_robotiq_gripper_status()Get Robotiq gripper status

End Effector Control

Vacuum Gripper

Set Vacuum Gripper State

Use set_vacuum_gripper(on, wait=False, timeout=3, hardware_version=1) to set the vacuum gripper to pick or release.

  • on: True to pick, False to release.
  • wait: Whether to wait for the picking result. Default is False. If True, the program blocks until the pick succeeds or times out.
  • timeout: Timeout in seconds, default is 3. Takes effect when wait=True. If picking fails within the specified time (determined by the vacuum gripper's built-in pressure sensor), the SDK returns error code 41.
  • hardware_version: Hardware version.
    • 1: Plug-in connection (default)
    • 2: PIN contact connection

Example:

python
# Simply turn on and off, vacuum gripper is plug-in connnetion
arm.set_vacuum_gripper(True)   # Pick
time.sleep(2)
arm.set_vacuum_gripper(False)  # Release

# Wait for the result, up to 3 seconds
code = arm.set_vacuum_gripper(True, wait=True, timeout=3)
if code == 0:
    print("Picked successfully")
else:
    print(f"Pick failed, code: {code}")

Get Vacuum Gripper State

Use get_vacuum_gripper() to get the current state of the vacuum gripper.

  • hardware_version: Hardware version
    • 1: Aviation connector (default)
    • 2: PIN contact connector
  • Return Value: A tuple containing the error code and state.
    • code: API return code
    • state: Gripper state
      • 0: Off
      • 1: On

Example:

python
code, state = arm.get_vacuum_gripper()
if code == 0:
    if state == 1:
        print("Vacuum gripper is on")
    else:
        print("Vacuum gripper is off")

UFACTORY Gripper

Enable Gripper

Enable the gripper before use.

python
# Enable gripper
arm.set_gripper_enable(True)

Set Gripper Speed

Set the opening/closing speed of the gripper.

python
# Set gripper speed to 2000
arm.set_gripper_speed(2000)

Control Gripper Position

The position range is -10 to 850.

python
# Open the gripper (fully open)
arm.set_gripper_position(850, wait=True)

# Close the gripper
arm.set_gripper_position(0, wait=True)

wait=True means the program waits for the gripper to reach the position before executing the next command.