Skip to content

Gripper Set Speed

SUMMARY

Set Speed configures the default finger motion speed.

UNITS

speed in the configured speed unit (default percent).

The Skill

python
actual_speed = gripper.set_speed(speed=50.0)

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 setting the default speed of a parallel gripper.

Supports only Robotiq grippers, and Isaac Sim.

Usage:
    python set_speed.py --ip <GRIPPER_IP>
    python set_speed.py --protocol MODBUS_RTU --serial-port COM4
    python set_speed.py --prim_path <PRIM_PATH>

Note:
    The simulation does not model gripper speed, so in Isaac Sim this call is
    accepted but has no effect on the motion.

    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 robotiq


def main(ip: str | None,
         serial_port: str,
         protocol: str,
         prim_path: str | None) -> None:
    """Sets the default speed of a Robotiq gripper to 50%."""

    #===================== Create Gripper ======================================
    gripper = robotiq.Robotiq2F85()

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

        # ==================== Run Skill ====================================
        actual = gripper.set_speed(speed=50.0)
        logger.success(f"Default speed set; effective: {actual}")
    except (ConnectionError, OSError) as e:
        logger.error(f"Error occurred: {e}")
    finally:
        gripper.disconnect()


if __name__ == "__main__":
    p = argparse.ArgumentParser(description="Robotiq gripper set speed")
    p.add_argument("--protocol",
                   choices=["URCAP", "MODBUS_RTU"],
                   default="URCAP")
    p.add_argument("--ip", default=None, help="IP for Robotiq Gripper")
    p.add_argument("--serial-port", dest="serial_port", default="COM4",
                   help="Serial port for MODBUS_RTU")
    p.add_argument("--prim_path", type=str, default=None,
                   help='Isaac Sim gripper prim path, e.g. "/World/robotiq_2f85"')
    args = p.parse_args()

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

Running the Example

bash
python set_speed.py --ip 192.168.1.100
bash
python set_speed.py --prim_path /World/robotiq_2f85

For all options:

bash
python set_speed.py --help

Parameter Configuration

Robotiq 2F-85

ParameterTypeDefaultDescription
speedfloatrequiredDesired speed in percent (0-100). Pass -1.0 to use the backend's current preset.

OnRobot RG2 / RG6

Speed control is not supported. OnRobot grippers move at a fixed internal rate - speed commands are silently ignored.

Returns

TypeDescription
floatThe actual speed value accepted by the backend (may be clamped).

Raises

Robotiq 2F-85

ExceptionCondition
RuntimeErrorThe gripper is not connected

OnRobot RG2 / RG6

ExceptionCondition
TypeErrorspeed is not numeric

How to Tune the Parameters

For pick-and-place of rigid objects, keep speed at 100% to minimise cycle time. For fragile or deformable objects, reduce to 20-40%.

Where to Use the Skill

  • Fragile objects - Reduce speed to lower contact impact force when closing on delicate parts
  • High-throughput tasks - Set to 100% to minimise open/close cycle time
  • Backend-controlled speed - Pass -1.0 to respect a speed preset configured on the gripper hardware

When Not to Use the Skill

Do not call set_speed when:

  • The default speed is acceptable - Robotiq defaults to 100% after connect; only call if a different speed is needed
  • Speed is passed per-call - if every move/open/close already includes an explicit speed argument, this call is redundant