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.
speedfloat | NoneNoneMotion speed in the configured speed unit (default percent, 0-100). None uses the speed set with Gripper Set Speed, which is 100 % after connecting.
forcefloat | NoneNoneGripping force in the configured force unit (default percent, 0-100). None uses the force set with Gripper Set Force, which is 100 % after connecting.
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 | NoneNoneGripping force in Newtons, clamped to the model's max force. None uses the force set with Gripper Set 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, or (MODBUS_RTU, synchronous only) it reports a major fault, does not acknowledge the command within 1 s, or does not stop within 5 s. Call Gripper Recover From Fault to reset a fault
OSError(MODBUS_RTU) The serial link fails after the Modbus retries

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

Isaac Sim motion completion

In Isaac Sim, a blocking call finishes when the fingers reach the target, which returns "AT_DEST", or when they stall. A driver joint that stays within 0.01 % of its travel for 0.25 simulation seconds, across five distinct physics updates, counts as stalled and returns the object-stop status for the commanded direction. A stall means the motion was blocked, not that an object is verified, so confirm with Gripper Get Part Present.

If the bridge's 1,800-update motion limit is exhausted, the call raises RuntimeError. Paused or repeated physics states cannot complete a move, and asynchronous=True returns "MOVING" immediately. This applies to simulated parallel grippers only, not to suction grippers, robot commands or hardware, and needs a recent Isaac Sim bridge.

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