Commit Graph
273 Commits
Author SHA1 Message Date
apirroneandClaude Opus 5.5 2b226332e6 robot.health carries the battery's Goal PWM; robotctl monitor shows it
HealthResult::goal_pwm (API_VERSION 62): the Goal PWM robotd last wrote
while bus.battery_voltage_based_pwm_limit is on, absent when off.
robotctl monitor shows it on the power row beside the battery, as
"pwm 81% (718)", and only when robotd sends it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:28:35 +09:00
apirroneandClaude Opus 5.5 843a2340d8 nfc: read a tag on request — robotctl nfc-read, duckctl nfc-read
`nfc.read` on nfcd's socket reads the next tag touched, or one already on
the reader, and answers with its UID and NDEF text/URI records. It waits,
quacks and keeps the tag from being acted on just as a write does, so a
pairing or mode tag can be checked without it pairing or switching. A tag
that moves mid-read is read again on the next poll until the wait runs out.

API_VERSION 61: a v60 nfcd answers nfc.read METHOD_NOT_FOUND, by name.
btd carries it; mediad does not. every_call() gains NfcWrite, which it was
missing, and NfcRead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:40:37 +01:00
apirroneandClaude Opus 5.5 911c0933e7 Merge main into autonomous-revive: soccer, map and autonomy move to API v58-v60
main took v57 (a join's progress). Type 5 tag writing keeps refusing
MIFARE Classic; pad-map's cfg.skill keeps soccer's bumper kicks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 11:05:06 +01:00
Pierre Rouanet 6eab9f3ddd Merge pull request #579 from pollen-robotics/net-join-progress
net.status reports the join in flight
2026-11-12 17:49:14 +01:00
apirroneandClaude Opus 5.5 fa16f967ed autod: the duck chases the laser and plays with the ball; a tag switches it on
The brain gains two states, both driven by robotd and wanted by the brain:

- Laser: tracking is on whenever the duck could chase (not tired, not
  napping, petted or playing ball). A followed dot interrupts any
  standing or walking state; the chase ends 2 s after the dot goes, and
  costs twice a walk's energy. Below 0.2 the laser goes off and the duck
  naps; it comes back above 0.45.
- BallPlay: picked from the standing pool when rested and off cooldown,
  less often the more bored of the ball. No ball in 20 s backs off 3 min,
  doubling per miss up to 30. A game ends on 3-8 kicks, 1-3 min shrunk by
  boredom, the ball lost for 15 s, or tiredness; then 4-8 min of rest.

While robotd drives either, autod sends a zero twist and a centred head,
which robotd reads as nobody asking. A game somebody else started is
stood aside for, and the brain's own is switched off when the pad takes
over.

The on/off switch moves into robotd (robot.autonomous, read back in
robot.mode and robot.state; part of v59), so the NFC autonomous_mode tag
can switch it — nfcd cannot write robotd.toml. [autonomous] enabled is
now only where each boot starts; robotctl autonomous on|off switches it
now. autod stands the robot up on the switch's rising edge, and once per
boot for the switch at boot. padd learns it from robot.mode. mapd starts
mapping the first time it sees the duck switched on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:27:01 +01:00
apirroneandClaude Opus 5.5 7bc9fb2e26 Merge autonomous-mode (autod) into autonomous-revive: the brain is API v59
The October brain, brought up to main. Beyond the conflicts:

- The pad's handoff (silent until touched, lets go after pad_idle_s) is
  now pad_map::engage, since main moved padd's mapping into pad-map. A pad
  nobody was touching going away no longer sits the robot down: the brain
  was driving, not the pad.
- autod walks at the pad's [pad_drive] full stick rather than the removed
  robotd_params::drive constants.
- [map]'s template values are commented out like [laser] and [soccer]:
  they never shipped live, so they do not belong in EVER_SHIPPED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:01:35 +01:00
apirroneandClaude Opus 5.5 5076bb6542 Merge maploc-v2 (maploc, mapd) into autonomous-revive: map.* is API v58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:52:01 +01:00
apirroneandClaude Opus 5.5 b2f2f9fc40 Merge nfc-mode-tags (soccer, mode tags) into autonomous-revive: soccer is API v57
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:48:04 +01:00
apirroneandClaude Opus 5.5 ddaf884ea1 soccer: kick through the gait's sway, and from a stall short of the spot
On the robot it walked to the ball and never kicked, while LB/RB did —
so the kick was never asked: the ball never sat in the kick spot
(±4 × ±2.5 cm) for settle_ms in one go.

Two ways that happens, both handled. The gait sways the trunk a
centimetre or two a step even standing, and every sway out of the spot
restarted the settle: now the spot is left only past twice the
tolerances. And the last centimetres ask for less speed than the gait
walks, so the robot stops just short: within twice the tolerances for
`[soccer] stall_ms` (1.5 s) it now kicks from there.

`robot.state`'s soccer block gains `spot_m`, the ball's offset from the
kick spot, shown by `robotctl soccer` — what to read when it stands at
the ball and does not kick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:09:42 +01:00
Pierre Rouanet 3fd36274a9 net.status reports the join in flight
net.connect answers once, after up to 55s. While it runs, net.status now
carries `joining: {ssid, step, elapsed_seconds, timeout_seconds}`, with
step one of scanning, associating, authenticating, key_rejected,
addressing. configd's connect fills it: the scan first, then the
device transitions it already subscribes to. A Join handle clears the
slot on drop, so every return path clears it.

duckctl wifi connect polls it every 2s on the same BLE session and
prints each step change; robotctl net status shows it. FakeNet walks
the same steps and can hold a join at one, which is how the tests see
a join in flight.

API v57: additive, absent from an older configd.

Assisted-by: Claude:claude-opus-5-5
2026-11-12 15:32:08 +01:00
Pierre Rouanet 8257ce5d96 nfc-flash asks for a tag, not an NTAG
Assisted-by: Claude:claude-opus-5-5
2026-11-12 15:06:35 +01:00
Pierre Rouanet d73f66bd80 nfc: write Type 5 (ISO 15693) tags, formatting a blank one
nfc.write refused every Type 5 tag. A blank one is also the tag no phone
app will format unless it knows the maker (manufacturer 0x48 here: not
NXP, not ST), so the robot was the only writer left and it said no.

vtag now writes with WRITE SINGLE BLOCK. A formatted tag keeps its
capability container; a blank one gets a 4-byte container granting read
and write, sized from GET SYSTEM INFO or MLEN 0 when the tag keeps its
size to itself. Block 0 goes last, and the message is read back.

Assisted-by: Claude:claude-opus-5-5
2026-11-12 15:01:25 +01:00
Pollen-CocoandClaude Opus 5.5 b7aafe5098 nfc: write a tag — robotctl nfc-flash, and duckctl over Bluetooth
`nfc.write { text, timeout_s }` (API v55) has nfcd write the text onto the
next NTAG touched to the head, or one already on the reader, as one NDEF
text record, then read it back. The robot quacks when it took. While a
write waits, a touched tag is written rather than acted on, and the tag
just written is not then read as a touch, so writing a pairing tag does
not pair.

nfcd serves it on its own socket, /run/nfcd/nfc.sock (group robot, 0660),
from threads that hand each write to the poll loop, which owns the reader.
`robotctl nfc-flash <text>` asks it there; btd now holds a fourth socket
and permits nfc.write over BLE, so `duckctl nfc-flash <text>` does the same
from a laptop. mediad refuses it: someone has to be at the robot to touch
a tag.

Only Type 2 is written. The capability container decides: a MIFARE Classic
or an e-ink refuses its READ, an unformatted or read-only tag says so, a
text longer than the tag is refused, all before any page is written. Pages
0-3 and the configuration pages are never written, so a write cannot lock
a tag. The WRITE's four-bit ACK is taken loosely — a reader may not frame
it — and the read-back is what says the tag holds the text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 15:10:07 +08:00
apirroneandClaude Opus 5.5 13ebe9c5bb Soccer mode: kicks on the bumpers, and a robot that plays by itself
Two switches in robotd, set by `robot.soccer {active, autonomous}`:

- soccer mode: the pad's LB/RB run kick_left/kick_right whatever they
  are bound to, and D-pad down starts autonomous play instead of
  body + head;
- autonomous: the robot turns until it sees the purple ball, walks to
  it, steps sideways until the ball is in front of the foot on its
  side, kicks, and looks again. Any pad button takes it back to manual,
  and that press does nothing else. A pushed stick wins over it, as
  over the laser.

mediad finds the ball (`media.ball`, beside `media.laser`, sharing its
look loop): purple is the hue with both chromas above grey; passing
cells on a 4x4 grid are grouped into blobs, and a blob is the ball when
big enough, filled and round — a ball cut by the frame's edge keeps its
centre and radius from its uncut sides. Every look carries the most
purple colour seen, passed or not, for tuning. robotd projects the
centre onto the plane a radius above the floor with the laser's own
projection, now shared, and carries it by odometry through the last
steps where the ball is under the beak.

The pads learn soccer mode from `robot.mode`, which they already poll
each second — so an NFC tag switching it reaches the pad. Soccer and
laser tracking switch each other off. `[soccer]` holds the detector
thresholds, the kick spot and the gains, all live; `robotctl soccer
on|auto|off` switches it and is the tuning view; the web console draws
the ball.

API_VERSION 54: `robot.soccer`, `robot.mode`'s `soccer`,
`robot.state`'s `soccer` block, `media.ball` / `media.ballSeen`.

Colour thresholds are a first guess; to be tuned on camera images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:25:32 +01:00
Pierre Rouanet 6bb6c67613 Merge pull request #556 from pollen-robotics/codex/secure-media-and-ble-defaults
Secure media and BLE access by default
2026-11-10 13:58:50 +01:00
Pierre Rouanet ac535e98e8 setup-code install: refuse on an EEPROM holding an unreadable code
While the EEPROM holds something that is not a valid code, export uses
no key at all, so a key installed beside it would be reported as
installed and never used. Refuse with the EEPROM's error instead, and
document that such a robot stays reachable over Bluetooth with its
label PIN.

Assisted-by: Claude:claude-opus-5-5
2026-11-10 12:23:05 +01:00
Pierre Rouanet ffe36488cb Setup code: a separator after the label serial, and the whole line in the QR
The EEPROM line is now <label serial>:md1:<first name>:<64 hex>, with
the code from offset 19, and the QR printed on the robot carries that
whole line. A colon after the serial with no code, or a code with no
colon (the previous layout), is an error rather than a code read one
byte off. `robotctl system setup-code` shows the same line, so a dev
board's QR goes through the same app path as a factory label; at
error correction L that is version 5, 82 columns at worst.

Assisted-by: Claude:claude-opus-5-5
2026-11-10 12:13:07 +01:00
Pierre Rouanet c03918aa76 Setup code from the ID EEPROM, and secure mode whenever a robot has one
The factory writes the setup code into the robot's ID EEPROM with an
external programmer, after the 18-digit label serial:
md1:<first name>:<64 hex>, the same string as the QR printed on it.
robotd-params::label decodes it.

configd's unit runs `robotctl system setup-code export` before it
starts: it takes the EEPROM's code (or a dev board's installed key),
refuses one whose id is not this robot's first name, and leaves the key
in /run/credstore. btd and duck-gateway are ordered after configd and
ImportCredential=ble-psk, so secure mode follows the robot with no
drop-in; without a key btd serves the PIN path and the gateway exits
cleanly. The gateway gains an [Install] section.

