Skip to content

Set position range

SUMMARY

Set Position Range configures the gripper's maximum finger separation in millimeters.

Robotiq2F85 automatically sets this to 85 mm after connect. Call set_position_range_mm only if you want to adjust the default stroke.

SUPPORTED GRIPPERS

Available on Robotiq and OnRobot grippers (OnRobot enforces each model's physical stroke max).

UNITS

position_range_mm in millimeters.

The Skill

python
gripper.set_position_range_mm(85.0)

The Code

Example: Use the Default Stroke

Robotiq2F85 defaults to 85 mm after connect. The call below is shown for explicitness - it is not required under normal conditions.

python
"""
Robotiq set position range example for the Synapse SDK.

Sets the gripper stroke range.

Usage:
    python set_position_range.py --ip <ROBOT_IP>
"""

import argparse
from loguru import logger

from telekinesis.synapse.tools.parallel_grippers import robotiq


def main(ip: str):
    """Set the gripper stroke range to the gripper's max."""

    # Create and connect to the gripper
    gripper = robotiq.Robotiq2F85()
    gripper.connect(ip=ip)

    try:
        gripper.set_position_range_mm(position_range_mm=85.0)
        logger.success("Position range set to 85 mm.")
    finally:
        gripper.disconnect()


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Robotiq gripper set_position_range example")
    parser.add_argument("--ip", type=str, required=True, help="UR robot IP address")
    args = parser.parse_args()

    main(ip=args.ip)

The Explanation of the Code

set_position_range_mm sets the maximum finger separation used as the target for open and as the upper bound for move position values when the unit is "mm". It must be called after connect - it requires an active RTDE connection.

Default. Each gripper subclass sets its position range at initialization. Override only if your hardware installation uses a different stroke.

Physical stroke reference:

ModelPhysical stroke (mm)Default in subclass
Robotiq 2F-858585 (set at init)
OnRobot RG2110110 (set at init)
OnRobot RG6160160 (set at init)

How to Tune the Parameters

Robotiq 2F-85

ParameterTypeDefaultDescription
position_range_mmfloat85.0Maximum finger separation in mm. Set at initialization. Must be > 0.

OnRobot RG2 / RG6

ParameterTypeDefaultDescription
position_range_mmfloat-Maximum finger separation in mm. Set at initialization. Must be > 0.

WARNING

Calling set_position_range_mm before connect raises a RuntimeError. Always connect first.

Where to Use the Skill

  • Custom stroke - Override when the physical installation differs from the model's datasheet stroke
  • Obstacle avoidance - Restrict the range to prevent fingers reaching nearby tooling or fixtures

When Not to Use the Skill

Do not call set_position_range_mm when:

  • Using "normalized", "percent", or "device" position units - the mm range only applies when the position unit is "mm"
  • Using the default 2F-85 stroke - Robotiq2F85 sets 85 mm automatically after connect