Skip to content

Gripper Move

SUMMARY

Move Gripper commands a parallel gripper to move to a specific finger position.

This skill is used when precise intermediate positions are required, such as adapting grip width to a known object size.

UNITS

position in the configured position unit (default mm). 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.move(position=42.5, speed=50.0, force=60.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 moving a parallel gripper to a target position.

Supports OnRobot and Robotiq grippers, and Isaac Sim.

Usage:
    python move.py --ip <GRIPPER_IP>
    python move.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:
    """Moves an OnRobot gripper to 50 mm 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.move(position=50.0,
                              force=50.0,
                              asynchronous=False)
        logger.success(f"move() 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 move")
    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 move.py --ip 192.168.1.100
bash
python move.py --prim_path /World/onrobot_rg6

For all options:

bash
python move.py --help

Parameter Configuration

Robotiq 2F-85

ParameterTypeDefaultDescription
positionfloat-Target position in mm. 0 = closed, 85 = fully open.
speedfloat100.0Motion speed in percent (0-100). Pass -1.0 to use the session default.
forcefloat100.0Gripping force in percent (0-100). Pass -1.0 to use the session default.
asynchronousboolFalseIf True, returns "MOVING" immediately without waiting.

OnRobot RG2 / RG6

ParameterTypeDefaultDescription
positionfloat-Target position in mm. 0 = closed, model's stroke max = fully open.
forcefloat-Gripping 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 the target 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
ValueErrorposition is negative or exceeds the configured stroke
RuntimeErrorThe gripper is not connected, or the underlying Modbus command fails

Where to Use the Skill

  • Object-specific grip width - Pre-open to just above a known object dimension before approach
  • Precise positioning - Move to an intermediate position where open and close are too coarse
  • Overlapping motion - Use asynchronous=True to move the gripper concurrently with robot motion

When Not to Use the Skill

Do not use Move Gripper when:

  • Full open or full close is all that is needed - use Tool Open or Tool Close for simplicity
  • The gripper is not connected - always call connect before issuing motion commands