`robotctl system setup-code` shows the code and where it came from;
`install` is now for dev boards with nothing in the EEPROM. The factory
doc's sequence becomes: read the first name, generate a random key,
program the EEPROM, print the QR, verify against the printed label.

Assisted-by: Claude:claude-opus-5-5
2026-11-10 11:58:42 +01:00
apirrone adff6e238d Merge remote-tracking branch 'origin/main' into impact-guard-v3
# Conflicts:
#	duck-ipc-proto/src/lib.rs
2026-11-10 13:00:23 +01:00
apirrone 4cfded2c97 monitor: is_none_or, which stable clippy now asks for
Assisted-by: Claude:claude-opus-5-5
2026-11-09 16:23:51 +01:00
Pierre Rouanet 7465e8df7f setup-code: draw the QR with full cells, not half blocks
The half-block glyph stops short of the cell's middle in macOS Terminal's
font, so every dark module above a light one came out thinner and a
phone would not read the code. Draw one module per row as two spaces
painted with the background colour, which fills the whole cell whatever
the font, at error correction L so the code stays within 80 columns.

Assisted-by: Claude:claude-opus-5-5
2026-11-09 16:15:54 +01:00
apirrone 4ff91ff90f Docs: the camera mount is per board, not a quarter turn everywhere
Comments across uyvy, mediad, robotctl and the console said the head
camera "is mounted a quarter turn off". That is the Zero 3W; the beta
boards' GC2093 is upright, and robotd_params::board owns the mount.
mediad/src/camera.rs also still said the GC2093 had no calibration,
though CameraIntrinsics::beta ships for beta and face-board-v1.

Wording only, plus a duck-detect test for the landscape letterbox —
the beta boards' real case, which had none.

Assisted-by: Claude:claude-opus-5-5
2026-11-09 15:50:14 +01:00
apirrone b6415e2f1c Laser tracking: follow a laser dot with the head and the legs
Ported from the prototype runtime, rebuilt for the daemon split.

mediad finds the dot (`media.laser`, a local subscription on media.sock):
it scans frames the tee already hands out, at the stream's own
auto-exposure, so the video is untouched. It looks at `search_hz` until
it sees a dot and `track_hz` while it does, and publishes a direction —
a ray in the upright camera frame, intrinsics and board mount undone —
plus the colour of the best candidate whether it passed or not.

robotd projects that ray onto the floor through head FK, the IMU and
odometry, points the head with the existing look_at IK and walks to the
spot. Each half is taken only while no client wants it: a pushed stick
always wins, and with no dot in sight the robot does what it was told.

`robotctl laser-track on|off` switches it, and its live view is the
tuning tool. `[laser]` in `robotctl configure` holds the thresholds,
rates and walking gains; every key applies live, `enabled` included.

API_VERSION 52: `robot.laserTrack`, `robot.state`'s `laser` block,
`media.laser` / `media.laserDot`.

Assisted-by: Claude:claude-opus-5-5
2026-11-09 15:50:09 +01:00
Pierre Rouanet 9cb079f11d Setup code: the robot's first name as its id, and robotctl to install and show it
The id in a setup code (md1:<id>:<key>) was whatever an operator passed
to btd's --secure-robot-id and the gateway's ROBOT_ID, so nothing on the
robot could print a QR for it. Use the robot's first name instead: the
duck-xxxx default name derived from the SoC serial. It moves from
configd into robotd-params::serial so configd, btd, duck-gateway and
robotctl all derive the same one, and a rename changes none of them.

