Fix come here and reach for a person seen far away

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 18:13:32 +09:00
co-authored by Claude Opus 5.5
parent c44c76db70
commit fc748e8e10
4 changed files with 40 additions and 7 deletions
+21 -2
View File
@@ -40,11 +40,17 @@ class Vision:
def present(self, t):
return t in self.tracks
visible = present
def only_seen(self):
return self.tracks[0] if len(self.tracks) == 1 else None
def to_greet(self):
return next((t for t in self.tracks if not t.greeted), None)
def only_person(self):
return self.tracks[0] if len(self.tracks) == 1 else None
def only_person(self): # as lumi.Vision: within 3 m
near = [t for t in self.tracks if t.distance <= 3.0]
return near[0] if len(near) == 1 else None
def nearest_greeted(self):
return next((t for t in self.tracks if t.greeted), None)
@@ -166,6 +172,19 @@ L.come_to(L.current, say=True)
settle()
assert moves and set(moves) == {S * -19}, moves
# ---- "come here" to the one person seen 4.7 m away, the voice unsure: drives to them (live 2026-10-28 17:42: "do you
# see me?" yes, "come here" said "I can't see you": present() ends at STAY_MAX, only_person() at 3 m) ----
goals = []
lumi.agv.go_point = lambda *a: goals.append(a) or (True, "")
L = fresh(Track(13, 187.0, 4.7))
L.current, L.voice_angle, L.voice_trusted = None, 244.0, False
base["move_status"] = "running"
threading.Timer(1.0, lambda: base.update(move_status="succeeded")).start()
L.come_to(L.current, say=True)
settle()
assert goals == [(2.0, 0.0, 0.0)] and L.current is not None and L.current.id == 13, (goals, L.current)
lumi.agv.go_point = lambda *a: (True, "")
# ---- after turning to the voice: the person nearest its side, not the nearest one far off it ----
heads = []
lumi.time.sleep, real_sleep = (lambda s: None), lumi.time.sleep
+1 -1
View File
@@ -119,7 +119,7 @@ class Track:
class Vision:
present = lambda self, t: True
present = visible = lambda self, t: True
lumi.agv.pose = lambda: (0.0, 0.0, 0.0)
+2 -1
View File
@@ -189,7 +189,8 @@ fetch.give_bearing = lambda: 0.0
L.fetch_finish = lambda how, **k: moved.append(how)
L.skill_thread, L.voice_trusted = None, False
person = types.SimpleNamespace(angle=35.0, distance=1.0, id=8)
L.vision = types.SimpleNamespace(present=lambda t: False, near_angle=lambda a, d=25: None, only_person=lambda: person)
L.vision = types.SimpleNamespace(present=lambda t: False, near_angle=lambda a, d=25: None, only_person=lambda: person,
visible=lambda t: False, only_seen=lambda: person)
L.turn_head = lambda yaw=None, pitch=None, force=False: moved.append(("head", yaw))
for patrol, angle, want in ((False, 35.0, [35.0]), (True, 35.0, [35.0]), (False, -40.0, [-40.0]), (False, -8.0, [0.0]),
(True, -8.0, [0.0])):