Get Part Present
SUMMARY
Get Part Present reports whether a suction gripper currently detects a held part.
This skill is used to verify grasp success immediately after grasp, or to detect a dropped part mid-transit.
SUPPORTED GRIPPERS
Available on Piab suction grippers.
The Skill
python
part_present = gripper.get_part_present()The Code
Example: Verify Grasp Success
python
"""
Piab get_part_present example for the Synapse SDK.
Grasps an object, then checks whether the grasp succeeded.
Usage:
python get_part_present.py --ip <ROBOT_IP>
"""
import time
import argparse
from loguru import logger
from telekinesis.synapse.tools.suction_grippers import piab
def main(ip: str):
"""Grasp, then verify a part is present."""
# Create and connect to the gripper
gripper = piab.PiabPiCobotElectric()
gripper.connect(ip=ip, protocol="URCAP")
try:
gripper.grasp()
time.sleep(0.5) # allow vacuum to build
if gripper.get_part_present():
logger.success("Part detected - grasp succeeded.")
else:
logger.warning("No part detected - grasp failed.")
finally:
gripper.disconnect()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Piab gripper get_part_present example")
parser.add_argument("--ip", type=str, required=True, help="UR controller IP address")
args = parser.parse_args()
main(ip=args.ip)The Explanation of the Code
get_part_present reads the gripper's raw status and returns True if it begins with "P" (part present), False if it is exactly "F" (fault/no part) or begins with any other character. Call it a short time after grasp to allow vacuum to build before checking - calling it immediately may report a false negative while pressure is still ramping.
Return Value
| Type | Description |
|---|---|
bool | True if a part is currently detected, False otherwise. |
Where to Use the Skill
- Grasp verification - Confirm a pick succeeded before moving away from the pick location
- In-transit monitoring - Poll periodically during a move to detect a dropped part early
When Not to Use the Skill
Do not use Get Part Present when:
- The gripper is not connected - always call
connectbefore issuing commands - Checking immediately after
grasp- allow a brief settle time for vacuum to build before checking, or the result may be unreliable