robotctl system setup-code install reads the 64 hex characters on
stdin, refuses a missing data mount and an existing key without --force,
and commits the file root-only and atomically; it never prints the key.
robotctl system setup-code shows the md1: line and a QR on the terminal.
The robot never generates its key: the station does, per
factory-provisioning.md.

btd --secure-robot-id, duck-gateway --robot-id, ble-gateway.env and
scripts/generate-ble-dev-credential.sh are gone. A btd drop-in still
passing --secure-robot-id fails to start after this; remove the flag.

Assisted-by: Claude:claude-opus-5-5
2026-11-09 15:44:47 +01:00
apirroneandClaude Opus 5.5 730710b99d Merge branch 'main' into impact-guard-v3
impact guard moves to API v52: main took v51 for pad pairing candidates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:29:16 +01:00
Pierre Rouanet 464cd7a308 pad.pair: an ambiguous refusal lists the pads it saw
With two pads in pairing mode the robot refuses rather than guesses, and
says so with a count and, from BlueZ, a sentence naming them. A client had
nothing structured to offer, so the phone app could only say "switch the
others off" — not an option when the other pad is somebody else's.

PadPairResult::Failed gains `candidates`: for `ambiguous`, the pads that
were in pairing mode (one face per pad, the ones pairing by `mac` would
choose between); empty, and absent on the wire, for every other reason.
API v51. Additive both ways: an older configd's refusal parses with an
empty list, and a refusal with nothing to list serialises as before.

Assisted-by: Claude:claude-opus-5-5
2026-11-06 17:42:44 +01:00
Fabien 4a763dd893 Merge pull request #541 from pollen-robotics/mediad-mpp-max-pending
mediad: cap mpph264enc at two pending frames, or the camera stops
2026-11-06 10:24:06 +01:00
Pierre Rouanet 3372424f7b Review: monitor says stopped, one age helper, the pool is eight
- robotctl monitor's camera caption read camera.json the same way health
  did, so a stopped camera kept its last rate on the border. It now
  shows "camera · stopped" once the file is older than
  CAMERA_STATS_MAX_AGE.
- camera_stats_age_at(path, now) is the one file-age helper;
  webrtc_peers_at uses it, so the clock-step rule lives once, and it
  has its own test.
- The capture pool is eight, not four: CAPTURE_BUFFERS plus the four
  v4l2src adds when downstream proposes no pool, and bufcnt:8 on an idle
  board. The comment and media-bringup.md now say so, and record the
  30 s WebRTC session that held 30 fps on the beta board with the cap.

Assisted-by: Claude:claude-opus-5-5
2026-11-06 10:10:29 +01:00
apirroneandClaude Opus 5.5 d081d80053 Merge remote-tracking branch 'origin/main' into impact-guard-v3
Both sides took API_VERSION 50. main's is released in 0.18.6, so it keeps
v50 (the remote-session check) and the impact guard moves to v51.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 10:00:52 +01:00
apirrone 27cdd00a11 Merge remote-tracking branch 'origin/main' into pad-mapping 2026-11-06 16:04:04 +01:00
Pierre Rouanet ba8b7ba92d robotctl health: say a camera that has stopped has stopped
mediad rewrites /run/mediad/camera.json only while frames arrive, so a
camera that stalls leaves its last rate behind, and health printed a
dead camera as "10.0 fps (target 30)". Past CAMERA_STATS_MAX_AGE it now
reads "camera    stopped — no frame for 312s (was 10.0 fps, ...)", and
--json carries camera_stopped_secs.

Assisted-by: Claude:claude-opus-5-5
2026-11-06 09:11:32 +01:00
Pierre Rouanet 8c058c7c1b updater: SESSIONS_CONNECTED, a code of its own for the session refusal
A client answers this refusal differently from every other: it asks its
user whether to drop the other sessions, and on yes sends the same call
with interrupt_sessions. Matching the message would break on the first
rewording, so it gets code 16 when the session check is the only one
that failed. robotctl exits REFUSED for it, as for PREFLIGHT_FAILED.

Assisted-by: Claude:claude-opus-5-5
2026-11-05 18:27:57 +01:00
Rémi Fabre 6f7d600300 robotd: play emotions as skills (robot.do sad)
An emotion is two files in [emotions] dir (default /var/lib/robot/emotions): <name>.json, the
keyframes in the microduck_emotions format, and <name>.wav. robot.do <name> plays it, so it goes
on a pad button like any skill (robotctl pad bind y sad), from every client, with no new call.

While one plays, the loop puts its frame in place of the clients' head, body pose and mouth, with
a zero twist, for that tick: the same policy and safety as the sticks, and the clients' values
back when it ends. Started only on a robot the policy drives with no move in flight; a fall,
limp-fall, Start or a rest ends it and cuts its sound. "skill": "sit" sits the robot down.

