Skip to content

Gripper Release

SUMMARY

Release stops vacuum generation on a suction gripper to drop the currently grasped object.

This skill is used to deposit an object once the gripper is positioned at the place location.

The Skill

python
gripper.release()

The Code

Safety first!

A real robot will faithfully do whatever you ask of it - so please take a moment to clear the workspace, keep an E-Stop within reach, and be ready to disconnect.

Operating real hardware is at your own risk.

python
"""
Demonstrates releasing an object held by a suction gripper.

Supports Piab grippers, on real hardware or simulated in Isaac Sim. Also
supported for the simulation-only custom.SuctionGripper.

Usage:
    python release.py --ip <ROBOT_IP>
    python release.py --protocol MODBUS_RTU --serial-port COM3
"""

import argparse
import time
from loguru import logger

from telekinesis.synapse.tools.suction_grippers import piab


def main(ip: str | None, serial_port: str, protocol: str) -> None:
    """Releases an object held by a Piab gripper."""

    #===================== Create Gripper ======================================
    gripper = piab.PiabPiCobotElectric()

    # ==================== Run Skill ===========================================
    try:
        gripper.connect(ip=ip, serial_port=serial_port, protocol=protocol)
        gripper.release()
        logger.success("Release command issued.")

        # Give the vacuum time to vent before reading the status.
        time.sleep(2.0)
        logger.success(f"Part present: {gripper.get_part_present()}")
    except (ConnectionError, OSError) as e:
        logger.error(f"Error occurred: {e}")
    finally:
        gripper.disconnect()


if __name__ == "__main__":
    p = argparse.ArgumentParser(description="Piab gripper release")
    p.add_argument("--protocol",
                   choices=["URCAP", "MODBUS_RTU"],
                   default="URCAP")
    p.add_argument("--ip", default="192.168.2.2", help="IP for Robot Controller")
    p.add_argument("--serial-port", dest="serial_port", default="COM3",
                   help="Serial port for MODBUS_RTU")
    args = p.parse_args()

    main(ip=args.ip,
         serial_port=args.serial_port,
         protocol=args.protocol)

Parameter Configuration

This skill takes no input parameters.

Returns

This skill returns nothing (None). Vacuum generation stops immediately, dropping any grasped object; the vacuum level configured via grasp or set_vacuum_level is preserved for the next grasp call.

Raises

ExceptionCondition
ConnectionErrorThe backend is not connected
RuntimeErrorThe command fails, or the gripper is not connected

Where to Use the Skill

  • Place operations - Release after positioning the object at its destination
  • Fault recovery - Release to drop an object cleanly before retrying a failed pick

When Not to Use the Skill

Do not use Release when:

  • The gripper is not connected - always call connect before issuing commands
  • The object is not yet positioned - releasing mid-transit drops the object uncontrolled