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.
SUPPORTED GRIPPERS
Available on Robotiq and OnRobot grippers.
UNITS
timeout_ms in milliseconds (Robotiq only, default 2000). Port numbers are unitless integers.
The Skill
# Connect
gripper.connect(ip=gripper_ip, protocol="RTDE", timeout_ms=2000)
# Disconnect
gripper.disconnect()The Code
Example: Basic Connect and Disconnect
"""
Robotiq connect and disconnect example for the Synapse SDK.
Usage:
python connect-and-disconnect.py --ip <ROBOT_IP>
"""
import argparse
import time
from loguru import logger
from telekinesis.synapse.tools.parallel_grippers import robotiq
def main(ip: str):
"""Connect to a Robotiq gripper at `ip` and cleanly disconnect."""
# Create the gripper
gripper = robotiq.Robotiq2F85()
logger.info(f"Connecting Robotiq at {ip}...")
# Connect to the gripper,
gripper.connect(ip=ip)
logger.success("Connected.")
# Sleep for a bit
time.sleep(2.0)
# Disconnect cleanly
gripper.disconnect()
logger.success("Disconnected.")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Robotiq gripper connect/disconnect example")
parser.add_argument("--ip", type=str, required=True, help="UR robot IP address")
args = parser.parse_args()
main(ip=args.ip)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
| Parameter | Type | Default | Description |
|---|---|---|---|
ip | str | - | IP address of the gripper. |
protocol | str | "RTDE" | Only "RTDE" is accepted. |
timeout_ms | int | 2000 | Connection timeout in milliseconds. Range: 1-120000. |
verbose | bool | False | If True, enables verbose backend logging. |
OnRobot RG2 / RG6
| Parameter | Type | Default | Description |
|---|---|---|---|
ip | str | - | IP address of the gripper. |
protocol | str | "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
connectonce at the start of every script before issuing any gripper commands - Session teardown - Call
disconnectat 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 connected -
connecton 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