The names are listed wherever robot.do's are (the refusal, pad bindings, the subscribe answer
robotctl pad bind checks). scripts/duck-sim reads them from ~/.cache/duck-sim/emotions. Docs: an
Emotions section in the cheat sheet, a row in robotd-design 4.5.

Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 9bcdc89f6e)
2026-11-05 11:40:45 +01:00
Nicolas Rabault ceb6f6e1fd robotd: record ROBOTIS's impact guard firmware, and cap the servos at 1.0 A
The gear-breakage fix is ROBOTIS's impact guard firmware (V3): a servo that hits
something brakes, then holds softly until the goal comes back past it. To test it
on robots:

- The startup register check sets every servo's Current Limit to 1000 mA (factory
  1750) and Goal Current with it. A servo refuses that EEPROM write with torque on,
  as on a standing robot an update restarts, so it then waits for the next start.
- The loop names, once a start, every servo whose firmware is not V3, from the vet
  book's identity read.
- robot.state carries `impact_guard` per joint (register 66: armed, braking,
  holding; null off V3), so `robotctl monitor --json --hz 50` records it. The read
  is one 1-byte fast sync read, after the goal positions are written and only on
  ticks with a subscriber: a robot nobody records runs the bus it always did.

API v50.

Assisted-by: Claude:claude-opus-5-5
2026-11-05 11:11:00 +01:00
Pierre Rouanet b0057f0e5f The update log says STUCK for a release left live, not "refused"
A release that failed its gate and stayed live was journalled as
Outcome::Aborted, which means nothing changed, and `robotctl update log`
printed it as "refused". With auto-rollback off that is now the common
failure, and the switch did happen. It gets its own Outcome::Stuck.

API_VERSION 49: an older client cannot parse a log holding one; an older
updaterd skips the line. duckctl warns of the reconnect on a stuck reply
too, since the daemons restarted.

Assisted-by: Claude:claude-opus-5-5
2026-11-04 16:00:42 +01:00
Pierre Rouanet aff2ce4cc0 Merge branch 'main' into auto-rollback-opt-in 2026-11-04 12:53:54 +01:00
Pierre Rouanet b64def7b73 updaterd: automatic rollback is off unless asked for
`[update_gate] auto_rollback` in robotd.toml, default false, a row in
`robotctl configure`. It gates every path that reverts without being
asked:

- the health gate after `update apply`, `select` and `rollback`;
- the boot counter on a trial that never confirmed;
- `robot-boot-check` handing over to `robot-rescue`.

Off, the gate still runs and decides. A release that fails stays live,
reported `Stuck` with `robotctl update rollback <component>` in the
reason; the trial is cleared, and the journal entry is aborted rather
than rolled back, so `known_bad` does not blacklist it. The boot check
names the failed units and the manual `robot-rescue --reboot`, and exits
2. `--dry-run` is unchanged, since the OS slot gate reads it.

Releases now reach robots as tested Yocto images, and a separate daemon
update is the dev-board case, where an unasked revert replacing the
code under whoever holds the robot does more damage than it prevents.
A soft deprecation: the code stays, tested, one setting away.

`updaterd` reads the key from `robotd_config` (new, defaults to
/etc/robot/robotd.toml), both layers, at the moment of deciding, like
`allow_community` and the board. Test fixtures turn it on where they
test what a revert does.

Assisted-by: Claude:claude-opus-5-5
2026-11-04 12:38:25 +01:00
Pierre Rouanet 909478c8bb robotd: a servo unplugged mid-run is degraded, as at boot
Unplugging servos on a running robot made `robot.health` unhealthy
("N consecutive bus read failures"), while the same robot rebooted was
degraded and named the missing servos. Unhealthy is the verdict that
blames the release: the health gate reverts on it.

A failed sync read cannot say whether a servo went quiet or the read
path is broken. So once a run of failed reads reaches
`max_consecutive_errors`, and every 5 s while it lasts, the loop pings
every servo and the IMU board (`RobotIo::census`). If something is
silent, health is degraded and names it, in the startup wording. If
everything answers, or the ping fails, it stays unhealthy. A good read
clears the census.

