Commands: full turn as two checked half turns, 'let's go p5' rule, dashboard Command box applies corrections, put it back, pairs of non-task commands asked

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 10:16:29 +09:00
co-authored by Claude Opus 5.5
parent d8b11176fe
commit 8a81979bad
14 changed files with 151 additions and 37 deletions
+20 -6
View File
@@ -863,14 +863,17 @@ class Lumi:
if action == "move" and not driving.MOVE_MIN_M <= amount <= MAX_MOVE_M:
log(f" move {amount:g} m: outside {driving.MOVE_MIN_M:g}..{MAX_MOVE_M:g} m, not driven")
return False
if action == "move" and direction in ("back", "forward"): # straight with joy_control, checked like a
from tasks import fetch # mission's move: navigation may turn round and
log(f" move {direction} {amount:g} m straight") # stops within its own tolerance
self.stay()
full = action == "turn" and amount >= 360 # all the way round: a 360 deg goal is the start
if action == "move" and direction in ("back", "forward") or full: # pose to navigation; fetch turns twice 180
from tasks import fetch # straight with joy_control, checked like a
log(f" {action} {direction} {amount:g} by the task runner") # mission's move: navigation may turn round
self.stay() # and stops within its own tolerance
step = {"do": "turn", "deg": -360.0 if direction == "right" else 360.0} if full else \
{"do": "move", "dir": direction, "m": amount}
try:
fetch.run_steps([{"do": "move", "dir": direction, "m": amount}], say=self.fetch_say)
fetch.run_steps([step], say=self.fetch_say)
except fetch.FetchError as e:
log(f" move {direction} refused: {e}")
log(f" {action} {direction} refused: {e}")
self.fetch_say(str(e), "죄송해요, 지금은 할 수 없어요.")
return False
return True
@@ -1345,6 +1348,9 @@ class Lumi:
if unread:
log(f" mission: unread {unread} ({by})")
problem = brain_mod.place_problem(" ".join(unread), self.markers) # "go to booth" with two booths
if not problem and not got:
problem = ("Sorry, I can do only one of those at a time. Please ask me one thing at a time.",
"죄송해요, 한 번에 하나씩만 할 수 있어요. 하나씩 말씀해 주세요.")
if not problem and all(brain_mod.intent(u, self.markers) for u in unread):
problem = (f"Sorry, I can't do that as part of a task: {', '.join(unread)}. Please ask me one thing at a time.",
"죄송해요, 그건 작업 중에 함께 할 수 없어요. 하나씩 말씀해 주세요.")
@@ -2038,6 +2044,8 @@ class Lumi:
if action == "turn":
say_en = "Okay, turning around." if d == "around" else f"Okay, turning {d}."
say_ko = "네, 뒤로 돌게요." if d == "around" else ("네, 왼쪽으로 돌게요." if d == "left" else "네, 오른쪽으로 돌게요.")
if n == "360":
say_en, say_ko = "Okay, turning all the way around.", "네, 한 바퀴 돌게요."
else:
exact = driving.amount(brain_mod._norm(text))[1] # "about 5 centimetres" for "a tiny bit"
say_en, say_ko = (driving.say_move(d, float(n), exact, lang) for lang in ("en", "ko"))
@@ -2611,6 +2619,8 @@ def talk_fate(text):
return "talk"
KO_ORDER = {"보": "봐", "흔들": "흔들어", "돌": "돌아", "올리": "올려", "내리": "내려", "높이": "높여", "낮추": "낮춰"} # "나 보고 손 흔들어": 나 봐
ONE_AT_A_TIME = {"look", "lift", "wave", "turn", "move", "come", "follow", "go_to", "arm", "pick", "put", "move_object"}
NOT_A_STEP = re.compile(r"^\W*(?:(?:please|and|then|also)\s+)*(?:dance|jump|fly|swim|climb|sit(?: down)?|sleep|cook|draw|"
r"sing|clap|spin|bow|kneel|do a (?:dance|flip|trick)|tell|ask|say|show|call|find|look for|search|"
r"bring|take|give|hand|put|carry|deliver)\b|.*(?:춤|점프|날아|수영|박수)", re.I) # a part not read: asked
@@ -2631,6 +2641,10 @@ def read_mission(text, markers):
elif unread and got and any((brain_mod.intent(u, markers) or ("",))[0] not in ("", "weather", "search", "fetch")
or NOT_A_STEP.match(u) for u in unread):
return got, unread, by # "go to the stage and wave": no task step, asked, never half done
elif unread and not got and len(unread) > 1 and sum((brain_mod.intent(u, markers) or brain_mod.intent(
re.sub(r"(보|흔들|돌|올리|내리|높이|낮추)고$", lambda m: KO_ORDER[m.group(1)], u), markers) or ("",))[0] in ONE_AT_A_TIME
for u in unread) > 1:
return got, unread, by # "look at me and wave", "웨이브 하고 나 봐": asked, not the first only
elif unread:
return None # "come here, I need help": the old paths (rules, the LLM) answer it
if not got: