Follow: clip-mic speech counts as the followed person when follow was started through it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 17:40:51 +09:00
co-authored by Claude Opus 5.5
parent 769a0ff591
commit 48724cac15
2 changed files with 11 additions and 0 deletions
+4
View File
@@ -1985,6 +1985,7 @@ class Lumi:
f"loudest {ears.last.get('peak')}{', ' + ears.last_stt['dropped'] if ears.last_stt.get('dropped') else ''})") f"loudest {ears.last.get('peak')}{', ' + ears.last_stt['dropped'] if ears.last_stt.get('dropped') else ''})")
return False return False
from tasks import follow from tasks import follow
self.last_u = u # follow_me: was "follow me" said into the clip mic?
if self.follow_filter(text, u): # following: only the followed person is listened to if self.follow_filter(text, u): # following: only the followed person is listened to
return True return True
if not follow.running(): # following: the head stays on the followed person if not follow.running(): # following: the head stays on the followed person
@@ -2017,6 +2018,8 @@ class Lumi:
"""While following: does the voice come from the person followed (the sound direction against their angle """While following: does the voice come from the person followed (the sound direction against their angle
now, within FOLLOW_VOICE_DEG)? False when it can't tell (not calibrated, unsure, not seen).""" now, within FOLLOW_VOICE_DEG)? False when it can't tell (not calibrated, unsure, not seen)."""
from tasks import follow from tasks import follow
if getattr(u, "source", None) == "clip": # no direction: theirs if "follow me" came through it too
return getattr(self, "follow_by_clip", False)
want = follow.followed_angle() want = follow.followed_angle()
if want is None or u is None or getattr(u, "mics", None) is None: if want is None or u is None or getattr(u, "mics", None) is None:
return False return False
@@ -2653,6 +2656,7 @@ class Lumi:
self.fetch_say(*why) self.fetch_say(*why)
return return
self.current, track.greeted = track, True self.current, track.greeted = track, True
self.follow_by_clip = getattr(getattr(self, "last_u", None), "source", None) == "clip"
log(f"FOLLOW person #{track.id} at {track.distance:.2f} m {track.angle:+.0f} deg") log(f"FOLLOW person #{track.id} at {track.distance:.2f} m {track.angle:+.0f} deg")
mouth.say("Okay, I'll follow you. Say stop when you want me to stay." if en mouth.say("Okay, I'll follow you. Say stop when you want me to stay." if en
else "네, 따라갈게요. 멈추려면 멈춰라고 하세요.") else "네, 따라갈게요. 멈추려면 멈춰라고 하세요.")
+7
View File
@@ -98,6 +98,13 @@ assert L.follow_stop("stop") and "follow stop" in done, done
for word in ("stop", "Stop it!", "멈춰", "wait"): for word in ("stop", "Stop it!", "멈춰", "wait"):
L = fresh(word, -70.0) L = fresh(word, -70.0)
assert L.talk_turn() and "follow stop" in done and ("act", "stop") in done and heard == [], (word, done) assert L.talk_turn() and "follow stop" in done and ("act", "stop") in done and heard == [], (word, done)
# the clip mic (no direction): the followed person's when "follow me" came through it, else unsure (dropped)
for by_clip in (True, False):
L = fresh("How far am I from you?", -70.0)
L.follow_by_clip = by_clip
lumi.ears.listen = lambda **k: ("How far am I from you?", type("Clip", (), {"source": "clip", "mics": None,
"seconds": 1.2, "during_speech": False})())
assert L.talk_turn() and heard == (["How far am I from you?"] if by_clip else []), (by_clip, heard)
# not following: today's rule, anyone is heard and looked at # not following: today's rule, anyone is heard and looked at
run["on"] = False run["on"] = False
L = fresh("What time is it?", -70.0) L = fresh("What time is it?", -70.0)