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
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.
"""
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:
| Model | Physical stroke (mm) | Default in subclass |
|---|---|---|
| Robotiq 2F-85 | 85 | 85 (set at init) |
| OnRobot RG2 | 110 | 110 (set at init) |
| OnRobot RG6 | 160 | 160 (set at init) |
How to Tune the Parameters
Robotiq 2F-85
| Parameter | Type | Default | Description |
|---|---|---|---|
position_range_mm | float | 85.0 | Maximum finger separation in mm. Set at initialization. Must be > 0. |
OnRobot RG2 / RG6
| Parameter | Type | Default | Description |
|---|---|---|---|
position_range_mm | float | - | 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 -
Robotiq2F85sets 85 mm automatically afterconnect