`BusHealth::missing` and `ImuHealth::missing` now carry the runtime
census too. API_VERSION 47 -> 48; same fields and shapes, so an older
reader prints the read failures without the names. `robotctl health`
names them on the bus line.

Assisted-by: Claude:claude-opus-5-5
2026-11-04 11:30:24 +01:00
apirroneandClaude Opus 5.5 e769752991 robotctl configure: the dev-board switch is a row in the editor
`--allow-dev-daemon` was a command-line flag only, so it could not be
found in `robotctl configure`'s editor. It is now the first row,
`allow_dev_daemon` under `[dev board]`: SPACE/ENTER toggles, u reverts
to off, ^f finds it, and it saves with the robotd.toml edits and adds
updaterd to the restart offer.

Not a key in the editor's model, which is robotd.toml's: the row is a
`dev_daemon::Switch` over the same marker the flag writes. No
updater.toml (a laptop, a simulated duck) means no row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 15:30:02 +01:00
apirroneandClaude Opus 5.5 db7f0311bf robotctl configure --allow-dev-daemon: a dev board in one command
Making a board take branch builds meant copying team.dev.pub into
/etc/robot/trusted_keys under exactly the right name, sed-ing
allow_dev_keys in updater.toml, and restarting updaterd. On the Yocto
image both live in /etc, which an A/B OS update replaces, so the board
quietly stopped being a dev board at the next OS update.

updaterd now carries the dev public key built in (always dev-only), and
dev keys count when `allow-dev-builds` exists in its state_dir, under
/var/lib/robot, which survives OS updates. `sudo robotctl configure
--allow-dev-daemon on|off` writes or removes it and restarts updaterd.
allow_dev_keys = true in updater.toml still works, so provisioned boards
are unchanged; the shipped config keeps it false and nothing ships the
marker.

Needs an updaterd from a release that carries this: an older one
ignores the marker.

Docs: updater-design.md §5.4 owns the mechanism; install-dev,
cheatsheet-dev, dev-push, architecture, deploy READMEs, config comments,
--ref help text, xtask keygen and the dev.yml note point at the command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:50:22 +01:00
Pierre Rouanet 0357f5976e robot-boot-check: decide once the daemons settle, not 180 s in
The boot check slept until 180 s after boot and looked once. On a Yocto
board every member is up by 16 s, so a healthy boot waited nearly three
minutes for a verdict nothing needed it to wait for — and the OS's own
gate, which copies the deadline, held the OS update page on "rebooting"
for as long.

The timer now starts the script a second in, and it looks every 2 s
until the first of: a member that did not come up (hand over at once;
the predicate is unchanged), every member `active` for 10 s straight
(the release came up — about 25 s in on a Yocto board), or the deadline.

The deadline is `[update_gate] boot_deadline_s` in robotd.toml, 60 s by
default. It is when a boot that never settles is judged, by restart
count, and updaterd's 10 s RestartSec needs about 45 s to show a crash
loop. The script clamps it to 20-300 rather than robotd-params refusing
it, since every daemon reading the file exits on a refused value.
`robotctl configure` says it applies at the next boot.

`--dry-run` now exits 3 where it would have handed over, so
microduck-slot-health can ask the same question instead of copying it.

Assisted-by: Claude:claude-opus-5-5
2026-10-29 17:28:01 +01:00
apirroneandClaude Opus 5.5 b35772dc90 configure: run's doc back on run; a stray key no branch has
ignored_note had been put between `run`'s doc comment and `run`, so the
editor's doc described the note instead. And the tests' stray key was
policy.footstep_control, which the footsteps branch knows — they failed
there. A made-up policy.moonwalk is unknown everywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 13:02:44 +01:00
apirroneandClaude Opus 5.5 6e6111f1ca configure: name the base's unknown keys too, in yellow and kept on screen
On a layered robot, adoption leaves keys this build does not know in the
base (/etc/robot/robotd.toml), so that is exactly where a stale key from
another branch sits — and the editor only named the user layer's. The base's
are now named with the base's path.

