Skip to content

Gripper Open

SUMMARY

Open Gripper commands a parallel gripper to move to its fully open position.

This skill is used to release a grasped object or prepare the gripper for approach before a pick operation.

UNITS

speed / force in the configured speed and force units (default percent for Robotiq; OnRobot ignores speed and uses N for force).

The Skill

python
status = gripper.open(speed=100.0, force=100.0, asynchronous=False)

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 opening a parallel gripper.

Supports OnRobot and Robotiq grippers, and Isaac Sim.

Usage:
    python open.py --ip <GRIPPER_IP>
    python open.py --prim_path <PRIM_PATH>

Note:
    Experimental gripper support for Isaac Sim:  Robotiq 2F85 (USD-based simulation only); Schunk EGP and
    PZN+ are.
"""

import argparse
from loguru import logger

from telekinesis.synapse.tools.parallel_grippers import onrobot


def main(ip: str | None,
         protocol: str,
         prim_path: str | None) -> None:
    """Opens an OnRobot gripper fully at 50 N force."""

    #===================== Create Gripper ======================================
    gripper = onrobot.OnRobotRG6()

    try:
        #===================== Connect Gripper =================================
        if prim_path:
            gripper.connect(simulation_prim_path=prim_path)
        else:
            gripper.connect(ip=ip, protocol=protocol)

        # ==================== Run Skill ====================================
        status = gripper.open(force=50.0,
                              asynchronous=False)
        logger.success(f"open() status: {status}, "
                       f"position: {gripper.get_current_position():.2f}")
    except (ConnectionError, OSError) as e:
        logger.error(f"Error occurred: {e}")
    finally:
        gripper.disconnect()


if __name__ == "__main__":
    p = argparse.ArgumentParser(description="OnRobot gripper open")
    p.add_argument("--protocol",
                   choices=["MODBUS_TCP"],
                   default="MODBUS_TCP")
    p.add_argument("--ip", default=None, help="IP for OnRobot Gripper")
    p.add_argument("--prim_path", type=str, default=None,
                   help='Isaac Sim gripper prim path, e.g. "/World/onrobot_rg6"')
    args = p.parse_args()

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

Running the Example

bash
python open.py --ip 192.168.1.100
bash
python open.py --prim_path /World/onrobot_rg6

For all options:

bash
python open.py --help

Parameter Configuration

Robotiq 2F-85

ParameterTypeDefaultDescription
speedfloat100.0Motion speed in percent (0-100). Pass -1.0 to use the session default.
forcefloat100.0Opening force in percent (0-100). Pass -1.0 to use the session default.
asynchronousboolFalseIf True, returns "MOVING" immediately without waiting.

OnRobot RG2 / RG6

ParameterTypeDefaultDescription
forcefloat-Opening force in Newtons, clamped to the model's max force.
asynchronousboolFalseIf True, returns "MOVING" immediately without waiting.

Returns

StatusDescription
"MOVING"Returned when asynchronous=True
"AT_DEST"Fingers reached fully open position
"STOPPED_OUTER_OBJECT"Robotiq only - stopped against an external object. OnRobot hardware cannot distinguish inner from outer grip, so this value is never returned by OnRobot.
"STOPPED_INNER_OBJECT"Robotiq: stopped by internal contact. OnRobot: any detected grasp (the hardware does not distinguish inner from outer).
"UNKNOWN_STATUS_<code>"Unexpected hardware status

Raises

Robotiq 2F-85

ExceptionCondition
TypeErrorasynchronous is not a bool
ValueErrorThe configured connection protocol is not supported
RuntimeErrorThe gripper is not connected

OnRobot RG2 / RG6

ExceptionCondition
TypeErrorAn argument's value does not match its expected type
RuntimeErrorThe gripper is not connected, or the underlying Modbus command fails

Where to Use the Skill

  • Release after place - Open the gripper after depositing an object
  • Pre-approach clearance - Open fully before descending onto a pick target
  • Reset state - Open at script start to ensure a known initial position

When Not to Use the Skill

Do not use Open Gripper when:

  • Partial opening is required - use Tool Move to move to a specific intermediate position
  • The gripper is not connected - always call connect before issuing motion commands