Skip to content

Gripper Connection and Disconnection

SUMMARY

Gripper Connection and Disconnection manages the gripper session lifecycle for reliable runtime communication.

This skill ensures robust setup and teardown of gripper communication channels before and after task execution.

The Skill

python
# Connect
gripper.connect(ip=gripper_ip, protocol="RTDE", timeout_ms=2000)

# Disconnect
gripper.disconnect()

The Code

Example: Basic Connect and Disconnect

python
from telekinesis.synapse.tools.parallel_grippers import robotiq

# Initialize gripper
gripper = robotiq.Robotiq2F85()
# Connect
gripper.connect(ip="192.168.1.1", protocol="RTDE", timeout_ms=2000, verbose=False)
# Disconnect
gripper.disconnect()

The Explanation of the Code

connect opens a communication session between Synapse and the gripper. The call blocks until the session is ready or raises a RuntimeError if the gripper cannot be reached. Default units and position range are applied automatically on connection — exact values depend on the gripper model. See the parameter table for supported protocols and options per gripper.

disconnect closes the session and releases the communication channel. Safe to call when already disconnected — returns normally without raising.

How to Tune the Parameters

Connect

Robotiq 2F-85

ParameterTypeDefaultDescription
ipstrIP address of the gripper.
protocolstr"RTDE"Only "RTDE" is accepted.
timeout_msint2000Connection timeout in milliseconds. Range: 1–120000.
verboseboolFalseIf True, enables verbose backend logging.

OnRobot RG2 / RG6

ParameterTypeDefaultDescription
ipstrIP address of the gripper.
protocolstr"MODBUS_TCP"Only "MODBUS_TCP" is accepted.

Disconnect

No parameters.

TIP

Always call disconnect after task execution to cleanly release the gripper session.

WARNING

connect raises a RuntimeError if the gripper is unreachable. Verify the IP address and power state before calling.

Where to Use the Skill

  • Session setup — Call connect once at the start of every script before issuing any gripper commands
  • Session teardown — Call disconnect at the end of every script to release the gripper session
  • Error recovery — Re-connect after a communication fault to restore the control session

When Not to Use the Skill

Do not call connect or disconnect when:

  • The gripper is already connectedconnect on an active session overwrites the existing session; disconnect first if reconnecting intentionally
  • Inside a tight control loop — establishing a session has latency; connect once at startup and reuse it throughout execution

Supported Grippers

GripperSupported
OnRobot RG2
OnRobot RG6
Robotiq 2F-85
Schunk EGU-50Coming Soon!