Update gripper geometry for the new fingers and log base notifications
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+8
-1
@@ -27,6 +27,10 @@ _guard = {"gen": 0, "held": False, "reason": None}
|
||||
# base caps navigation and joy_control by them and forgets them at its restart (its own 0.3 m/s; follow asked 0.5 and
|
||||
# drove 0.30, 2026-10-28). None: the base's own.
|
||||
max_speed = {"linear": None, "angular": None}
|
||||
# the base's notifications ("type": "notification": docking failed, no path, ...) read on this connection, oldest
|
||||
# first; robot/drive_log.py logs and clears them. Only the last NOTICES_KEEP are kept.
|
||||
notices = []
|
||||
NOTICES_KEEP = 50
|
||||
|
||||
|
||||
def set_max_speed(linear, angular):
|
||||
@@ -47,7 +51,10 @@ def _ask(command, tag, timeout):
|
||||
except json.JSONDecodeError:
|
||||
break
|
||||
buf = _conn["buf"] = buf.lstrip()[end:]
|
||||
if msg.get("uuid") == tag:
|
||||
if msg.get("type") == "notification":
|
||||
notices.append(msg)
|
||||
del notices[:-NOTICES_KEEP]
|
||||
elif msg.get("uuid") == tag:
|
||||
return msg
|
||||
chunk = s.recv(65536)
|
||||
if not chunk: # the base closed the connection: never loop forever
|
||||
|
||||
@@ -112,6 +112,9 @@ def watch(log=print):
|
||||
if down:
|
||||
log("base answering again")
|
||||
down = False
|
||||
while agv.notices: # why the base failed a move or a docking (code, words)
|
||||
n = agv.notices.pop(0)
|
||||
log(f"base: {n.get('code')} {n.get('description')} {n.get('data') or ''}".rstrip())
|
||||
for line in d.update(st, time.time()):
|
||||
log(line)
|
||||
if "seems stuck" in line and not d.drive.get("why"):
|
||||
|
||||
+3
-3
@@ -25,9 +25,9 @@ CLOSED_AI = 400 # AI_1 above this = closed on something (open reads
|
||||
# held in the cup fingers reads ~2200-2300, 2026-10-13)
|
||||
EMPTY_AI = 3900 # closed above this = nothing between the fingers (empty reads 4100-4200, noise +-50)
|
||||
AI_OPEN, AI_SHUT = 140.0, 4160.0 # AI_1 fully open / closed on nothing (2026-10-19)
|
||||
# inner gap (mm) between the fingers, (open, closed), measured with a tape 2026-10-19 (docs/gripper/README.md); the gap
|
||||
# is taken as linear in AI_1: an 82 mm metal cup read 2189-2310 (2026-10-13), the line gives 81-83 mm at the belly
|
||||
GAP_MM = {"tips": (88.0, 59.0), "belly": (96.0, 70.0), "neck": (73.0, 47.0), "shank": (66.0, 39.0)}
|
||||
# inner gap (mm) between the fingers, (open, closed), measured with a tape (docs/gripper/README.md; the straight part
|
||||
# "shank" not measured on these fingers, the earlier one kept); the gap is taken as linear in AI_1
|
||||
GAP_MM = {"tips": (89.0, 63.0), "belly": (94.0, 68.0), "neck": (57.0, 30.0), "shank": (66.0, 39.0)}
|
||||
MOVE_S = 1.5 # s a full stroke takes (measured ~1 s)
|
||||
SENSOR_DI = 0 # DI_1
|
||||
READ_TRIES, READ_GAP_S = 5, 0.1 # get_data now and then answers without the tool I/O: ask again
|
||||
|
||||
Reference in New Issue
Block a user