One-command installer + guided setup: role detection, self-flying sign test v2

- install.lua: single entry point -- detects role from peripherals
  (flight sensors = autopilot, monitor = cockpit), installs, cleans
  legacy/removed files, then hands off straight into setup/standby.
  Ship state (sides/calib/target/settings) is never shipped; existing
  profiles can be kept or reset on re-install.
- Sign test v2: fully self-driving -- staircase power search (learns
  hover), closed-loop climb, both-direction verification with auto-
  escalating nudge, controlled descent. Never freefalls, also not on
  Ctrl+T or abort.
- Setup wizard (ap setup): wiring pulse-walk + sign test in one guided
  flow; offered automatically on first boot without a profile.
- New launcher 'ap' (stabilizeV2 kept as case-safe identical aliases;
  removes Windows-host case-collision recursion risk).
- build.sh: repo is source of truth; LC_ALL=C sorted manifests;
  optional --from-world/--to-world dev sync with exclude lists.
- Removed legacy v1 files and per-ship state from the repo/manifest
  (26 -> 17 files in the autopilot role).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 23:21:54 +02:00
parent 71e750bbe0
commit 54963e5b42
24 changed files with 617 additions and 1135 deletions

View File

@@ -3,48 +3,80 @@
Altitude/pitch autopilot for a hot-air airship, delivered as an in-game installer
so it runs on any Minecraft server regardless of the computer's id.
## Install on a server
## Install — ONE command, both PCs
On the CC computer, run one command. Pick the role for that machine:
Run the **same** command on each CC computer:
```
-- machine-room PC (full autopilot, boots to standby):
wget run https://gt.zyon.no/Stian/airship-autopilot/raw/branch/main/install.lua autopilot
-- pilot-house PC (control console):
wget run https://gt.zyon.no/Stian/airship-autopilot/raw/branch/main/install.lua cockpit
wget run https://gt.zyon.no/Stian/airship-autopilot/raw/branch/main/install.lua
```
Omit the role to get a menu. Re-run any time to update to the latest code.
The installer detects which PC it is on (flight sensors → `autopilot`,
monitor → `cockpit`), installs the right role, and continues **straight into
setup** — no reboot, no role names to remember. Re-run the same command any
time to update; it also cleans out files that no longer belong and asks
whether to keep or reset the ship profile.
(Advanced: append `autopilot` or `cockpit` to override detection.)
Requires HTTP enabled on the server (default on). If it is off, set
`[http] enabled = true` in `computercraft-server.toml` and restart the server.
## First-time setup (per ship)
The installer ships **code only** — everything ship-specific (which redstone
side drives which balloon, pitch sign, hover level) is measured on the ship by
the **setup wizard**, which the install flow takes you straight into:
1. **Wiring** — the wizard pulses each free side; you say which burner fired.
2. **Sign test** — the ship lifts off by itself, finds its own lift power,
pushes the front balloon, verifies the response in both directions
(auto-escalating the push if the response is weak), then descends and holds
hover. No config editing, no freefall. Takes 13 minutes.
After that the ship is ready: `FLY` from the menu or `ENGAGE` from the cockpit
console. Pitch and altitude keep self-learning in flight. The wizard can be
re-run any time: `ap setup`, press `S` in standby, or menu choice 1.
Balloon orientation does **not** need to match any particular side of the
computer: sensors are found by type, wiring is mapped by the wizard, and the
pitch sign is measured — the only physical requirement is both balloons on the
fore/aft line (the axis the gimbal reports as pitch).
## Roles
| Role | Source PC | Boots | Purpose |
|-------------|-----------|-----------------|------------------------------------------|
| `autopilot` | 0 | `stabilizeV2 standby` | v3 observer autopilot (13 modules in `autopilot/`) |
| `cockpit` | 4 | `cockpit` | pilot control console |
| Role | Boots | Purpose |
|-------------|----------------------|---------------------------------------------|
| `autopilot` | `ap boot` → wizard/standby | v3 observer autopilot (13 modules in `autopilot/`) |
| `cockpit` | `cockpit` | pilot control console (monitor + modem) |
Boot chain (autopilot): `startup.lua` -> `stabilizeV2` -> `autopilot/main.lua`.
Menu / wiring / sign-test: `Ctrl+T` then `stabilizeV2` for the menu.
Boot chain (autopilot): `startup.lua` `ap boot` `autopilot/main.lua`.
Menu any time: `Ctrl+T`, then `ap`. (`stabilizeV2` remains as an alias.)
Ship state lives on the computer only: `sides.txt`, `calib.txt`, `target.txt`,
`settings.txt`. Reset it via menu `p``R`, or when re-running the installer.
## Updating the code
The `files/` tree mirrors the live singleplayer world. After editing the Lua
locally, regenerate the manifests and push:
The repo is the source of truth for the installer. After editing the Lua:
```
./build.sh
./build.sh # regenerate manifests
git commit -am "sync autopilot"
git push
```
Then re-run the `wget run` command in-game to pull the update.
`build.sh` reads from the "Modda wii" world by default; pass a different
`computercraft/computer` path as arg 1 if the world moves.
Syncing with the singleplayer dev world (optional):
```
./build.sh --from-world # world -> files/ (code only; state/legacy filtered)
./build.sh --to-world # files/ -> world (code only; never touches state)
```
Default world path is the "Modda wii" save; pass a different
`computercraft/computer` path as arg 2 if the world moves.
## Notes