Fix stop words with a call before them, low-table put-downs and battery questions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 08:13:59 +09:00
co-authored by Claude Opus 5.5
parent 122e7dec0c
commit 5754de3c67
22 changed files with 558 additions and 82 deletions
+14 -2
View File
@@ -156,7 +156,7 @@ def typed_got(r):
return (a if a == "give" else "place " + str(((r.get("task") or {}).get("on") or {}).get("name") or "")), None
if a == "carry":
d = (r.get("task") or {}).get("dest")
return f"action:go_to {d.get('name') if isinstance(d, dict) else d}", None
return f"action:go_to {d.get('marker') or d.get('name') if isinstance(d, dict) else d}", None
if a == "command": # Start sends the words to the assistant (/tasks/command):
return None, None # heard and done as by voice
return ("refuse" if r.get("talk") == "refuse" else "talk"), None
@@ -251,7 +251,7 @@ def run_case(rnd, name, c, old, use_llm):
lv = c.get("level") or bc.level_of(c, {"lang": c.get("lang")})
return {"round": rnd, "set": name, "text": c["text"], "state": c["state"], "before": c.get("before"),
"expect": c["expect"] if not mission else c["steps"], "intent": c.get("intent", ""), "map": c.get("map"),
"level": bc.LEVEL_NAME.get(lv, lv), "lang": c.get("lang"), "voice": vgot, "typed": tgot, "handed": handed,
"level": bc.LEVEL_NAME.get(lv, lv), "lang": c.get("lang"), "channel": c.get("channel") or "-", "voice": vgot, "typed": tgot, "handed": handed,
"v_canon": vc, "t_canon": tc, "v": vv, "t": tv, "src": src, "same": vc == tc,
"raw": vrow["out"].get("raw", ""), "first": vrow["out"].get("first", "")}
@@ -327,6 +327,18 @@ def report(rows, tag, secs, args):
pct = lambda j, k: f"{sum(r[k] == 'right' for r in j)}/{len(j)} ({100 * sum(r[k] == 'right' for r in j) / max(1, len(j)):.1f} %)"
out.append(f"| {lv} | {pct(jv, 'v')} | {pct(jt, 't')} | {sum(r['v'] == 'motion' for r in rr)} | "
f"{sum(r['t'] == 'motion' for r in rr)} |")
chans = sorted({r.get("channel", "-") for r in rows} - {"-"})
if chans: # r12 / r13: the words as typed or as whisper wrote them
out += ["", "By speech level and written channel (voice path right / judged; typed≠voice):", "",
"| level | " + " | ".join(chans) + " |", "|---|" + "---|" * len(chans)]
for lv in sorted({r["level"] for r in rows if r.get("channel", "-") != "-"}) + ["ALL"]:
cells = []
for ch in chans:
rr = [r for r in rows if r.get("channel") == ch and lv in ("ALL", r["level"]) and r["v"] != "llm?"]
ok = sum(r["v"] == "right" for r in rr)
cells.append(f"{ok}/{len(rr)} ({100 * ok / max(1, len(rr)):.1f} %); "
f"{sum(not r['same'] and not r['before'] for r in rr)}")
out.append(f"| {lv} | " + " | ".join(cells) + " |")
groups = collections.defaultdict(list)
for r in rows:
groups[meaning(r)].append(r)
+2 -2
View File
@@ -5,13 +5,13 @@ from assistant import battery
NOW = ["And charging?", "charging?", "battery?", "Battery", "what's your battery level?", "How much battery do you have?",
"how much battery is left", "what's your battery at", "battery percentage", "are you charging?",
"are you charging right now", "is your battery charging", "are you on the charger?", "is your battery low?",
"배터리 몇 프로야?", "충전 중이야?", "배터리 얼마나 남았어?", "배터리 상태 어때?", "지금 충전하고 있어?", "배터리는?",
"배터리 몇 프로야?", "배터리 얼만가?", "충전 중이야?", "배터리 얼마나 남았어?", "배터리 상태 어때?", "지금 충전하고 있어?", "배터리는?",
"배터리 충분해?", "충전 중이에요?", "그럼 충전은?", "충전은요?", "배터리 몇 퍼센트예요?"]
HOW_LONG = ["how long does charging take?", "How long does it take to charge?", "how long to recharge",
"what's the charging time", "충전 시간 얼마나 걸려?", "충전하는 데 얼마나 걸려요?", "충전 몇 시간 걸려?",
"완충하는 데 얼마나 걸려?", "완충까지 몇 시간이에요?", "how long does a full charge take?", "완충 시간이 얼마예요?"]
OTHER = ["How long does your battery last?", "how long on a charge?", "How long does the battery last on a full charge?",
"what kind of battery do you have", "배터리 얼마나 가요?", "한 번 충전하면 몇 시간 가요?", "배터리 용량이 얼마야?",
"what kind of battery do you have", "배터리 얼마나 가요?", "배터리 타임 얼마나 돼요?", "한 번 충전하면 몇 시간 가요?", "배터리 용량이 얼마야?",
"go charge", "충전하러 가", "How long until you need a charge?", "at what battery level do you go back to charge",
"배터리 몇 퍼센트에서 충전하러 가요?", "go to the charger", "Do you get tired?", "what time is it?", "배고파?"]
for t in NOW:
+57 -3
View File
@@ -339,7 +339,7 @@ READ = [ # the owner's Korean cup / delivery list (2026-10-26 18:40), then mor
("let me see you wave", False, "rule wave"), ("okay see you", False, "talk"), ("you come behind me", False, "rule follow"),
("here's your task: get over here", False, "talk"), ("Mina, what are you doing over there?", False, "talk"),
("민수야, 너 거기서 뭐 하고 있어?", False, "talk"), ("루미야 뭐 하고 있어?", False, "talk:status"),
("계속 들고 있어 주세요", True, "talk"), ("keep holding it", True, "talk"), ("just hold it", True, "talk"),
("계속 들고 있어 주세요", True, "talk"), ("keep holding it", True, "talk"), ("just hold it", True, "stop"), # safety first: "hold it" stops (the cup stays held)
("give it back", True, "give"), ("돌려줘", True, "give"), ("hand it back to me", True, "give"), ("그거 다시 줘", True, "give"),
("put it back where you found it", True, "place"), ("원래 있던 데 놔 주세요", True, "place"),
("할머니께 이거 전해 드려", True, "give"), ("이거 저분께 드리세요", True, "give"), ("사장님께 드려 주십시오", True, "give"),
@@ -372,7 +372,47 @@ READ = [ # the owner's Korean cup / delivery list (2026-10-26 18:40), then mor
("저한테 주실 수 있으신가요?", True, "give"), ("선생님께 드리세요", True, "give"), ("lower it down", True, "place"),
("you putt dawn that", True, "place"), ("lay it on this table lay it on this table please", True, "place"),
("왼쪽에 내려놓고 오른편 컵 잡아 줘", True, "chain"), ("put it back", True, "place"), ("제자리에 갖다 놔", True, "place"),
("pick up the cup on the left table", False, "pick cup left"), ("오른쪽 테이블에 있는 빨간 컵 집어 줘", False, "pick cup red right"),
("pick up the cup on the left table", False, "pick cup left"),
("pick up the cup over on your left", False, "pick cup left"), ("grab the cup sitting on your right", False, "pick cup right"),
("grab the cup by your side", False, "pick cup near"), ("옆에 있는 컵 집어", False, "pick cup near"),
("레프트 컵 집어", False, "pick cup left"), ("라이트 컵 집어 줘", False, "pick cup right"),
("백팩 집어 줘", False, "ask: The backpack is too big for my hand."),
# asides: said, taken back, for later, reported or read out: no motion now
("Lumi buddy, shake hands with me... ah, forget I said that", False, "talk"),
("lumi the moment the bell rings wave goodbye to us", False, "talk"),
("Lumi dear, my manager wanted you to put it down gently first thing today", True, "talk"),
("lumi on paper it is writing shake my hand", False, "talk"), ("Rumi robot hand it to me is very funny thing", True, "talk"),
("루미야 come friday lets shake hands", False, "talk"), ("동생아 너도 잘 가라고 손 흔들어 봐", False, "talk"),
("no need for you to put it down by the coffee machine today", True, "talk"),
("우리 루미~ 왼쪽에 있는 사람한테 건네 ㄱㄱ~ 는 장난 ㅋㅋ", True, "talk"),
("로봇이 하얀 탁자 위에 올려놓는 장면이 인상 깊었습니다", True, "talk"), ("들고 있는 거 나 주쇼", True, "give"),
("robot, rotate right 45 degrees, is okay for you?", False, "turn -45.0"),
("Stretch your arm out toward me, is okay for you?", False, "arm reach"),
("루미 팔 원래대로 돌려놓으실 필요는 전혀 없습니다", False, "talk"), ("루미야 team everyone put your arm down now now", False, "talk"),
("루미야잉, 담에 오른쪽으로 직각으로 돌아 줍써", False, "talk"),
("are robots like you built to stretch your arm out toward me?", False, "talk"),
("로봇 로봇이 팔 접는 걸 보니 세상 좋아졌구먼", False, "talk"),
("ㅋㅋ 손 내려 저용 이거 밈이잖아", False, "talk"), ("Robot look at me is very funnny thing.", False, "talk"),
("루미 나한테 손 내밀 수 있대 대박.", False, "talk"), ("이따밤에허리왼쪽으로60도돌려줘ㅋㅋ", False, "talk"),
("now mister robot, cup go back same place, please", True, "place"), ("허리 오른쪽으로 45도 돌여", False, "rule waist right 45"),
("lumi buddy hold it", False, "stop"), ("루미야 under no circumstances close the gripper", False, "talk"),
("Lumi, no no, not scoot left 35 cm", False, "talk"), ("손 open 돼 있어?", False, "talk"), ("그리퍼 오픈돼 있어?", False, "talk"),
("저기 컵 살포시 내려놓지는 마세요 괜찮아요", True, "talk"), ("look 60 deg to right, is okkay for you?", False, "rule look right 60"),
("Face forward again for me, possible?", False, "rule look center"), ("너 팔 접을 수 있지?", False, "talk"),
("팔 접어 줄 수 있지?", False, "arm fold"),
("죄송한데요, 고개만 돌려서 뒤가 보이십니까?", False, "talk"), ("루미야, 등 좀 보이세요", False, "talk"),
("윤년 말씀하실 때 저 좀 봐 주시겠어요?", False, "rule look me"), ("편할 때 손 흔들어 줘", False, "rule wave"),
("when you get to p1, wave", False, "talk"),
("robot turn forty-five degrees to right ah sorry no need", False, "talk"),
("루미, please 루미야 turn left — scratch that, yesterday I watched a robot turn right on TV", False, "ask: Taken back: nothing to do."),
("cup in front you pick oops I meant on paper it is writing pickup that cup by you side", False, "ask: Taken back: nothing to do."),
("Lumi bring me the cup from the exit before, very good", False, "talk"),
("mister robot you no need twist your waist 45° to the right okay okay", False, "talk"),
("go to p1, no, exit", False, "go exit"), ("turn left, I mean right", False, "turn -90.0"),
("두 시 방향에 있는 컵 집어", False, "pick cup right"), ("열 시 방향 컵 집어 줘", False, "pick cup left"),
("내 얼굴 기억해", False, "talk"),
("루미야 under no circumstances close the gripper", False, "talk"), ("go back to where you were before", False, "rule come_back"), ("Rumi dear drop the cup off at exit then come back here much obliged", False, "chain"),
("pick up the backpack", False, "ask: The backpack is too big for my hand."), ("오른쪽 테이블에 있는 빨간 컵 집어 줘", False, "pick cup red right"),
("컵이랑 같이 p5로 가", False, "fetch cup here>p5 hold"), ("컵 하고 같이 exit 가 줘", False, "fetch cup here>exit hold"),
("컵 가지고 p5에서 기다려", False, "pick cup; go p5; wait"), ("컵 들고 p5에 가 있어", False, "pick cup; go p5; wait"),
("이 컵 p5까지 좀 날라 줘", False, "fetch cup here>p5 hold"), ("컵 좀 p5로 옮겨 줘", False, "fetch cup here>p5 hold"),
@@ -433,6 +473,13 @@ for text, want in (("갤러리 투로 가 줘", "go Gallery_2"), ("갤러리 1
if got != want:
bad.append(text)
print(f"WRONG {text!r}\n want {want}\n got {got}")
server.agv.markers = lambda: ["home", "booth_3", "p5"]
for text, want in (("drop the cup off on the table at booth 3", "carry booth_3 place"), ("drop it off at booth 3", "carry booth_3 place"),
("부스 3 테이블에 놔", "carry booth_3 place")): # holding: there, never here
got = plan(text, True)
if got != want:
bad.append(text)
print(f"WRONG {text!r} (holding)\n want {want}\n got {got}")
server.agv.markers = lambda: M
@@ -450,7 +497,14 @@ STOPS = ["멈춰", "멈춰요", "멈추세요", "멈춰 주세요", "멈춰 주
STOPS_INSIDE = ["루미야 그거 말고 멈춰 지금", "아 잠깐만 멈춰 봐 위험해", "okay Lumi stop, there's someone in the way",
"wait wait stop it now", "컵 내려놓지 말고 멈춰", "야야 스톱 스톱", "저기 사람 있어 멈춰요", "no no no, stop",
"Lumi, stop, you're going to hit the table", "그만, 그만해 이제", "다 됐어 멈춰 주세요", "careful, stop!",
"멈춰버려", "동물을 멈춰버린 거랑 안해", "루미야 지금 바로 멈춰 주세요 위험해요", "stop, where are you going?"]
"멈춰버려", "동물을 멈춰버린 거랑 안해", "루미야 지금 바로 멈춰 주세요 위험해요", "stop, where are you going?",
"루미 님, 멈춰 주실 수 있겠습니까?", "오케이, 야 루미, 당장 얼른 서", "okay Lumi, can you go ahead and hold it right there?",
"야 루미 스톱", "루미야 그만해 주세요", "야 서", "lumi buddy hold it", "루미 씨 정지해 주십시오", "hey robot, freeze!",
"로봇아 움직이지 마세요", "자, 루미 님, 그만하시죠", "루미루미, 당장 멈춰 줄 수 있지?"]
for text in STOPS + STOPS_INSIDE: # the task's own words (lumi.fetch_voice): the same stop
if not lumi.stop_order(text, M):
bad.append(text)
print(f"NO STOP during a task {text!r}")
for text in STOPS + STOPS_INSIDE:
for held in (False, True):
got = plan(text, held)
+23
View File
@@ -1148,6 +1148,29 @@ skills._held.clear()
hand.update(holding=False, closed=False)
fetch._set(status="idle")
# the straight line to carry ending on the other wrist branch (the same pose, pick:502) is no carry: carry_up decides
real_rows, real_up = fetch._line_rows, skills.carry_up
wp = [("above", [0.0] * 6)]
fetch._line_rows = lambda target, label, start=None: [["to carry 20", target, [3.0] * 6, None]]
skills.carry_up = lambda above, ja: None
assert fetch._carry_ok(wp, [0.0] * 6) # ends at carry's own joints
fetch._line_rows = lambda target, label, start=None: [["to carry 20", target, [3.0, 3.0, 3.0, 183.0, -3.0, 183.0], None]]
assert not fetch._carry_ok(wp, [0.0] * 6) # the other branch, carry_up refuses
skills.carry_up = lambda above, ja: ([0.0] * 6, [3.0] * 6)
assert fetch._carry_ok(wp, [0.0] * 6) # ... or takes it by a joint move
fetch._line_rows, skills.carry_up = real_rows, real_up
# a put down gives up after PLACE_REFUSALS refused spots in a row (each costs IK time; two puts timed out, X1)
asked = []
real_opts = skills.place_options
skills.place_options = lambda x, y, top, start: (asked.append((x, y)), iter(()))[1]
fetch._line_rows = lambda target, label, start=None: (_ for _ in ()).throw(fetch.FetchError("no"))
skills._held.update(top_mm=-260.0)
assert fetch._place_at([(-100.0 - 10 * k, 640.0) for k in range(20)], -260.0) is None
assert len(asked) == fetch.PLACE_REFUSALS, asked
fetch._line_rows, skills.place_options = real_rows, real_opts
skills._held.clear()
# the lift is never asked above its limit (head camera cable, robot/head.py LIFT_MAX_MM)
assert max(fetch.LIFT_RANGE + fetch.LIFT_TRIES + (fetch.LIFT_DRIVE_MM,)) <= fetch.head.LIFT_MAX_MM == 105.0
assert fetch.head.AXIS_LIMITS[0] == (0.0, fetch.head.LIFT_MAX_MM)
+2 -1
View File
@@ -39,7 +39,8 @@ KIND = { # words (no talk before) -> kind
"아이들 옆에 있어도 안전해?": "safety", "what cameras do you have?": "cameras", "얼굴 인식 돼요?": "faces",
"컴퍼니 오픈 언제예요?": "co_founded", "참, 로봇 양반, 이름이 무슨 뜻이야?": "name_meaning", "Your voice, what program?": "tts", "들어 있는 인공지능 무엇인지 알려 주십시오": "model",
"실례합니다. 네 이름 무엇인지 알려 주십시오": "name", "바퀴 몇 개야?": "wheels", "do you have eyes?": "cameras",
"스피커 어디 있어요?": "tts", "Is it safe for kids to be near you?": "safety",
"스피커 어디 있어요?": "tts", "배터리 타임 얼마나 돼요?": "battery_life", "랭귀지 뭐 할 수 있어?": "languages",
"Is it safe to stand next to you?": "safety", "Is it safe for kids to be near you?": "safety",
}
IN_TALK = { # words after TALK -> kind or None
"how old are you?": "age", "who made you?": "maker", "what's your name?": "name",
+6
View File
@@ -84,6 +84,12 @@ def main():
("What is salt for?", "ACTION: none -\nSeasoning."), ("ok", "ACTION: none -\nSure.")]
assert "most common" in b._back_to("again about hydrogen, what did you say?")
h = [("남극은 얼마나 추워?", "ACTION: none -\n영하 89도까지 내려가요."), # "really?" after a refused order:
("춤 좀 춰 봐", "ACTION: none -\n저는 바퀴로 움직여서 춤은 못 춰요.")] # the talk before it; "why not?": the refusal
assert brain.topic_turn(h, "어이, 진짜?")[0] == "남극은 얼마나 추워?"
assert brain.topic_turn(h, "저기 루미 왜 안 돼?")[0] == "춤 좀 춰 봐"
assert brain.topic_turn(h)[0] == "춤 좀 춰 봐"
picked = []
talk_examples.pick = lambda said, lang, k=4, bank=None: picked.append(bank) or []
brain._examples("윤초는 뭐예요?", world=True)