Get Current Position
SUMMARY
Get Current Position reads the current finger separation of the gripper in the configured position unit (default: millimeters).
SUPPORTED GRIPPERS
Available on Robotiq (returns in the configured position unit) and OnRobot grippers (always returns mm).
UNITS
Returns finger separation in the configured position unit (default mm after connect).
The Skill
position = gripper.get_current_position()The Code
Example: Read Position After a Move
"""
Robotiq read current position example for the Synapse SDK.
Reads the gripper's current position in the configured unit (normalized
or mm).
Usage:
python get_current_position.py --ip <ROBOT_IP>
"""
import argparse
from loguru import logger
from telekinesis.synapse.tools.parallel_grippers import robotiq
def main(ip: str):
"""Read the gripper's current position in the configured unit."""
# Create and connect to the gripper
gripper = robotiq.Robotiq2F85()
# Connect to the gripper
gripper.connect(ip=ip)
try:
# Read and report the current position
logger.success(f"Current position: {gripper.get_current_position()}")
finally:
# Disconnect cleanly even if there was an error
gripper.disconnect()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Robotiq gripper get_current_position 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
get_current_position queries the gripper backend for the current finger separation and returns it in the active position unit set by set_unit. The default after connect is "mm".
Position unit. The returned value follows whichever unit was last configured via set_unit("position", ...). Call set_unit("position", "mm") before reading if millimeters are expected.
Grasp detection. After close, a returned position significantly above zero indicates the fingers stopped against an object. A value near zero means the gripper closed fully without contact.
Return Value
| Type | Description |
|---|---|
float | Current finger separation in the configured position unit. |
How to Tune the Parameters
No parameters.
TIP
Compare the returned position against a threshold rather than an exact value - hardware-level variation means the reading will vary slightly between calls.
WARNING
get_current_position raises a RuntimeError if the gripper is not connected. Always call connect before reading position.
Where to Use the Skill
- Grasp verification - Confirm an object is held before transporting
- State inspection - Read gripper position at any point in a workflow for logging or branching logic
- Closed-loop control - Combine with
moveto implement position-feedback loops
When Not to Use the Skill
Do not use Get Current Position when:
- The gripper is not connected - always call
connectbefore issuing gripper commands - High-frequency polling is required - repeated queries add latency; use asynchronous motion and a single readback instead

