Set Force
SUMMARY
Set Force configures the default gripping force. Call set_force only when a different session-level default is needed.
SUPPORTED GRIPPERS
Available on Robotiq (force in the configured unit, default percent) and OnRobot grippers (force in N, clamped to model max).
UNITS
force in the configured force unit (default percent for Robotiq, N for OnRobot).
The Skill
actual_force = gripper.set_force(force=60.0)The Code
Example: Set a Session-Level Force Baseline
"""
Robotiq 2F-85 set default grip force example for the Synapse SDK.
Sets the default grip force used by subsequent open/close/move calls.
Value is a percentage of the gripper's max force.
Usage:
python set_force.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 default grip force to 50%."""
# Create and connect to the gripper
gripper = robotiq.Robotiq2F85()
gripper.connect(ip=ip)
try:
actual = gripper.set_force(force=50.0)
logger.success(f"Default force set; effective: {actual}")
finally:
gripper.disconnect()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Robotiq gripper set_force 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_force stores a session-level default force. It applies to subsequent move, open, and close calls when those calls pass force=-1.0. The method returns the actual force value accepted by the backend.
Default. After connect, the force is automatically set to 100% in percent units. Only call set_force to change this default.
Force unit. Force is expressed in the unit configured by set_unit("force", ...) (default: "percent" after connect, range 0-100).
-1.0 preset passthrough. Passing -1.0 instructs the backend to keep its current internal preset without overriding it from software.
Return Value
| Type | Description |
|---|---|
float | The actual force value accepted by the backend. |
How to Tune the Parameters
Robotiq 2F-85
| Parameter | Type | Description |
|---|---|---|
force | float | Desired force in percent (0-100). Pass -1.0 to use the backend's current preset. |
OnRobot RG2 / RG6
| Parameter | Type | Description |
|---|---|---|
force | float | Desired force in Newtons. RG2 max 40 N, RG6 max 120 N. Pass -1.0 to use the backend's current preset. |
TIP
Start with a low force (20-30% for Robotiq, or ~10 N for OnRobot) for lightweight or fragile parts and increase until the grasp is secure without risking damage.
Where to Use the Skill
- Session baseline - Set once after connecting so individual
move/open/closecalls can passforce=-1.0 - Force profile switching - Re-call mid-session when switching between object types that need different gripping forces
When Not to Use the Skill
Do not call set_force when:
- Force is passed per-call - if every
move/open/closealready includes an explicitforceargument, this call is redundant - The gripper is not connected - always call
connectbefore issuing configuration commands