The note is yellow, not the red of an error, and stays in a footer line of
its own instead of vanishing on the first keypress: it is not something the
editor can fix. `--list` prints it in yellow on a terminal, plain otherwise.

adopt_base_edits' doc no longer claims the editor reads the user layer
strictly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 12:41:43 +01:00
apirrone e5974a7619 Merge branch 'main' into configure-tolerates-unknown-keys
# Conflicts:
#	robotd-params/src/edit.rs
#	robotd-params/src/lib.rs
2026-10-29 12:40:27 +01:00
apirroneandClaude Opus 5.5 1e6998b8f6 configure: open a robotd.toml with keys from another branch
robotd already ignores keys this build does not know (named at warn), but
the editor, pad_bindings and the editor's resolved hints parsed strictly.
A key left behind by another branch — policy.footstep_control — meant a
robot that walked fine and a `robotctl configure` that would not open, and
a pad.bind that served the default bindings instead of the file's.

Params::parse is now the one parse every reader goes through. The editor
names the ignored keys on open (status line, stderr for --list) and keeps
them in the file for the branch that reads them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 10:36:27 +01:00
Pierre Rouanet b60349fee0 vetbook: date community policies coming and going
When a policy change goes live and a slot or skill starts or stops
running a community policy, robotd writes a `policy` event naming
org/name@revision. It is written at the swap, not when the request is
accepted, so a load that failed to build is never recorded.

Official changes are not logged: the events list is capped, and the
question the book answers is which stranger's network a duck ran.
`robotctl vetbook` gives the new kind its own icon in the diary.

Assisted-by: Claude:claude-opus-5-5
2026-10-28 15:55:30 +01:00
Pierre Rouanet 83d8d4b2ab policy: fetch community policies only when allowed
A robot now only fetches policies from pollen-robotics on the Hub.
`[policy] allow_community` in robotd.toml, false by default, lets
`policy.fetch` download from any other org. Refused, it answers
PERMISSION_DENIED naming the key, before any request is made.

The gate is in updaterd's fetch, the one place every transport and
client reaches. updaterd reads the key before each fetch, as it does
the board, so `robotctl configure` applies it live with no restart.

It gates the download only. A slot already pointing at a community
policy keeps running, so turning the key off never changes what a
robot runs at its next start. policy-channel-design.md section 9.2.

Assisted-by: Claude:claude-opus-5-5
2026-10-28 15:39:30 +01:00
apirroneandClaude Opus 5.5 47d2a23975 vetbook gallery: an opt-in social network of ducks on the Space
Sharing the vet book now asks whether to list the duck in the gallery, the
microduck-vetbook Space's new front page: search by duck or owner, sort by
any stat, filter by mood and badge, a tile opens the card and the owner's
name their Hugging Face profile.

- API v45: vetbook.share takes { listed }; absent or null means unlisted, so
  an older client still shares as before, and an older updaterd ignores it.
- updaterd writes share.listed into the book and, when listed, the
  microduck-vetbook-gallery tag on the dataset card. The Space finds books by
  the tag and believes only share.listed. Sharing unlisted removes both.
- robotctl: s asks y (list) / n (share unlisted) / esc first; the result
  popup says whether the duck is listed.
- Space: gallery.py (book -> row, tested), a Hub listing refreshed every
  5 minutes with only changed commits re-read, owners' avatars, /api/ducks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 14:55:13 +01:00
apirroneandClaude Opus 5.5 6816d1307b robotctl endurance: a battery and heat test that runs until the pack is empty
`sudo robotctl endurance` walks, stands and sits at random within half a
metre of where it started, and every 10 s logs the charge, every thermal
zone, the CPU clock and throttle, servo temperature and current, and
odometry to /var/lib/endurance/<hostname>-<time>/. It runs as the
robotctl-endurance unit so the ssh session can close; `status` and `stop`
manage it, `--dry-run` logs without moving (the idle-drain baseline).
scripts/endurance-plot.py draws a run on the laptop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:00:13 +01:00
apirrone 33b952ed35 Merge remote-tracking branch 'origin/main' into maploc-v2 2026-10-14 17:46:22 +02:00