Keep the hand raised on the charger with steady greeting waves

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 10:11:44 +09:00
co-authored by Claude Opus 5.5
parent 2d92ba1f13
commit 924f880524
8 changed files with 111 additions and 44 deletions
+3 -1
View File
@@ -19,6 +19,8 @@ import time
from robot import arm
FITTED = False # the gripper is on the flange; False while it is off: AI_1 then floats (~486) and must
# not read as "closed on something" (that refuses every wave). True again when it is back on
TOOL = 1 # set_digital_output type: 0 cabinet, 1 tool (TIO), 2 extended
CLOSE_DO, OPEN_DO = 0, 1 # DO_1, DO_2 (0-based)
CLOSED_AI = 400 # AI_1 above this = closed on something (open reads 130-165; an 82 mm metal cup
@@ -42,7 +44,7 @@ def state():
time.sleep(READ_GAP_S)
else:
raise ConnectionError("the arm controller sends no tool I/O")
ai = d["tio_ain"][0]
ai = d["tio_ain"][0] if FITTED else AI_OPEN
return {"closed": ai > CLOSED_AI, "holding": CLOSED_AI < ai < EMPTY_AI, "object_in_front": bool(d["tio_din"][SENSOR_DI]),
"ai": d["tio_ain"], "do": d["tio_dout"], "di": d["tio_din"], "gap_mm": round(gap_mm(ai))}