Fix bugs found in review, with tests and docs for the four modes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 16:47:15 +09:00
co-authored by Claude Opus 5.5
parent a6094568d0
commit ed2c6bdafd
10 changed files with 592 additions and 69 deletions
+35
View File
@@ -0,0 +1,35 @@
# Lumi's four modes
Four switches (dashboard, the Lumi app, `POST /assistant/modes`): **Greeter**, **Patrol**, **Wave** (`wave_greet`),
**Welcome** (`welcome`). Each works on its own, any mix may be on; `lumi.py` runs while any of them is on and stops
when all four are off (the hand comes down first). Owner's rules of 2026-11-16.
| Mode | What Lumi does |
|---|---|
| **Greeter** | Stays where it is and does everything except going somewhere: greets people who come close, talks, answers, sings, arm moves, "look at me". An order to go somewhere is refused ("switch on Patrol"). |
| **Patrol** | Everything Greeter does, plus drives and whole tasks (go to a point, routes and loops, fetch, missions). |
| **Wave** | Alone: the hand is always up in `wave_start` (also on drives, e.g. a dashboard loop of markers); a new person 0.8 to 6 m on the way: stop, 3 waves, drive on (each person once, until they leave the cameras' view); someone waving 1 to 5 m: turn to them and wave back while they wave; keep alive. Near home on the way to the charger it ignores people. With Greeter or Patrol on too: it only answers people who wave (on a drive it stops, raises the hand, waves, lowers it slowly to look, drives on); no waves at everyone, no keep alive. |
| **Welcome** | Only on the charger (it can't be switched on elsewhere): waves at each new person 0.8 to 6 m, waves back at people who wave 1 to 5 m, keep alive. |
**The hand:** on the charger it rests up in `wave_start`, with or without Welcome, and the next moves start from
there. Wave alone: always up. Greeter or Patrol on (also with Wave): a drive starts by lowering it slowly to `look`,
and the drive and its orders go on from `look`.
**Talk:** with only Wave and/or Welcome on, Lumi does not talk, take wake words or orders; it only waves. With Greeter
or Patrol on too, it greets, talks and does orders; a conversation comes first and the waving waits. Called while
driving (Greeter or Patrol), it stops, talks, and drives on to the same place after the conversation.
**Blocked way:** Lumi says so aloud (also with only Wave on) and tries the same place again until the way is free (a
loop, or a Wave trip; a single trip by voice waits for "try again" / "go around it").
**Keep alive** (part of Wave alone and Welcome, no switch): any wave starts a 30 s count. 30 s without a wave: on the
way, Lumi stops, turns toward the nearest person it sees at any distance (else straight ahead), waves 3 times and
drives on; at home it does that every 15 s until someone comes into range or waves.
**Safety:** the arm waves only with the base stopped (it waits for the base to stand), with nobody within 0.8 m
(`IDLE_CLEAR_M`), not while holding something, not in a conversation or task; a new drive waits for the swings to end.
STOP stops everything and switches Wave and Welcome off. Collision limits in Cobo π are still the defaults: test with
someone at STOP.
Values: `tasks/wave_greet.py` and `assistant/lumi.py`, listed in [TUNING.md](TUNING.md). The same text is in the Lumi
app repository, `docs/LUMI_MODES.md`.
+3 -3
View File
@@ -199,7 +199,7 @@ Every value here is a constant at the top of its file, with a comment on what it
| File | Name | Default | What it does |
|---|---|---|---|
| `tasks/wave_greet.py` | `GREET_MIN_M`, `GREET_M` | 1.0 m, 5.0 m | People waving nearer or further away are not answered (camera depth; without depth there, the shoulder width with `SHOULDER_M` 0.36 m) |
| `tasks/wave_greet.py` | `PASSER_M` | 5.0 m (`GREET_M`) | A drive's stop and wave for people passing: someone this near and nobody within `IDLE_CLEAR_M` (1 m) |
| `tasks/wave_greet.py` | `PASSER_MIN_M`, `PASSER_M`, `IDLE_CLEAR_M` | 0.8 m, 6.0 m, 0.8 m | Wave: a drive's stop and wave for someone new passing this near (each person once, `_passed`, forgotten `GONE_S` after they leave the view); Welcome: the same range at home; nobody within `IDLE_CLEAR_M` when a wave starts (owner, 2026-11-16; was 1 m) |
| `vision/waving.py` | `FLOW_PX`, `FLOW_SHOULDER_PX` | 1.0 px, 80 px | Hand flow per frame that counts as a swing, for a person this wide at the shoulders; smaller (further) people need proportionally less |
| `tasks/wave_greet.py` | `GONE_S` | 10 s | A greeted person out of both cameras' view this long is forgotten: their next wave gets an introduction again |
| `tasks/wave_greet.py` | `HOLD_S` | 15 s | The waist stays on the last person who waved this long, then turns back to its rest; the hand stays up and the idle swings start at once |
@@ -210,8 +210,8 @@ Every value here is a constant at the top of its file, with a comment on what it
| `robot/gripper.py` | `FITTED` | False | The gripper is on the flange; while it is off AI_1 floats and is never read as closed or holding. True when it is back on |
| `tasks/wave_greet.py` | `NEW_WAVE_S` | 5 s | No waving this long: the next wave gets a new greeting line |
| `tasks/wave_greet.py` | `JOKE_AFTER_S`, `JOKE_EVERY_S` | 10 s, 12 s | Waving on and on: the first joke after this long, then one every this long |
| `tasks/wave_greet.py`, `assistant/lumi.py` | `IDLE_WAVE_EVERY_S`, `IDLE_SWINGS`, `IDLE_AFTER_S` | 15 s, 3, 15 s | On the charger with the wave greeting on and nothing said to Lumi for `IDLE_AFTER_S`: the hand goes up and stays up, this many swings every `IDLE_WAVE_EVERY_S`; a call stops the swings (the hand stays up), a drive or an arm order takes it down. Estimates |
| `assistant/lumi.py` | `PASSER_WAVE_EVERY_S`, `PASSER_MARKERS`, `DOCK_QUIET_M` | 15 s, "line", 2 m | With the wave greeting on, the empty arm drives with the hand up (`wave_start`). On the way to markers whose names start with `PASSER_MARKERS`, and on every leg of a there-and-back route loop, the base stops for anyone 1–5 m away and waves (`PASSER_M`); to other markers only for someone waving; at most every `PASSER_WAVE_EVERY_S`; never nearer than `DOCK_QUIET_M` to the dock (a stop there undoes the docking). Estimates |
| `tasks/wave_greet.py` | `KEEP_QUIET_S`, `IDLE_WAVE_EVERY_S`, `IDLE_SWINGS` | 30 s, 15 s, 3 | Keep alive (owner, 2026-11-16): Wave on the way, `KEEP_QUIET_S` without a swing: the base stops, this many swings toward the nearest person at any distance (else ahead), drives on. Welcome on the charger: the hand up at once and held; `KEEP_QUIET_S` after the last wave at people (and nothing said to Lumi), these swings every `IDLE_WAVE_EVERY_S` |
| `assistant/lumi.py` | `PASSER_WAVE_EVERY_S`, `DOCK_QUIET_M` | 5 s, 2 m | With Wave on, the empty arm drives with the hand up (`wave_start`); every drive (a point, a route, a loop) stops for someone new passing (`PASSER_M`) and for keep alive; at most every `PASSER_WAVE_EVERY_S` (a stop that could not wave does not repeat at once); never on the dock leg or nearer than `DOCK_QUIET_M` to the dock (a stop there undoes the docking). `PASSER_MARKERS` is no longer used |
| `assistant/lumi.py` | `PASSER_MAX_M`, `PASSER_EVERY_S`, `PASSER_DEG` | 4 m, 2 s, 10° | On the charger with nobody talking to Lumi: the head turns to the nearest person this near, at most this often, when they are this far off where it looks (the body stays). Estimates |
| `tasks/wave_greet.py` | `WAIST_MAX_DEG` | 30° | The waist turns toward a waving person this far from the front at most; the head covers the rest. Estimate |
| `tasks/wave_greet.py` | `WAIST_MIN_DEG` | 10° | A person nearer the front than this: only the head turns, not the waist |